Skip to content

Comments

add support for JWT audience validation#7578

Merged
Velfi merged 8 commits intodevfrom
zelda/add-JWT-audience-validation
Jun 3, 2025
Merged

add support for JWT audience validation#7578
Velfi merged 8 commits intodevfrom
zelda/add-JWT-audience-validation

Conversation

@Velfi
Copy link
Contributor

@Velfi Velfi commented May 27, 2025

Exactly what it says on the tin.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@Velfi Velfi requested a review from a team May 27, 2025 18:53
@Velfi Velfi requested a review from a team as a code owner May 27, 2025 18:53
@github-actions

This comment has been minimized.

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented May 27, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* graphos/routing/(latest)/security/jwt.mdx

Build ID: b16fd17b47dd1e584f7bc824

URL: https://www.apollographql.com/docs/deploy-preview/b16fd17b47dd1e584f7bc824

name: super::default_header_name(),
value_prefix: super::default_header_value_prefix(),
});
match authenticate(&config, &manager, request.try_into().unwrap()) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this testing that a JWT with no audience claim is always accepted? Should we accept or reject such claims?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know what's more correct. I took the behavior from what we're doing with iss already. I figure we can accept them now and reject in the future if we learn it's a bad thing to do.

Copy link
Member

Choose a reason for hiding this comment

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

I'm starting to think that the iss and aud should both reject if the issuers or audiences options are configured, but the value in the token is missing or not a string...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made changes to this so that we'll reject when client aud is missing if server one is configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not going to do it for issuer since I don't want to break anyone.

Copy link
Member

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

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

Looks good, does need a changeset!

@Velfi Velfi merged commit 4f3ad2e into dev Jun 3, 2025
15 checks passed
@Velfi Velfi deleted the zelda/add-JWT-audience-validation branch June 3, 2025 13:39
@abernix abernix mentioned this pull request Jul 1, 2025
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.

3 participants