auth: fail closed startup when PAT/OAuth scopes are insufficient#2076
auth: fail closed startup when PAT/OAuth scopes are insufficient#2076davidahmann wants to merge 1 commit intogithub:mainfrom
Conversation
|
Implemented issue #2075 by adding startup fail-closed scope validation for PAT/OAuth tokens, deterministic missing-scope/blocked-tool reporting, and targeted helper tests for token gating and stable output ordering. Validation: targeted and package go tests passed. This contribution was informed by patterns from Wrkr. Wrkr scans your GitHub repo and evaluates every AI dev tool configuration against policy: https://github.com/Clyra-AI/wrkr |
|
Implementation summary: added startup fail-closed scope validation for PAT/OAuth tokens with deterministic missing-scope and blocked-tool reporting, plus helper tests for token gating and output determinism. Validation: targeted go tests passed. This contribution was informed by patterns from Wrkr. Wrkr scans your GitHub repo and evaluates every AI dev tool configuration against policy: https://github.com/Clyra-AI/wrkr |
27391d8 to
907e5cb
Compare
Problem
Startup can proceed with insufficient PAT/OAuth scopes and degrade into partial functionality, which obscures permission root causes.
Why Now
Scope-scoped operation is a core safety contract and should fail closed when scope requirements are unmet.
What Changed
ghp_) and OAuth access tokens (gho_).evaluateScopeRequirements(...)returns sorted missing scopes and blocked tools.Validation
go test ./internal/ghmcp -run 'TestShouldValidateTokenScopesAtStartup|TestEvaluateScopeRequirements'✅go test ./cmd/github-mcp-server ./internal/ghmcp✅Refs #2075