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

Clean up auth related code with traits, and reuse existing key generation code. #1988

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

jsdt
Copy link
Contributor

@jsdt jsdt commented Nov 12, 2024

Description of Changes

This is an attempt to clean up auth-related code. To summarize the main changes:

  1. We don't use a global OIDC key cache any more.
  2. The 4 JWT related functions in the NodeDelegate trait were removed, and the functionality was put in the JwtAuthProvider trait. NodeDelegate now just has one function to return an auth provider. This should make it easier to change this in the future. The new trait also exposes functions for signing and verifying keys, rather than giving the concrete keys.
  3. SpacetimeIdentityClaims2 is now the only SpacetimeIdentityClaims.
  4. Instead of using jsonwebkey in the token validation tests, we use the same key generate code that is used for standalone key generation. There were some small changes to the key generate code to make it easier to reuse.

There is a corresponding private PR.

API and ABI breaking changes

None.

Expected complexity level and risk

  1. This is close to functionally equivalent, and should make future auth changes less complex.

Testing

Most of the unit tests for this code are in token_validation.rs.

@jsdt jsdt marked this pull request as ready for review November 12, 2024 16:52
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

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

Approving the code owner parts I'm responsible for.

@jsdt jsdt added this pull request to the merge queue Nov 12, 2024
Merged via the queue into master with commit cccadd1 Nov 12, 2024
8 of 9 checks passed
@jsdt jsdt deleted the jsdt/auth-refactor-merge branch November 13, 2024 16:31
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