-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
feat: user can create api keys #329
feat: user can create api keys #329
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…ey-with-the-fe-for-quivr' of https://github.com/StanGirard/quivr into 315-api-key-gen-aauser-i-can-create-and-delete-an-api-key-with-the-fe-for-quivr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR !
I'm in the subway and will test once I'm back
<ConfigForm /> | ||
<ApiKeyConfig /> | ||
</section> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ApiKeyConfig />
should maybe go to <ConfirmForm />
, just before <UserAccountSection />
, since <ModelConfig/>
and <BackendConfig />
are already there
|
||
class JWTBearer(HTTPBearer): | ||
class AuthBearer(HTTPBearer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! i like this validator logic
backend/auth/auth_bearer.py
Outdated
return await get_user_from_api_key(token, commons) | ||
else: | ||
raise HTTPException(status_code=402, detail="Invalid token or expired token.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returned message should maybe be more personalised since "Invalid token or expired token" is not really relevant for api key
Additionally, it would be better to return 401 instead of 402 here. (WDYT @StanGirard ? 402 is the fabulous "Payment Required")
* feat: user can create api keys * fix: linting on build * Update backend/routes/api_key_routes.py * chore: rename and refactor AuthBearer * chore: add types
* feat: user can create api keys * fix: linting on build * Update backend/routes/api_key_routes.py * chore: rename and refactor AuthBearer * chore: add types
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Create and use API keys
#315
Checklist before requesting a review
Please delete options that are not relevant.
Screenshots (if appropriate):