File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 489489 "KONG_DATABASE=off" ,
490490 "KONG_DECLARATIVE_CONFIG=/home/kong/kong.yml" ,
491491 "KONG_DNS_ORDER=LAST,A,CNAME" , // https://github.com/supabase/cli/issues/14
492- "KONG_PLUGINS=request-transformer,cors" ,
492+ "KONG_PLUGINS=request-transformer,cors,pre-function " ,
493493 fmt .Sprintf ("KONG_PORT_MAPS=%d:8000" , utils .Config .Api .Port ),
494494 // Need to increase the nginx buffers in kong to avoid it rejecting the rather
495495 // sizeable response headers azure can generate
Original file line number Diff line number Diff line change @@ -228,6 +228,28 @@ services:
228228 - /pooler/v2/
229229 plugins :
230230 - name : cors
231+ - name : request-transformer
232+ config :
233+ replace :
234+ headers :
235+ - " Authorization: {{ .BearerToken }}"
236+ - name : oauth-protected-resource
237+ _comment : " OAuth Protected Resource: /.well-known/oauth-protected-resource/functions/v1/<whatever> -> /functions/v1/<whatever>/.well-known/oauth-protected-resource"
238+ url : http://{{ .EdgeRuntimeId }}:8081/
239+ routes :
240+ - name : oauth-protected-resource
241+ strip_path : false
242+ paths :
243+ - /.well-known/oauth-protected-resource/functions/v1/
244+ plugins :
245+ - name : cors
246+ - name : pre-function
247+ config :
248+ access :
249+ - |
250+ local uri = kong.request.get_path()
251+ local new_uri = uri:gsub("^/.well%-known/oauth%-protected%-resource/functions/v1", "") .. "/.well-known/oauth-protected-resource"
252+ kong.service.request.set_path(new_uri)
231253 - name : mcp
232254 _comment : " MCP: /mcp -> http://studio:3000/api/mcp"
233255 url : http://{{ .StudioId }}:3000/api/mcp
You can’t perform that action at this time.
0 commit comments