feat(mcp): Phase 13 scoped auth preflight - #383
Merged
Conversation
Refs #292 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇
MCP delegated GitHub auth context에 선택적 scope metadata를 추가하고, 명시된 scope가 부족하면 handler dispatch 전에
INSUFFICIENT_SCOPEMCP error envelope를 반환합니다.왜
Refs #292. v1.0 MCP tool spec의 scope negotiation 계약을 실제 dispatcher preflight와 맞춥니다.
pull_request:write가 parsec PR 작업의pull_request:read를 만족한다는 규칙도 코드로 고정했습니다. @erishforG변경
McpContext에github_scopesmetadata와with_github_authhelper 추가INSUFFICIENT_SCOPEstructured error 반환다음 Phase 힌트
MCP host initialize/session metadata에서 delegated token scopes를
McpContext::with_github_auth로 연결하는 transport boundary를 추가할 수 있습니다.리스크
Low.
src/mcp/와docs/mcp/만 변경하며, scope metadata가 없는 기존 delegated token은 legacy-compatible하게 허용합니다.롤백
이 PR revert 시 scoped metadata enforcement만 제거되고 기존 token-required preflight는 유지됩니다.
Test plan
cargo test --quiet mcp::testscargo build --quietcargo fmt --checkcargo clippy --all-targets -- -D warningscargo test --quiet