Skip to content

feat: add Client ID Metadata Document (CIMD) support for OAuth - #8205

Draft
SahilJat wants to merge 1 commit into
Flagsmith:mainfrom
SahilJat:feat/oauth-cimd-support
Draft

feat: add Client ID Metadata Document (CIMD) support for OAuth#8205
SahilJat wants to merge 1 commit into
Flagsmith:mainfrom
SahilJat:feat/oauth-cimd-support

Conversation

@SahilJat

@SahilJat SahilJat commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8141

Please describe.

How did you test this code?

Please describe.

Implement CIMD resolution so that HTTPS URL client_ids are accepted at
the authorise and token endpoints. The authorisation server fetches the
client metadata document from the URL, validates it, and upserts a
single Application row keyed by the URL — eliminating the row littering
caused by anonymous DCR.

Key changes:
- Add oauth2_metadata/cimd.py with fetch, validate, and resolve logic
- Wrap TokenView as CIMDTokenView to resolve CIMD clients before DOT
- Hook _ensure_cimd_client into OAuthAuthorizeView (GET and POST)
- Advertise client_id_metadata_document_supported: true in RFC 8414
- Add flagsmith_oauth2_cimd_resolutions_total Prometheus counter
- Reject secret-based auth methods (no registration step for secrets)
- Reject private_key_jwt as not yet implemented
- Default missing token_endpoint_auth_method to 'none'
- SSRF hardening: public DNS check, allow_redirects=False
- Comprehensive unit and integration tests for all CIMD paths
- DCR remains available for clients that do not implement CIMD
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

@SahilJat is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1618394b-3e49-4073-b86e-d2db5548e639

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

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.

@github-actions github-actions Bot added the api Issue related to the REST API label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant