{
 "schema_version": 1,
 "generated": "2026-10-23",
 "id": "cassiopeiacode-cosyredactgateway--deploy-gateway-to-cloudflare-workers",
 "repo": "CassiopeiaCode/CosyRedactGateway",
 "repo_url": "https://github.com/CassiopeiaCode/CosyRedactGateway",
 "repo_slug": "cassiopeiacode-cosyredactgateway",
 "title": "Deploy the gateway to Cloudflare Workers with host limits",
 "page_title": "How to deploy the gateway to Cloudflare Workers with host limits with Cosy Redact Gateway",
 "summary": "Publish worker.js as a Cloudflare Worker and restrict which upstream hosts it will call.",
 "who": "A team lead or DevOps engineer who needs a shared, hosted redaction layer for several developers and has a Cloudflare account.",
 "problem": "Each developer running a local gateway is hard to manage, and an unconfigured hosted gateway could forward requests to any destination.",
 "outcome": "A Cloudflare Worker running the gateway, with an upstream allowlist set as a Worker variable and tests passing before deployment.",
 "steps": [
  "Run the test suite from the repo folder with `npm test`",
  "Deploy the Worker with `npx wrangler deploy`",
  "Set the Worker variable `REDACT_ALLOWED_HOSTS=api.openai.com,api.anthropic.com` in the Cloudflare dashboard",
  "Add access control in front of the Worker before sharing its URL, as the README advises for public exposure (inferred, check the README)"
 ],
 "agent_prompt": "In the CosyRedactGateway repo, run `npm test` and then `npx wrangler deploy` for the account in <your-cloudflare-account>. Confirm the deployed Worker rejects a request to a host not in REDACT_ALLOWED_HOSTS and state that host allowlisting does not authenticate callers.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "60 minutes",
 "basis": "readme",
 "caveat": "The README says the allowlist limits target hosts but does not authenticate callers, so the Worker must have outside access control before any public traffic.",
 "category": "Security and science",
 "tags": [
  "Security and science"
 ],
 "lang": "javascript",
 "requirements": [
  "Node.js 20+, Git, and a terminal",
  "An OpenAI or Anthropic API key and an available model name, only if you make live upstream calls",
  "A trusted environment for running the gateway, since it handles raw requests and provider credentials"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The hosted Worker receives raw requests and provider credentials, so you must trust the hosting environment and add your own access control."
  }
 ],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/deploy-gateway-to-cloudflare-workers/",
 "md": "https://dedupedai.com/use-cases/cassiopeiacode-cosyredactgateway/deploy-gateway-to-cloudflare-workers/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/cassiopeiacode-cosyredactgateway--deploy-gateway-to-cloudflare-workers.json",
 "api_version": "v1"
}
