Merged
Conversation
willronchetti
approved these changes
Oct 31, 2023
Member
willronchetti
left a comment
There was a problem hiding this comment.
These changes generally look good but may merit some unit testing/fixes in existing tests, happy to take that on if needed. We also need to enable signature verification.
dcicutils/redis_tools.py
Outdated
| #TODO: verify_signature should be True | ||
| return jwt.decode(self.jwt, secret, audience=audience, leeway=leeway, | ||
| options={'verify_signature': True}, algorithms=['HS256']) | ||
| options={'verify_signature': False}, algorithms=algorithms) |
Member
There was a problem hiding this comment.
Does this still not work when verify_signature = True?
This was referenced Oct 31, 2023
eb4608e to
564b1fc
Compare
Pull Request Test Coverage Report for Build 6908964577
💛 - Coveralls |
This file contains hidden or 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
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.
This PR extends the
valuethat is stored as Redis(key, value)pair:Old format:
jwtTokenNew format:
jwtToken:email(since jwtToken is base64 encoded, :(colon as the separator makes sense.ToDo
From Researcher Auth Service (RAS) Project Partner Developer Guide:
To comply with GA4GH, only the following signing algorithm is supported: RS256.While the data portals' Auth0 implementation works with HS256, RAS only uses RS256. Current JWT encoding/decoding functions throw the exception below since RS256 requires public/private keys to sign tokens. We bypassed the decoding's verify_signature by setting False for now, which should be True in production.
ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=75497580, lib=9, reason=108, reason_text=b'error:0480006C:PEM routines::no start line')])Related PRs: