-
Notifications
You must be signed in to change notification settings - Fork 65
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
Accept Supabase OAuth token #292
base: main
Are you sure you want to change the base?
Conversation
ef997e4
to
7ef079f
Compare
4dbb9b0
to
3c863b5
Compare
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.
LGTM, mostly nits, some questions tho:
- possible to write a test since this is now abstracted as an interface?
- if not, how to test this manually?
- what is the mitigation plan if secret key leaks? (and how to better store it?)
- how will we handle secret key rotation?
There could be some tests for sure now, especially if we merge the integration ones.
You can get the JWT secret from Supabase prod & get the Supabase token from the dashboard (or you can get the JWT secret from your Supabase instance and generate your own token, you just need to set "subject" to your user uuid). Then just start the API locally and try to call http endpoints with the headers.
If you mean the tokens themselves, that would follow the same as if user token leaks (those supabase tokens are directly generated for the user). If the JWT secret leaks, we would have to manually rotate it. For secret saving, I agree that using Hashicorp Vault might be better, but we don't have it set up rn afaik. |
Co-authored-by: 0div <[email protected]>
Allow using Supabase OAuth token instead of Team API Keys or user Access Tokens as authentication method.
Usage requires following headers for Team API endpoints:
And following for Access Token endpoints:
This change requires also infrastructure update and setting up
supabase_jwt_secret
in Google Secret Manager.Note: The naming securitySchemes with 1 and 2 is there for having the verification in correct order.