Repository navigation
feat(oauth): opt-in switch and default-off gate for browser login (Spec 132 PR-1a) - #1997
Merged
Merged
Conversation
Deploying mcpproxy-docs with
|
| Latest commit: |
6d74c98
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0c2c4c35.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-client-oauth-login-swit.mcpproxy-docs.pages.dev |
…132 PR-1a) Related #1971
Dumbris
marked this pull request as draft
November 22, 2026 17:52
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 45048285277 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Dumbris
marked this pull request as ready for review
November 23, 2026 10:58
Dumbris
added a commit
that referenced
this pull request
Nov 23, 2026
…132 PR-1c) (#2012) ## Summary Third slice of Spec 132 (opt-in browser login for MCP clients; spec merged in #1996, switch in #1997, protocol in #2010). Storage only; nothing serves it yet, so no behaviour changes while `mcp_oauth_enabled` is off (the default). - bbolt buckets for registrations, grants and the ever-used marker, created only when first written. - One binding writer shared by API-key clients and browser logins; pins restored by binding incarnation. - Removal of a client purges its logins in the same transaction. - No new dependencies. ## Review Cross-reviewed with opencode `github-copilot/gpt-6.1-sol` until clean. ## Testing `go test -race ./internal/storage/...` Related #1971
Dumbris
added a commit
that referenced
this pull request
Nov 23, 2026
## Summary Fourth slice of Spec 132 (opt-in browser login for MCP clients; spec #1996, switch #1997, protocol #2010, storage #2012). Runtime service only; no HTTP endpoint serves it yet, so nothing changes while `mcp_oauth_enabled` is off (the default). - `OAuthLoginService`: describe, preview, approve, deny, exchange, refresh, revoke, list. - Exchange and refresh run under the config commit lock with one config snapshot; the binding guard (`binding_bypassable_without_auth`) covers browser logins. - Atomic HMAC key creation; refresh-token replay revokes the grant. - Activity rows for approve, deny, issue, revoke and replay. - No new dependencies. ## Review Cross-reviewed with opencode `github-copilot/gpt-6.1-sol`, five rounds, clean. ## Testing `go test -race ./internal/runtime/... -run 'OAuth|Oauth'` Related #1971
Dumbris
added a commit
that referenced
this pull request
Nov 23, 2026
## Summary Fifth slice of Spec 132 (opt-in browser login for MCP clients; earlier slices #1997, #2010, #2012, #2013). This one serves the feature over HTTP. It is still off by default (`mcp_oauth_enabled`), and while off and never used every existing answer is unchanged. - OAuth endpoints: protected-resource and authorization-server metadata, `POST /oauth/register`, `GET /oauth/authorize`, `POST /oauth/token`, and the MCP endpoints `/mcp/oauth` and `/mcp/oauth/<client-id>`. - Every request on an OAuth address is authenticated; open streams end when the login is revoked or the feature is switched off. - Loopback only, personal edition only; cross-site and forwarded requests are refused. - Admin REST for sign-in requests (`/api/v1/oauth/authorizations/…`) and logins on clients. No consent page yet (next slice): `GET /oauth/authorize` redirects to `/ui/authorize?request=<id>`. - Activity rows carry credential kind `oauth`. - No new dependencies. ## Review Cross-reviewed with opencode `github-copilot/gpt-6.1-sol` (five rounds, clean) and an Opus security review. ## Testing `go test -race ./internal/server/... ./internal/httpapi/... -run 'OAuth|Oauth'` (and with `-tags server`). Related #1971
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.
First slice of Spec 132 (opt-in browser login for MCP clients, spec in #1996): the switch and the gate. The endpoints are not functional yet.
Related #1971
What changes
mcp_oauth_enabled(defaultfalse, omitted from saved configs), envMCPPROXY_MCP_OAUTH_ENABLED(process-only, not persisted), hot-reloadable.internal/server/oauth_login_routes.go):/mcp/oauth,/mcp/oauth/,/oauth/register,/oauth/authorize,/oauth/token,/.well-known/oauth-authorization-server,/.well-known/oauth-protected-resource/mcp/oauthand its subtree.No
/oauth/or/.well-known/subtree is registered, so the mux adds no trailing-slash redirect that did not exist before.With the switch off nothing changes
TestOAuthLogin_DefaultOff_RoutesUnchangedcompares a mux with the new patterns against one without them for 14 paths × GET/POST × three credential states ×require_mcp_authon/off (status, body,Location,WWW-Authenticate). It builds both muxes with a test helper around the real host-validation and MCP-auth middleware, not throughstartCustomHTTPServer.TestOAuthLogin_DefaultOff_NoStorage: no bucket or meta key is created../scripts/test-api-e2e.shagainst the built binary: 77/77.Verification
go test -raceforinternal/config,internal/runtime,internal/server(personal and-tags server, CI skip regex): pass.golangci-lintwith.github/.golangci.yml, bare and--build-tags server: 0 issues.gpt-6.1-sol): round 1 one finding (server-edition check used the config, not the build; fixed in the second commit), round 2 clean.