Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The select-org query string is browser-controlled, so a mismatched redirect_uri could pair a real client ID with an unrelated origin. For dynamically registered clients, drop the redirect origin unless it matches one of the client's registered redirect URIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jayko001
marked this pull request as ready for review
September 22, 2026 21:39
This branch was successfully deployed
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.
summary
The existing
$mcp_initializeevent already records$mcp_client_nameand$mcp_client_versionwith the organization group. Together, these fields distinguish discovery, connection trigger, OAuth application, and the first MCP runtime without treating any one signal as authoritative.The analytics half is kernel/kernel#4269. Merge and deploy both changes before evaluating coverage.
data captured
firstDiscoverySourceconnectorTriggersignupPathoauthClientIdoauthClientName(self-reported during dynamic registration)oauthClientUri(self-reported origin)oauthRedirectOrigin(observed authorization request)oauthClientTypetests
bunx tsc --noEmitbun test(611 passing)bun run buildwith local placeholder configurationNote
Medium Risk
Touches OAuth registration and Clerk user metadata with redirect-uri validation; Redis metadata loss is non-blocking for registration but affects attribution enrichment.
Overview
Adds OAuth signup attribution for users on
/select-orgwho have no organization: they must answer a short discovery/trigger survey before Create organization appears. Answers and OAuth context are written to ClerkpublicMetadataviasaveOAuthAttribution; returning users with valid metadata skip the survey.Dynamic registration now stores client name, optional
client_uri, and redirect URIs in Redis (180-day TTL) after Clerk creates the app. Attribution enriches metadata withoauthClientId, registered client name/URI, client type, and an observed redirect origin only when the authorize queryredirect_urimatches stored redirects (localhost expansion included); mismatches dropoauthRedirectOriginso arbitrary callback URLs are not trusted.Registration failures to save metadata are logged and do not fail the registration response; survey save failures keep org creation blocked until success.
Reviewed by Cursor Bugbot for commit cecbc94. Bugbot is set up for automated code reviews on this repo. Configure here.