proposal: client DPoP support (SEP-1932 baseline, no nonce)

Aperta
#1,139 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
40/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go

Direzione di ricerca

Inizia da mcp/streamable.go e dai punti di ingresso OAuthHandler e AuthorizationCodeHandler per tracciare la configurazione degli header, lo scambio dei token, il refresh e la preparazione delle request. Esamina le posizioni dei test RFC-vector e il percorso everything-client auth/dpop, quindi verifica che lo scenario di conformance utilizzi il percorso dell'SDK, mentre auth/dpop-nonce rimanga in baseline.yml.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

P3

Background

SEP-1932 / RFC 9449 DPoP conformance scenarios landed in the conformance suite. #1138 teaches the harness everything-client to pass auth/dpop via a hand-rolled path. That is not SDK support — apps using AuthorizationCodeHandler + StreamableClientTransport still cannot obtain or present DPoP-bound tokens.

Today setMCPHeaders hardcodes Authorization: Bearer (mcp/streamable.go), and OAuthHandler only exposes TokenSource + Authorize — enough for Bearer, not for a fresh per-request DPoP proof (htm/htu/ath/jti).

Proposal (baseline only; no nonce)

Ship one SDK PR that:

  1. Helpers (e.g. under oauthex) — ES256 keypair, proof builder, ath, HTU normalize, RFC-vector tests. No nonce in the public API yet.
  2. Transport — use token.Type() (default Bearer); attach per-request proofs without breaking existing OAuthHandler implementors.
  3. AuthorizationCodeHandler — explicit opt-in DPoP config; proof on token exchange + refresh; implement the per-request hook.
  4. Conformance — rewrite everything-client auth/dpop to use the SDK path (acceptance test). Keep auth/dpop-nonce in baseline.yml.
Hook shape (prefer non-breaking)

Do not add a method to the OAuthHandler interface (breaking for external implementors). Prefer one of:

  • A (preferred): optional interface type-asserted in setMCPHeaders, e.g. handlers that also implement PrepareRequest(ctx, *http.Request) error get called after Authorization is set.
  • B: StreamableClientTransport.PrepareRequest func field set by the app / handler wiring.

AuthorizationCodeHandler with DPoP enabled would implement A (or set B).

Explicit opt-in only — no auto-enable from dpop_bound_access_tokens_required in v1.

Out of scope (follow later, same pattern)

  • auth/dpop-nonce (AS/RS use_dpop_nonce retry)
  • Server RequireDPoP middleware
  • Legacy SSE client OAuth/DPoP

Related

  • Harness: #1138
  • Spec: SEP-1932 / RFC 9449
  • Conformance scenarios: auth/dpop, auth/dpop-nonce
Lingua principale
Go
Stelle
5.4k
Fork
623
Merge medio
22h 10m
PR unite (30g)
30

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/go-sdk

Tutte le issue di modelcontextprotocol/go-sdk

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.