fix: apply MCP OAuth lifetime for gateway slugs#3711
Conversation
|
Claude finished @joeyorlando's task in 3m 53s —— View job PR Review: fix: apply MCP OAuth lifetime for gateway slugs
SummaryThis PR fixes a real bug: when a client (e.g. Cursor) exchanges an authorization code for an MCP access token and passes a The fix looks solid. A few observations and one small suggestion below. What the change does
The function becomes The regression test at Observations / suggestions1.
const match = resourceUrl.pathname.match(/^\/v1\/mcp\/([^/]+)$/);
const idOrSlug = match?.[1] ? decodeURIComponent(match[1]) : null;
return idOrSlug ? AgentModel.resolveIdFromIdOrSlug(idOrSlug) : null;The two other places that resolve
In practice slugs generated by 2. After this change, Worth confirming: do enterprise-managed ID-JAG assertions ever set 3.
const issuerOrigin = new URL(buildOAuthIssuer()).origin;
4. Test coverage — good The new test correctly:
One small thing: the test passes Correctness checks
VerdictLGTM. The fix is targeted, consistent with existing slug-resolution patterns in the codebase, and covered by a good regression test. The only thing I'd consider before merging is a quick answer on observation #2 (whether the JWT-bearer flow should also accept slug-form resource URLs). If that flow is guaranteed to always receive canonical UUID URLs from its assertion issuers, ship it. |
🤖 I have created a release *beep* *boop* --- ## [1.2.10](platform-v1.2.9...platform-v1.2.10) (2026-04-11) ### Features * make posthog analytics configurable ([#3707](#3707)) ([7ae9101](7ae9101)) ### Bug Fixes * `/llm/costs` table scrolling ([#3722](#3722)) ([6a42ba8](6a42ba8)) * apply MCP OAuth lifetime for gateway slugs ([#3711](#3711)) ([362aaec](362aaec)) * Bedrock tool name encoding ([#3706](#3706)) ([0e2c2d1](0e2c2d1)) * costs timeframes and surface limit reset settings ([#3709](#3709)) ([6e4154b](6e4154b)) * jira oauth discovery overrides ([#3721](#3721)) ([2c4cf8f](2c4cf8f)) * OIDC discovery trusted origins for IdP registration ([#3714](#3714)) ([adb5f5e](adb5f5e)) * preserve shared chat agents on fork ([#3715](#3715)) ([252edfc](252edfc)) * reranker model dropdown labels ([#3704](#3704)) ([ebd1c8a](ebd1c8a)) * session logs loading state ([#3712](#3712)) ([ffba126](ffba126)) ### Miscellaneous Chores * **ci:** add ID-JAG MCP e2e test ([#3702](#3702)) ([1a5078a](1a5078a)) * **deps:** bump next from 16.1.7 to 16.2.3 in /platform/frontend ([#3708](#3708)) ([d47967c](d47967c)) * use neutral token prefixes with legacy support ([#3719](#3719)) ([db5929c](db5929c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: archestra-ci[bot] <222894074+archestra-ci[bot]@users.noreply.github.com> Co-authored-by: Joey Orlando <joey@archestra.ai>
Summary
/v1/mcp/default-mcp-gatewayresource URLs soexpires_inand persistedoauth_access_token.expires_atuse the configured lifetime