-
Notifications
You must be signed in to change notification settings - Fork 3
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
HP-1699 add user agent header #92
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bfd534b
(HP-1699): add User-Agent header to external oidc settings
george42-ctds 0e76a2d
(HP-1699): revert settings, add header to fetch_token
george42-ctds d74a2e2
(HP-1699): add header to revoke_token
george42-ctds 358bfff
(HP-1699): re-order params in fetch_token
george42-ctds 99469dc
(HP-1699): use single quotes in header
george42-ctds a51dece
(HP-1699): revert header format
george42-ctds 6e02f6f
(HP-1699): import app version from installed package
george42-ctds 4030c30
(HP-1699): add unit test for new header in fetch_token
george42-ctds 7c0b07e
Merge branch 'master' into chore/add-user-agent-header
george42-ctds 0d04d37
(HP-1699): add unit test for revoke_token
george42-ctds 5e08117
(HP-1699): remove spaces in header value
george42-ctds 58fed19
(HP-1699): update unit test to remove spaces in header value
george42-ctds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,7 +28,12 @@ def client_do_authorize(): | |||||
if mismatched_state: | ||||||
raise AuthError("could not authorize; state did not match across auth requests") | ||||||
try: | ||||||
tokens = client.fetch_token(token_url, **flask.request.args.to_dict()) | ||||||
app_version = flask.current_app.config.get("APP_VERSION", "0.0.0") | ||||||
tokens = client.fetch_token( | ||||||
token_url, | ||||||
headers={"User-Agent": f"Gen3WTS / {app_version}"}, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
**flask.request.args.to_dict(), | ||||||
) | ||||||
refresh_refresh_token(tokens, requested_idp, username_field) | ||||||
except KeyError as e: | ||||||
raise AuthError("error in token response: {}".format(tokens)) | ||||||
|
Oops, something went wrong.
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.
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.
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.
Shoot, that isn't working for me. I'm getting an "Invalid username" message from https://idp.stage.qdr.org/ when I try to log in.
Can you verify if you are able to log in or not? The change is deployed in QA-HEAL.
I had tried removing the spaces in this earlier commit. I wasn't able to log in so I had reverted the change in the next commit.
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.
Just tried in QA, I could refresh my QDR creds after logging in via their staging env
Have you regierstered an account at https://stage.qdr.org/ ?
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.
Yes, it is now working for me! I'm able to log in to stage after being redirected from the qa-heal authorize_url endpoint. I'm not sure why it wasn't working earlier.
I will update the unit tests to remove the spaces in the expected header value.