Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Auth with headers

Implements a request authorization pattern that allows or denies incoming requests by validating a pre-shared key within a specific HTTP header.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Auth with headers

Implements a request authorization pattern that allows or denies incoming requests by validating a pre-shared key within a specific HTTP header.

When To Use

Use when you need to implement a simple authentication layer for a Cloudflare Worker using a pre-shared key in an HTTP header.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-auth-with-headers-workflow-guide.mdA Cloudflare Workers example demonstrating how to allow or deny requests based on a pre-shared key in a request header.Questions about a Cloudflare Workers example demonstrating how to allow or deny requests based on a pre-shared key in a request header.
examples/workers-examples-auth-with-headers-cloudflare-workers-auth-with-headers.textA JavaScript example demonstrating how to authenticate Cloudflare Workers requests by validating a custom pre-shared key in the request headers.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to authenticate Cloudflare Workers requests by validating a custom pre-shared...
examples/workers-examples-auth-with-headers-cloudflare-workers-auth-with-headers-2.textA JavaScript example demonstrating how to validate a pre-shared key within a custom HTTP header in a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to validate a pre-shared key within a custom HTTP header in a Cloudflare Worker.
examples/workers-examples-auth-with-headers-cloudflare-workers-python-auth-with-h.textA Python implementation of a Cloudflare Worker using a WorkerEntrypoint to validate a custom pre-shared key in the request headers.Exact payloads, commands, or snippets shown in A Python implementation of a Cloudflare Worker using a WorkerEntrypoint to validate a custom pre-shared key in the re...
examples/workers-examples-auth-with-headers-cloudflare-workers-hono-auth-with-hea.textA Hono framework implementation for Cloudflare Workers that validates a pre-shared key via a custom request header.Exact payloads, commands, or snippets shown in A Hono framework implementation for Cloudflare Workers that validates a pre-shared key via a custom request header.

What This Skill Covers

  • Allow or deny a request based on a known pre-shared key in a header. This is not meant to replace the WebCrypto API.
  • Main sections: Tags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/auth-with-headers