Publish OAuth Protected Resource Metadata (RFC 9728)#42
Draft
Conversation
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>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Deploying agent-render with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change makes agent discovery pass for OAuth Protected Resource Metadata.
What changed
next build,scripts/emit-oauth-protected-resource.mjswrites RFC 9728 JSON toout/.well-known/oauth-protected-resourceand, whenNEXT_PUBLIC_BASE_PATHis set, duplicates it underout/<basePath>/.well-known/...so the resource identifier matches the deployed URL shape.https://agent-render.comand can be overridden withNEXT_PUBLIC_SITE_URLat build time.public/_headerssetsContent-Type: application/json; charset=utf-8on Cloudflare Pages for both root and/agent-render/well-known paths (extensionless file).scripts/serve-export.mjsand the self-hosted static handler serve the same path withapplication/jsoninstead ofapplication/octet-stream.GET /.well-known/oauth-protected-resourcereturns metadata;OAUTH_RESOURCE_IDENTIFIER,OAUTH_AUTHORIZATION_SERVERSandOAUTH_SCOPES_SUPPORTED(JSON arrays) configure production deployments.goToHashwaits untillocation.hashmatches to avoid navigation/hash races; visual snapshots updated after README status line change.Verification
npm run checknpm run test:ci