feat(auth): per-server authorization and token URL overrides
Adds two optional per-server fields — `oauth.authorizationUrl` and `oauth.tokenUrl` — that override the endpoints authorization-server metadata discovery resolved, so a server can be pointed at a development or staging authorization server without changing what it advertises. SDK v2 routes both endpoints through the discovered metadata document and neither through OAuthClientProvider, so the override is applied by wrapping the client's base fetch and patching the metadata document in flight (core/auth/endpointOverrides.ts). Wrapping the base fetch — rather than only the auth fetch — also covers the discovery the SDK runs from inside the transport on the 401/refresh path. The fields round-trip through mcp.json, the /api/servers routes, the runner (CLI/TUI), and the Server Settings → Authorization panel, where a value that is not an absolute http(s) URL is flagged inline; at runtime such a value is dropped with a single warning rather than failing the connection. Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
6bc355df63
commit
364d8c9dbc
1 changed files with 1212 additions and 6 deletions
|
|
@ -45,7 +45,13 @@ v2/main/
|
|||
│ │ # providers.redirectToAuthorization, the only
|
||||
│ │ # seam that sees the SDK-built authorize URL;
|
||||
│ │ # authorization request only, never the token
|
||||
│ │ # request — #2018)
|
||||
│ │ # request — #2018;
|
||||
│ │ # endpointOverrides.ts per-server
|
||||
│ │ # authorization/token URL overrides — a fetch
|
||||
│ │ # wrapper that rewrites the discovered AS
|
||||
│ │ # metadata document, the one seam SDK v2 routes
|
||||
│ │ # BOTH endpoints through (neither reaches the
|
||||
│ │ # OAuthClientProvider) — #1906)
|
||||
│ │ ├── browser/ # Browser-side OAuth (sessionStorage, BrowserNavigation)
|
||||
│ │ ├── node/ # Node-side OAuth (NodeOAuthStorage, OAuthCallbackServer,
|
||||
│ │ │ # runner-interactive-oauth loopback callback flow)
|
||||
|
|
|
|||
Loading…
Reference in a new issue