Skip to content
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

PXP-6617 Add custom scopes validation and revert aud validation to default #47

Merged
merged 27 commits into from
Apr 29, 2021

Conversation

vpsx
Copy link
Contributor

@vpsx vpsx commented Sep 23, 2020

Add custom scopes validation and revert aud validation to default; services (eg Fence) will stop using aud claim for scopes. Matching Fence PR here uc-cdis/fence#839

Greater detail in the commit messages.

Breaking Changes

  • Add custom scopes validation and revert aud validation to default; services (eg Fence) will stop using the aud claim for scopes. Changes are in token.validate_jwt and core.validate_jwt as well as the require_auth_header decorator.

Improvements

  • Update some docstrings
  • Allow passthrough of 'options' arg to pyjwt (via token.validate_jwt and core.validate_jwt)

Dependency updates

Deployment changes

@github-actions
Copy link

github-actions bot commented Sep 23, 2020

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

vpsx added 21 commits February 9, 2021 11:31
…laim

* import new JWTScopeError
* add new scope arg to core.validate_jwt
* add new scope validation to core.validate_jwt
* remove custom aud validation from core.validate_jwt
* remove random_aud hack in core.validate_jwt; type(aud) now string-or-None, not set-or-list
* pass aud through to PyJWT for normal validation
* update docstring for core.validate_jwt
* allow empty aud arg in validate.validate_jwt; cease raising ValueError
* add new optional scope arg in validate.validate_jwt; pass through to core.validate_jwt
* update docstring for validate.validate_jwt
* because default_audience may change to not None in future
* and because this better reflects the intention of the test
* ...if a value for iss is avbl, from app cfg BASE_URL or USER_API.
* Also clarify core.validate_jwt docstring.
* Update default_audience fixture accordingly
* Update tests to account for new default claims
…validate_request

* Also let scope={} by default
* Update calls to require_auth_header
* based on flask.current_app.config
* Since this already assumes Flask request ctx, I think OK to look in Flask app cfg in this case
.pre-commit-config.yaml Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
src/authutils/token/fastapi.py Show resolved Hide resolved
src/authutils/token/core.py Outdated Show resolved Hide resolved
src/authutils/token/validate.py Outdated Show resolved Hide resolved
src/authutils/user.py Outdated Show resolved Hide resolved
vpsx and others added 2 commits April 23, 2021 09:23
Co-authored-by: Pauline Ribeyre <ribeyre@uchicago.edu>
Co-authored-by: Pauline Ribeyre <ribeyre@uchicago.edu>
@vpsx vpsx merged commit 2b7538e into master Apr 29, 2021
@vpsx vpsx deleted the fix/aud branch April 29, 2021 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants