Skip to content

feat(oauth): storage for browser logins and one binding writer (Spec 132 PR-1c) - #2012

Merged
Dumbris merged 12 commits into
mainfrom
feat/client-oauth-login-storage
Nov 23, 2026
Merged

Dumbris merged 12 commits into
mainfrom
feat/client-oauth-login-storage

Conversation

@Dumbris

@Dumbris Dumbris commented Nov 23, 2026

Copy link
Copy Markdown
Member

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5bba11c
Status: ✅  Deploy successful!
Preview URL: https://39e8faf7.mcpproxy-docs.pages.dev
Branch Preview URL: https://feat-client-oauth-login-stor.mcpproxy-docs.pages.dev

View logs

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/client-oauth-login-storage

Available Artifacts

  • archive-darwin-amd64 (33 MB)
  • archive-darwin-arm64 (30 MB)
  • archive-linux-amd64 (20 MB)
  • archive-linux-arm64 (18 MB)
  • archive-windows-amd64 (33 MB)
  • archive-windows-arm64 (29 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (29 MB)
  • installer-dmg-darwin-arm64 (26 MB)
  • smart-mcp-proxymcpproxy-goU4RBN9.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 45176098307 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

codecov-commenter commented Nov 23, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 72.91196% with 240 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/storage/oauth_login.go 74.15% 69 Missing and 68 partials ⚠️
internal/storage/client_binding.go 71.56% 31 Missing and 27 partials ⚠️
internal/storage/agent_token_repin.go 72.26% 20 Missing and 18 partials ⚠️
internal/storage/client_credentials.go 53.33% 3 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@Dumbris
Dumbris merged commit a26a6d9 into main Nov 23, 2026
50 of 51 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants