modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Implement OAuth scope handling (WWW-Authenticate, scopes_supported, step-up, retry-limit, omitted)
オープン
まだ誰も着手していません。
auth
Client
enhancement
improves spec compliance
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
説明
Context
Five baseline scenarios cover scope acquisition strategies the client must follow when constructing authorize/token requests:
auth/scope-from-www-authenticate— parsescope="<list>"fromWWW-Authenticateinsufficient_scope challenges and request those scopes on next authorize.auth/scope-from-scopes-supported— when no challenge hint, fall back toscopes_supportedfrom AS metadata.auth/scope-omitted-when-undefined— when neither source provides scopes, omit thescopeparameter entirely (do not send empty string).auth/scope-step-up— on403/401witherror=insufficient_scope, restart auth flow requesting the augmented scope set.auth/scope-retry-limit— bound step-up retries to one to prevent infinite loops.
Scope
Mcp\Client\Auth\ScopeResolverconsulted byAuthCoordinatorbefore every authorize/token request.WwwAuthenticateParserreturningscope,error,error_description,resource_metadata.- Step-up retry counter held in
AuthCoordinatorstate.
Conformance scenarios unblocked
All 5 scope scenarios above.
Dependencies
Blocked by: #316 (401 plumbing), #318 (AS metadata), #319 (Auth Code flow).
Acceptance
- Unit tests per resolution path.
- Conformance: 5 baseline scenarios pass.
cc @soyuka
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず Mcp\Client\Auth\ScopeResolver と AuthCoordinator から始め、次に WwwAuthenticateParser と名前付きの5つのコンフォーマンスシナリオを調べます。省略された scope を含め、scope 解決の各経路を検証し、insufficient_scope に対する step-up の再試行が1回に制限されていることを確認します。ユニットテストと5つすべてのベースラインシナリオがパスする必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- api, authentication
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100