Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(http): Improve API token format warning #1147

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

UnseenWizzard
Copy link
Contributor

@UnseenWizzard UnseenWizzard commented Aug 25, 2023

The previous log about using an old token format was misleading, as we don't actually check for an old format, but just if the new format is matched.

As the new format exists since October 2020, it is much more likely that a random string was provided as a token, than an actual old API token.

To reflect this, the log warning is changed to point the user towards checking their configuration first, but still mention to possibly update their tokens.

Old warning:

2023-08-18T12:21:39+02:00 warn You used an old token format. Please consider switching to the new 1.205+ token format.
More information: https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication

New warning:

2023-08-25T10:37:33+02:00       warn    The supplied token does not match the expected format and may be invalid. If authentication fails, please check your manifest and environment variable configuration.
If you are using a token created before Dynatrace 1.205, please consider generating a new token: https://www.dynatrace.com/support/help/dynatrace-api/basics/dynatrace-api-authentication

relates to discussion on #1129

@UnseenWizzard UnseenWizzard requested a review from a team as a code owner August 25, 2023 08:40
@github-actions
Copy link

github-actions bot commented Aug 25, 2023

Test Results

       2 files     192 suites   1m 22s ⏱️
1 482 tests 1 482 ✔️ 0 💤 0
2 964 runs  2 964 ✔️ 0 💤 0

Results for commit 1137256.

♻️ This comment has been updated with latest results.

pkg/client/auth/http.go Outdated Show resolved Hide resolved
Laubi
Laubi previously approved these changes Aug 25, 2023
The previous log about using an old token format was misleading, as we don't
actually check for an old format, but just if the new format is matched.

As the new format exists since October 2020, it is much more likely that a
random string was provided as a token, than an actual old API token.

To reflect this, the log warning is changed to point the user towards checking
their configuration first, but still mention to possibly update their tokens.
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@UnseenWizzard UnseenWizzard merged commit fa530d0 into main Aug 25, 2023
@UnseenWizzard UnseenWizzard deleted the chore/improve-token-warning branch August 25, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants