-
Notifications
You must be signed in to change notification settings - Fork 476
fix(functions): add apikey compatibility header #5509
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
base: develop
Are you sure you want to change the base?
Changes from all commits
8d4b4ab
6ccf6ec
1c97bbd
1967c79
0b7ae83
7271809
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,10 +182,10 @@ services: | |
| config: | ||
| add: | ||
| headers: | ||
| - "Authorization: {{ .BearerToken }}" | ||
| - "sb-api-key: {{ .BearerToken }}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remark(not-blocking): this mints on every /functions request regardless of verify_jwt. Harmless now that it goes to sb-api-key and is stripped before the worker (and only read when verify_jwt is on), but it's wider than necessary could scope it later. (Underlying expression is in https://github.com/supabase/cli/blob/develop/apps/cli-go/internal/start/start.go#L451-L463 ) |
||
| replace: | ||
| headers: | ||
| - "Authorization: {{ .BearerToken }}" | ||
| - "sb-api-key: {{ .BearerToken }}" | ||
| # Management API endpoints | ||
| - name: well-known-oauth | ||
| _comment: "GoTrue: /.well-known/oauth-authorization-server -> http://auth:9999/.well-known/oauth-authorization-server" | ||
|
|
||
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.
nitpick
sbApiKeyCompatibilityTokenisstring | null(headers.get returns null when absent), so .replace(...) throws if sb-api-key is missing. Masked today only because Kong always sets the header on this route but a request reaching the runtime without it (direct-to-runtime, tests) would 500. A??guard would match the ingress behavior.