Skip to content

Publish OAuth Protected Resource Metadata (RFC 9728)#42

Draft
baanish wants to merge 1 commit intomainfrom
cursor/oauth-protected-resource-metadata-0b79
Draft

Publish OAuth Protected Resource Metadata (RFC 9728)#42
baanish wants to merge 1 commit intomainfrom
cursor/oauth-protected-resource-metadata-0b79

Conversation

@baanish
Copy link
Copy Markdown
Owner

@baanish baanish commented Apr 18, 2026

This change makes agent discovery pass for OAuth Protected Resource Metadata.

What changed

  • After next build, scripts/emit-oauth-protected-resource.mjs writes RFC 9728 JSON to out/.well-known/oauth-protected-resource and, when NEXT_PUBLIC_BASE_PATH is set, duplicates it under out/<basePath>/.well-known/... so the resource identifier matches the deployed URL shape.
  • Canonical site URL defaults to https://agent-render.com and can be overridden with NEXT_PUBLIC_SITE_URL at build time.
  • public/_headers sets Content-Type: application/json; charset=utf-8 on Cloudflare Pages for both root and /agent-render/ well-known paths (extensionless file).
  • scripts/serve-export.mjs and the self-hosted static handler serve the same path with application/json instead of application/octet-stream.
  • Optional self-hosted server: GET /.well-known/oauth-protected-resource returns metadata; OAUTH_RESOURCE_IDENTIFIER, OAUTH_AUTHORIZATION_SERVERS and OAUTH_SCOPES_SUPPORTED (JSON arrays) configure production deployments.
  • Playwright: new e2e for the metadata endpoint; goToHash waits until location.hash matches to avoid navigation/hash races; visual snapshots updated after README status line change.

Verification

  • npm run check
  • npm run test:ci
Open in Web Open in Cursor 

Static export gains /.well-known/oauth-protected-resource via a post-build
emitter, Cloudflare Pages _headers for JSON content-type, and preview server
MIME mapping. Self-hosted mode adds a dynamic metadata route with optional
issuer/scope env vars. E2E covers discovery; goToHash waits for hash sync to
reduce flakes; visual snapshots updated for README status copy.

Co-authored-by: Aanish Bhirud <baanish@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 126926a7-a452-4020-8cc3-f109feaacdc9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/oauth-protected-resource-metadata-0b79

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying agent-render with  Cloudflare Pages  Cloudflare Pages

Latest commit: 54472f7
Status: ✅  Deploy successful!
Preview URL: https://cbba7de2.agent-render.pages.dev
Branch Preview URL: https://cursor-oauth-protected-resou.agent-render.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants