Conversation
lpiwowar
approved these changes
May 13, 2025
Contributor
lpiwowar
left a comment
There was a problem hiding this comment.
LGTM!:) 👍
I was able to successfully authenticate. The code rejects invalid tokens. I had to tweak the code a bit to check the authentication during testing because of the Jirka's work on the embedding model.
9906636 to
127d2a6
Compare
This commit introduces token-based authentication for the `/prompt` and `/rca-from-tempest` API endpoints. Clients now need to include a valid bearer token in the `Authorization` header to access these resources. Key changes include: - Added `get_current_user` dependency in `src/api.py` to validate tokens for protected routes. - Implemented the `verify_token` method in `src/auth.py` within the `DatabaseAuthentification` class to check token validity against the database and expiry. - Updated `docs/api-quickstart.md` to reflect the new authentication requirement, including `Authorization` header examples. BREAKING CHANGE: Endpoints `/prompt` and `/rca-from-tempest` now require authentication. Requests without a valid `Authorization: Bearer <token>` header will be rejected with a 401 Unauthorized error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces token-based authentication for the
/promptand/rca-from-tempestAPI endpoints. Clients now need to include avalid bearer token in the
Authorizationheader to access theseresources.
Key changes include:
get_current_userdependency insrc/api.pyto validatetokens for protected routes.
verify_tokenmethod insrc/auth.pywithin theDatabaseAuthentificationclass to check token validity against thedatabase and expiry.
docs/api-quickstart.mdto reflect the new authenticationrequirement, including
Authorizationheader examples.BREAKING CHANGE: Endpoints
/promptand/rca-from-tempestnowrequire authentication. Requests without a valid
Authorization: Bearer <token>header will be rejected with a 401 Unauthorized error.