Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@paulineribeyre
Copy link
Contributor

@paulineribeyre paulineribeyre commented Jul 11, 2025

Link to JIRA ticket if there is one: https://ctds-planx.atlassian.net/browse/PPS-2007 and https://ctds-planx.atlassian.net/browse/PPS-2012

Closes #73 (temporary fix)

New Features

  • The audience aud field of JWT tokens is not validated anymore. The validation of which Gen3 instance a token is meant for is already done by using the issuer iss field to get public keys and verify the signature.

Breaking Changes

  • The audience aud field of JWT tokens is not validated anymore.

Bug Fixes

  • Fix "Authentication Error: Audience doesn't match" errors in Gen3 services (such as Sheepdog and Peregrine) running in a local Helm instance. The tokens' "audience" set by Fence (typically the BASE_URL setting "https://hostname/user") did not match the "audience" used by the services (typically the USER_API setting "http://fence-service").

Improvements

Dependency updates

Deployment changes

@github-actions
Copy link

The style in this PR agrees with black. ✔️

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

@coveralls
Copy link

coveralls commented Jul 11, 2025

Pull Request Test Coverage Report for Build 16530226153

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 23 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.2%) to 60.455%

Files with Coverage Reduction New Missed Lines %
authutils/token/core.py 10 81.36%
authutils/user.py 13 69.77%
Totals Coverage Status
Change from base Build 14274986787: 0.2%
Covered Lines: 292
Relevant Lines: 483

💛 - Coveralls

jawadqur
jawadqur previously approved these changes Jul 11, 2025
k-burt-uch
k-burt-uch previously approved these changes Jul 18, 2025
Copy link
Contributor

@k-burt-uch k-burt-uch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor doc and comment clean up. Good to go on my end.

# was if fence generated it, so this provided no further protection beyond general JWT / public
# key verification and validation. The validation of which Gen3 instance the token is meant for
# is already done by using the issuer (`iss` field) to get public keys and verify the signature.
if aud is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issuers.append(value)

# Can't set arg default to config[x] in fn def, so doing it this way.
if aud is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated: https://github.com/uc-cdis/authutils/blob/master/src/authutils/token/validate.py#L85 to avoid confusion on whether the aud is validated or not.

Copy link

@piotrsenkow piotrsenkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes and testing function are very clear and make sense to me, I believe all the comments in the PR have been also addressed. Approving PR, great work.

@paulineribeyre paulineribeyre merged commit c7990f3 into master Jul 25, 2025
6 checks passed
@paulineribeyre paulineribeyre deleted the feat/no-aud-check branch July 25, 2025 21:10
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.

7 participants