-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
assert ( | ||
json.loads(extract_payload(jwt, config.security.APP_ENCRYPTION_KEY))[ | ||
JWE_PAYLOAD_SCOPES | ||
] | ||
is None |
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.
sorry i'm probably just missing something, why are there no scopes here? I thought the root client got all the scopes.
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.
I didn't see anywhere in the original fidesops root client where that happed. What I saw it looked like it got set to None
. Maybe I missed it somewhere?
Pushing out what I have, but using Postman, I get steps:
I've confirmed the jwt token contains all scopes, so unsure what could be wrong. |
@pattisdr this is ready for you again. We realized that previously, we were hard-coding scopes (
Currently, that code has moved to |
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.
Looks great, just looking for a comment to add clarity.
@@ -76,7 +76,9 @@ async def acquire_access_token( | |||
else: | |||
raise AuthenticationFailure(detail="Authentication Failure") | |||
|
|||
client_detail = ClientDetail.get(db, object_id=client_id, config=config) | |||
client_detail = ClientDetail.get( | |||
db, object_id=client_id, config=config, scopes=SCOPE_REGISTRY |
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.
From an organizational perspective, this is confusing, in that these scopes are only used if the client is the root client, otherwise, we use their actual associated scopes, but just looking at this line, that is not necessarily obvious. I'd at least add a code comment here explaining that.
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.
good point, I'd love to rename scopes
to root_scopes
or all_scopes
or something in future, though that'll require more fideslib changes. For now, let's get this working, and I'll update with a comment
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.
thank you for adding!
db, object_id=client_id, config=config, scopes=security_scopes.scopes | ||
db, object_id=client_id, config=config, scopes=SCOPE_REGISTRY |
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.
Is there already a ticket to cut over to using the fideslib version?
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.
We're bumping version in this PR here- https://github.com/ethyca/fidesops/pull/830/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552L13
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.
You mean fideslib scops? We weren't able to put the scopes in fideslib and had to do it this way because the different libraries have different scopes.
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.
I meant using the fideslib verify_oauth_client!
Co-authored-by: Paul Sanders <[email protected]> Co-authored-by: eastandwestwind <[email protected]>
Purpose
Bumps fideslib to fix bug when there are no scopes in
ClientDetail
Changes
Checklist
CHANGELOG.md
fileCHANGELOG.md
file is being appended toUnreleased
section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.Run Unsafe PR Checks
label has been applied, and checks have passed, if this PR touches any external servicesTicket
Fixes #829