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

オープン
#1,139 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
40/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go

調査の方向性

mcp/streamable.go と OAuthHandler および AuthorizationCodeHandler のエントリポイントから始めて、ヘッダーの設定、トークン交換、リフレッシュ、リクエストの準備を追跡します。RFC-vector のテスト箇所と everything-client auth/dpop のパスを確認し、その後、conformance シナリオが SDK パスを使用している一方で、auth/dpop-nonce が baseline.yml に残っていることを検証します。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Go
スター
5.4k
フォーク
623
平均マージ
22時間 10分
マージ済み PR(30日)
30

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/go-sdk のほかの issue

modelcontextprotocol/go-sdk の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。