http: classify missing token, invalid token, and insufficient scope distinctly
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 55/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- go
- 領域
- api, authentication, backend
研究方向
先從 pkg/http/middleware/token.go、pat_scope.go 和 scope_challenge.go 中的 middleware 路徑開始,接著檢查 pkg/errors/error.go 中的錯誤定義,以及 docs/error-handling.md 中現有的指南。使用憑證缺少、無效或已過期,以及 scope 不足的請求,執行 Go HTTP middleware 和錯誤測試。完成的標準是每條路徑都有不同的機器可讀取代碼,適用的 WWW-Authenticate 行為維持不變,目標測試通過,且代碼已完成文件化。
由索引模型根據 Issue 內容生成。
描述
Problem
Authentication and authorization failures currently collapse into generic HTTP errors even though missing credentials, invalid/expired credentials, and insufficient scopes require different remediation. That weakens machine-readable diagnostics for hosts and operators.
Why now
This server sits directly on GitHub token-policy boundaries. Clients and wrappers need explicit failure classification to decide whether to prompt for auth, refresh a token, or request additional scopes.
Expected behavior
Missing token, invalid/expired token, and insufficient scope paths should each expose a distinct machine-readable error code while preserving the existing auth challenge semantics.
Claim-to-codepath map
pkg/http/middleware/token.gopkg/http/middleware/pat_scope.gopkg/http/middleware/scope_challenge.gopkg/errors/error.godocs/error-handling.md
Evidence packet
- Commit under test:
fa87e4fc9e4cd1f514cf4c236b9135987a328512 - Runtime: Go HTTP middleware tests on macOS
- Repro concept: exercise requests with no token, malformed/invalid token, and OAuth requests lacking required scopes.
Validation requirements
- Add targeted middleware/error tests for each classification.
- Preserve
WWW-Authenticatechallenge behavior where applicable. - Document the new machine-readable codes.
- 主要語言
- Go
- 星號
- 33.1k
- 分支
- 5k
- 平均合併
- 2 天 1 小時
- 30 天內合併 PR
- 25
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
github/github-mcp-server#3235 ·
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
github/github-mcp-server#3042 · 2 則留言 ·
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
github/github-mcp-server#3032 · 1 個 reaction ·
-
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#2803 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2740 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
-
bug group: validation priority: low
難度 2/5 1-3 小時 新手友好度 75/100
codecheckers/chekhov#51 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100