[DUOS-2873][risk=no] Cache request headers and populate auth user with them #2233
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.
Addresses
https://broadworkbench.atlassian.net/browse/DUOS-2873
Summary
This PR replaces the current Google token lookup to retrieve user information in favor of using incoming
OAUTH2_CLAIM
headers.OAUTH2_CLAIM_*
request headers in a map of bearer token -> header mapOAuthAuthenticator
which only has access to a bearer tokenAuthUser
with values from the claims.OAuthAuthenticator
does not need to actually validate the token, that has happened already in the proxyGenericUser
and all usages thereof.Notes
Our proxy populates a number of
OAUTH2_CLAIM
headers depending on the login choices. This info is enough to populate theAuthUser
used throughout the app. Examples used in testing:Testing
To test, run this branch locally:
curl -X 'GET' 'https://local.broadinstitute.org:27443/api/user/me' -H 'accept: application/json' -H 'Authorization: <copied token>'
curl -X 'GET' 'https://local.broadinstitute.org:27443/api/user/me' -H 'accept: application/json' -H 'Authorization: <copied token>'
Have you read CONTRIBUTING.md lately? If not, do that first.