-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: specify the correct audience when getting an Optimize auth token #185
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jwulf
approved these changes
Jun 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for finding and fixing this!
jwulf
pushed a commit
that referenced
this pull request
Jun 13, 2024
…#185) Optimize API calls were not authorized with the correct token audience, leading to a 401 in every case. This is now fixed to use the correct token audience.
github-actions bot
pushed a commit
that referenced
this pull request
Jun 13, 2024
## [8.6.3](v8.6.2...v8.6.3) (2024-06-13) ### Bug Fixes * specify the correct audience when getting an Optimize auth token ([#185](#185)) ([a852281](a852281))
github-actions bot
pushed a commit
that referenced
this pull request
Jun 13, 2024
## [8.6.3](v8.6.2...v8.6.3) (2024-06-13) ### Bug Fixes * specify the correct audience when getting an Optimize auth token ([#185](#185)) ([a852281](a852281))
github-actions bot
pushed a commit
that referenced
this pull request
Jun 13, 2024
## [8.5.8](v8.5.7...v8.5.8) (2024-06-13) ### Bug Fixes * specify the correct audience when getting an Optimize auth token ([#185](#185)) ([a6a642a](a6a642a))
github-actions bot
pushed a commit
that referenced
this pull request
Jun 13, 2024
## [8.5.8](v8.5.7...v8.5.8) (2024-06-13) ### Bug Fixes * specify the correct audience when getting an Optimize auth token ([#185](#185)) ([a6a642a](a6a642a))
dfulgham
pushed a commit
to dfulgham/camunda-8-js-sdk
that referenced
this pull request
Jul 8, 2024
## [8.6.3](camunda/camunda-8-js-sdk@v8.6.2...v8.6.3) (2024-06-13) ### Bug Fixes * specify the correct audience when getting an Optimize auth token ([camunda#185](camunda#185)) ([a852281](camunda@a852281))
dfulgham
pushed a commit
to dfulgham/camunda-8-js-sdk
that referenced
this pull request
Jul 8, 2024
## [8.6.3](camunda/camunda-8-js-sdk@v8.6.2...v8.6.3) (2024-06-13) ### Bug Fixes * specify the correct audience when getting an Optimize auth token ([camunda#185](camunda#185)) ([a852281](camunda@a852281))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Originally reported by @SamanthaHolstine in Camunda internal Slack.
This PR corrects the audience argument for getting an auth token from the OptimizeApiClient.
The OptimizeApiClient was passing the
OPERATE
audience, instead ofOPTIMIZE
. This was resulting in any request to an authorized Optimize endpoint failing, with a401 Unauthorized
response.I confirmed with a local reproduction that changing to
OPTIMIZE
fixes the issue. I didn't find an existing place to put a test; let me know if I overlooked something, or if you have suggestions on how I can include a test for this behavior.Note also that I made this commit with the
--no-verify
flag, because I could not get unit tests passing locally, seemingly unrelated to my change. See below for the tests that consistently failed for me, maybe you have some suggestions about what I'm missing for those tests to pass.