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

refactor: replace python-jose with pyjwt #243

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

mariuswinger
Copy link
Contributor

Why is this pull request needed?

The package python-jose seems to be unmaintained (last commit in 2021). This PR replaces it with a more up to date alternative. Courtesy of @soofstad

What does this pull request change?

Just replaces the relevant parts of code. Replacement was fairly straight-forward.

Issues related to this change:

Copy link
Collaborator

@soofstad soofstad left a comment

Choose a reason for hiding this comment

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

I have only one question, does the HTTP request to grab JWKs get cached?
Like, does that happen on JWKClient instantiation, or when we first access the keys.

api/src/authentication/authentication.py Outdated Show resolved Hide resolved
@mariuswinger mariuswinger requested a review from a team as a code owner June 11, 2024 09:13
@mariuswinger mariuswinger force-pushed the refactor/change-python-jose-to-pyjwt branch from ad712bf to 618258c Compare June 11, 2024 09:16
@mariuswinger
Copy link
Contributor Author

I have only one question, does the HTTP request to grab JWKs get cached? Like, does that happen on JWKClient instantiation, or when we first access the keys.

From what I can gather caching to the client happens when a signing key is requested. But we do create a new client for every request, so that would likely not make use of that caching ...

@mariuswinger
Copy link
Contributor Author

I have only one question, does the HTTP request to grab JWKs get cached? Like, does that happen on JWKClient instantiation, or when we first access the keys.

From what I can gather caching to the client happens when a signing key is requested. But we do create a new client for every request, so that would likely not make use of that caching ...

Nope, there is a cache decorator above the get_JWK_client function, so it returns the same client instance and therefore utilizes the caching!

@mariuswinger mariuswinger merged commit b18dd4b into main Jun 11, 2024
7 checks passed
@mariuswinger mariuswinger deleted the refactor/change-python-jose-to-pyjwt branch June 11, 2024 10:26
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