Skip to content

feat: Add JWT authentication to agent API and frontend#3

Draft
google-labs-jules[bot] wants to merge 1 commit intodevfrom
feature/jwt-authentication
Draft

feat: Add JWT authentication to agent API and frontend#3
google-labs-jules[bot] wants to merge 1 commit intodevfrom
feature/jwt-authentication

Conversation

@google-labs-jules
Copy link

This change adds JWT authentication to the agent application and updates the frontend to authenticate its requests. The agent API now has a /token endpoint and protected session endpoints. The frontend application fetches a token and uses it for all communication with the agent, with an efficient caching mechanism.

This commit introduces JWT-based authentication to the agent application and updates the frontend application to use it.

Key changes:
- A new `/token` endpoint is added to the agent application to issue JWTs based on username/password credentials.
- The `/sessions` and `/sessions/{session_id}/message` endpoints are now protected and require a valid JWT.
- The `frontend/main.py` application is updated to fetch a JWT from the agent and include it in all subsequent API calls.
- Token handling in the frontend is optimized with in-memory caching and a robust retry mechanism for handling token expiration.
- `docker-compose.yml` is updated to provide the necessary API credentials to the frontend service via environment variables.
@rafegal rafegal changed the base branch from main to dev August 11, 2025 16:07
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.

0 participants