agentleFS
CloudflareKnown publishercloudflare/workers-oauth-provider/skills/migrate-to-1.0/SKILL.md

workers-oauth-provider-migrate-1.0

Skill1.9k starsChanged 2 months agoMITView on GitHub

Upgrade a Cloudflare Worker's @cloudflare/workers-oauth-provider from 0.x, 1.0 or 1.1 to the latest 1.x. Use when bumping that dependency, or when OAuthProvider / OAuthAuthorizationServer / OAuthResourceServer construction throws after an upgrade.

Trending

More talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 4 mentionsJul 2026: 2 mentionsAug 2026: 7 mentionsSep 2026: 9 mentionsOct 2026: 20 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the cloudflare/workers-oauth-provider repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about cloudflare/workers-oauth-provider

The biggest 5 of 53 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 53

Talked about on GitHub, Bluesky and Hacker News (53 times).

On GitHub · 44

39 more on GitHub

On Bluesky · 8

3 more on Bluesky

On Hacker News · 1

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No KV migration exists or is needed.

    line 10
  2. Distinctive:

    Search the project for each pattern below and apply the fix.

    line 15
  3. Very specific:

    Keep OAuthProvider if the project uses it.

    line 17

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Upgrade @cloudflare/workers-oauth-provider to the latest 1.x

Reference (read the section for every hit): node_modules/@cloudflare/workers-oauth-provider/docs/migration-1.0.md. Types and JSDoc: node_modules/@cloudflare/workers-oauth-provider/dist/oauth-provider.d.ts. No KV migration exists or is needed; never edit stored data.

Procedure

  1. Note the installed version (package.json). Skip guide sections tagged older than it.
  2. Search the project for each pattern below and apply the fix.
  3. Bump to the latest ^1, install, typecheck, run tests. Construction errors quote the rule; grep the guide for the message.
  4. Keep OAuthProvider if the project uses it. Don't move to OAuthAuthorizationServer/OAuthResourceServer unless asked.
Pattern in the projectFixGuide section
new OAuthProvider( without resourceMetadataadd resourceMetadata: { resource } (ask the user for the value)The canonical resource is required
resourceMatchOriginOnlydeleteRemoved: resourceMatchOriginOnly
resolveExternalTokenreturn audience: <resource>resolveExternalToken names its audience
scopes_supported inside resourceMetadatamove to top-level requiredScopesrequiredScopes replaces resourceMetadata.scopes_supported
allowImplicitFlow, allowPlainPKCEdelete; own clients must use code + S256Removed: the implicit grant and plain PKCE
redirectUris / redirect URIs with http:// non-loopback or a custom schemehttps or loopback; native apps: allowPrivateUseRedirectUris: trueRedirect URIs must be HTTPS or loopback HTTP
clientRegistrationTTL: 0; any *TTL below 600 → undefined; raise to ≥ 60Lifetimes are validated at construction
userId: built with : (e.g. `${a}:${b}`)encodeURIComponent(...), same value in listUserGrants/revokeGrantUser IDs cannot contain :
revokeExistingGrantsBatchSizedeleteRemoved: revokeExistingGrantsBatchSize
imports of resourceMatches, validateResourceUri, isValidOAuthScopeToken, base64UrlToBytes, parseJwtJsonPart, getJwtCryptoAlgorithmsinline the logic; no replacement exportInternal helpers are no longer exported
createClient( / updateClient(only authorization_code/refresh_token/enabled grants, code responses; don't update CIMD clientsClient helpers validate what they store
tokenExchangeCallbackOAuthError('invalid_grant') now revokes the grant; env is available; check returned TTLstokenExchangeCallback
purgeExpiredData(persist result.cursor, pass it back as cursorpurgeExpiredData() resumes from a cursor
new OAuthAuthorizationServer(drop authorizeEndpoint/tokenEndpoint if they equal ${issuer}/authorize, ${issuer}/oauth/tokenOAuthAuthorizationServer endpoints have defaults
ExchangeTokenOptions.aud, AuthRequest.resource as arrayssingle stringsType changes

Ask the user, don't guess

  • The canonical resource (the URL MCP clients connect to; becomes the token audience).
  • On a multi-resource OAuthAuthorizationServer: legacyGrantResource, the destination for pre-1.0 grants. Fixed once deployed.
  • Whether registered clients use remote http or custom-scheme redirect URIs (they stop authorizing), and whether any user IDs contain :. Neither shows up in a typecheck.
  • Whether DCR clients registered narrow grant_types (now enforced).
  • Adopting optional features (role classes, ctx.auth, insufficientScope, consent helpers, refreshTokenIdleTTL): offer, don't do unasked.

Verify

  • wrangler dev, then curl -i http://localhost:8787<api route>: 401 whose WWW-Authenticate has resource_metadata="…/.well-known/oauth-protected-resource<resource path>".
  • With a loopback dev resource, curl http://localhost:8787/.well-known/oauth-protected-resource<resource path>: 200 with the exact resource. Production serves it only on the resource's own origin.
  • curl http://localhost:8787/.well-known/oauth-authorization-server<issuer path>: authorization_endpoint and token_endpoint unchanged from before the upgrade. OAuthProvider serves it at the origin root; an OAuthAuthorizationServer issuer's path goes after the prefix (RFC 8414 §3.1), e.g. …/oauth-authorization-server/tenant for https://example.com/tenant.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.