-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: replace python-jose with PyJWT for JWT handling #3756
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
Conversation
Opening as a draft because I want to do proper testing. |
29f2772
to
97b409e
Compare
From the python-jose docs, it looks like you could switch to |
I guess I'm wrong, |
I did some testing, and even through |
4df0466
to
1f50a02
Compare
This commit migrates the authentication system from python-jose to PyJWT to eliminate the dependency on the archived rsa package. The migration includes: - Refactored OAuth2TokenAuthProvider to use PyJWT's PyJWKClient for clean JWKS handling - Removed manual JWKS fetching, caching and key extraction logic in favor of PyJWT's built-in functionality The new implementation is cleaner, more maintainable, and follows PyJWT best practices while maintaining full backward compatibility. Signed-off-by: Sébastien Han <[email protected]>
Pass TLS certs to the PyJWKClient Signed-off-by: Sébastien Han <[email protected]>
If verify_tls is False we disable the cert verification in the ssl context. Signed-off-by: Sébastien Han <[email protected]>
Kubernetes JWT endpoint is authenticated so we must pass the token from the config in the PyJWKClient's client header to fetch the public keys. Signed-off-by: Sébastien Han <[email protected]>
1f50a02
to
657052b
Compare
Signed-off-by: Sébastien Han <[email protected]>
657052b
to
c314275
Compare
What does this PR do?
This commit migrates the authentication system from python-jose to PyJWT to eliminate the dependency on the archived rsa package. The migration includes:
The new implementation is cleaner, more maintainable, and follows PyJWT best practices while maintaining full backward compatibility.
Test Plan
Unit tests. Auth CI.