Skip to content

fix(carbonserver) validate fief token #825

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prmths128
Copy link
Contributor

Add missing token validation for cli use case

@prmths128 prmths128 requested review from SaboniAmine and inimaz April 23, 2025 21:32
@@ -85,6 +85,9 @@ def __call__(
algorithms=["HS256", "RS256"],
)
elif bearer_token is not None:
if settings.environment != "develop":
await fief.validate_access_token(bearer_token.credentials)
Copy link
Contributor

Choose a reason for hiding this comment

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

This throws an exception if not valid, see in its docs --> https://github.com/fief-dev/fief-python/blob/main/fief_client/client.py#L655-L662

Maybe we can catch it and throw a 401?

Copy link
Collaborator

@SaboniAmine SaboniAmine left a comment

Choose a reason for hiding this comment

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

See Inigo's review

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.

3 participants