- Add API_KEY config (env var) to all entry points - requireAuth helper checks Authorization: Bearer or x-api-key header - Auth applied to /v1/chat/completions, /v1/messages, /v1/models - When API_KEY is empty/unset, auth is disabled (backward compatible) - Update wrangler.toml with API_KEY variable documentation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
16 lines
667 B
TOML
16 lines
667 B
TOML
name = "edge-proxy-relay"
|
|
main = "src/worker.ts"
|
|
compatibility_date = "2025-12-01"
|
|
compatibility_flags = ["nodejs_compat"]
|
|
|
|
# ── Cloudflare account ────────────────────────────────────────────
|
|
account_id = "2bfa421c4f4a11cc11d684a3d14327db"
|
|
workers_dev = true
|
|
|
|
# ── Environment Variables ───────────────────────────────────────────────────
|
|
# [vars]
|
|
# RELAY_TIMEOUT_MS = "30000"
|
|
# RATE_LIMIT_MAX = "200"
|
|
# RATE_LIMIT_WINDOW_MS = "60000"
|
|
# API_KEY = "sk-your-secret-key"
|