Add optional WORKER_API_KEY support to wrangler.toml

This commit is contained in:
老王
2026-06-20 03:43:47 +08:00
parent d4fb83eab1
commit 6ee911ecfc
+6
View File
@@ -5,6 +5,12 @@ compatibility_date = "2025-11-21"
# Store the upstream key as a secret instead of committing it here:
# wrangler secret put UNLIMITED_SURF_API_KEY
#
# Optional: protect this Worker with your own client-facing key:
# wrangler secret put WORKER_API_KEY
# When WORKER_API_KEY is set, clients must send it as Authorization: Bearer <key>,
# x-api-key: <key>, or anthropic-api-key: <key>. If it is not set, the Worker
# keeps the old behavior and accepts any client key.
#
# Clients can also send their own key as Authorization: Bearer <key>
# or x-api-key: <key>; the Worker forwards it upstream when no secret is set.