feat(oauth): add allowInsecureIssuer flag for cluster-DNS fixtures - #94
Open
dwmkerr wants to merge 1 commit into
Open
feat(oauth): add allowInsecureIssuer flag for cluster-DNS fixtures#94dwmkerr wants to merge 1 commit into
dwmkerr wants to merge 1 commit into
Conversation
The MCP SDK's mcpAuthRouter rejects non-HTTPS, non-loopback issuer URLs at boot. When mock-llm runs as a Kubernetes fixture the issuer must be the cluster DNS name (e.g. http://mock-llm.<ns>.svc.cluster.local:6556), which is neither, so the process crashloops. Opt-in `metadata.allowInsecureIssuer: true` bypasses the SDK's router and mounts the SDK's exported handlers (authorize, token, register, metadata) directly with metadata mock-llm builds itself. Output is structurally equivalent to the SDK's — covered by a parity test. Default behaviour (strict HTTPS) is unchanged.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #94 +/- ##
==========================================
- Coverage 92.77% 92.67% -0.10%
==========================================
Files 20 20
Lines 609 628 +19
Branches 110 114 +4
==========================================
+ Hits 565 582 +17
Misses 30 30
- Partials 14 16 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
metadata.allowInsecureIssuer: truebypassesmcpAuthRouter(which rejects non-HTTPS, non-loopback issuers) and mounts the SDK's exported handlers directly with metadata mock-llm builds. Unlocks mock-llm as an OAuth fixture reachable via Kubernetes cluster DNS (e.g.http://mock-llm.<ns>.svc.cluster.local:6556)./.well-known/oauth-authorization-serverand/.well-known/oauth-protected-resourceare byte-equivalent to the SDK's output when both paths use a loopback issuer.Test plan
npx tsc --noEmitcleannpx jest— 148/148 passsrc/oauth/index.spec.ts: boots with cluster-DNS issuer, HTTPS issuer still works, default still rejects HTTP non-loopback, SDK-parity golden