fix: replace python-jose with PyJWT for JWT handling

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 <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-10-09 17:53:42 +02:00
parent ecc8a554d2
commit 7fa2bae3e2
No known key found for this signature in database
4 changed files with 60 additions and 86 deletions

View file

@ -34,7 +34,7 @@ dependencies = [
"openai>=1.107", # for expires_after support
"prompt-toolkit",
"python-dotenv",
"python-jose[cryptography]",
"PyJWT>=2.8.0",
"pydantic>=2.11.9",
"rich",
"starlette",