chore: limit most classic-environment calls to apiToken only #877
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Why this PR?
The OAuth permission
environment-api:*is not available anymore. Therefore, it doesn't make sense that some resources that rely on this one make OAuth requestsWhat has changed?
Affected classic environment resources are now API token-only instead of API token and OAuth.
How does it do it?
By replacing HybridClients with ApiTokenClients
How is it tested?
Current tests are sufficient.
How does it affect users?
They have to use API tokens instead or in addition to OAuth for the following resources:
dynatrace_host_monitoring_mode(uses OAuth and API tokens)dynatrace_slodynatrace_slo_v2(uses OAuth and API tokens)dynatrace_custom_tagsdynatrace_browser_monitordynatrace_http_monitor_scriptdynatrace_http_monitordynatrace_ag_tokendynatrace_api_tokendynatrace_credentialsdynatrace_custom_devicedynatrace_key_requests(uses OAuth and API tokens)dynatrace_hub_extension_active_versiondynatrace_hub_extension_configdynatrace_network_zonedynatrace_network_monitorRegarding
uses OAuth and API tokens: There are some resources that combine multiple requests. For example,dynatrace_host_monitoring_modecalls the entities endpoint and settingsbuiltin:host.monitoring.mode. In this case OAuth is preferred for the request if the envDYNATRACE_HTTP_OAUTH_PREFERENCEis set totrue.and the following data sources:
dynatrace_lambda_agent_versiondynatrace_synthetic_nodesdynatrace_entitiesdynatrace_entityIssue: CA-17080