fix(console): authenticate inference proxy

This commit is contained in:
Frank
2026-09-21 04:40:11 -04:00
parent cf494c2029
commit 70a24697ea
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -283,6 +283,7 @@ new sst.cloudflare.x.SolidStart("Console", {
ZEN_LITE_PRICE,
new sst.Secret("ZEN_LIMITS"),
new sst.Secret("ZEN_SESSION_SECRET"),
new sst.Secret("CLOUDFLARE_ACCESS_CLIENT_ID"),
...ZEN_MODELS,
...($dev
? [
@@ -81,6 +81,7 @@ export async function proxyInference(
])
forwarded.headers.delete(name)
forwarded.headers.set("authorization", `Bearer ${key}`)
forwarded.headers.set("CF-Access-Client-Id", Resource.CLOUDFLARE_ACCESS_CLIENT_ID.value)
const ip = request.headers.get("cf-connecting-ip")
if (ip) forwarded.headers.set("x-zen-ip", ip)
const requestID = request.headers.get("x-opencode-request-id") ?? request.headers.get("x-opencode-request")