feat: Implement static auth registry and capability-based runtime authz#396
Merged
liujuanjuan1984 merged 4 commits intomainfrom Apr 7, 2026
Merged
feat: Implement static auth registry and capability-based runtime authz#396liujuanjuan1984 merged 4 commits intomainfrom
liujuanjuan1984 merged 4 commits intomainfrom
Conversation
Collaborator
Author
|
自审结果:当前没有发现阻塞合入的问题。 本次重点核对了 3 类内容:
我特别关注了几个风险点,目前判断可接受:
结论:
已验证: |
Collaborator
Author
|
独立审查结果:未发现新的阻塞性问题。 本轮重点复核了 4 个方面:
我没有发现需要阻塞合入的问题,但仍建议保留两个后续观察点:
结论:
已复核:
|
Collaborator
Author
|
本轮继续把
验证:
本轮提交: |
Collaborator
Author
|
补充一处文档收口:
本轮提交: 说明:本次为文档示例调整,未运行 |
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.
Runtime Auth
A2A_STATIC_AUTH_CREDENTIALSstatic credential registry。src/opencode_a2a/auth.py,集中承载 static credential build、bearer/basic authenticate、capability lookup 与 authenticated principal 结构。Settings改为仅接受A2A_STATIC_AUTH_CREDENTIALS作为 inbound auth 配置来源。bearer/basiccredential,并映射到稳定 principal。principal;basic credential 的 principal 固定等于username。credential_id,进入 runtime principal、request state、call context、executor diagnostics 与 interrupt tracking,便于后续审计、日志、诊断和轮换。Authz Boundary
opencode.sessions.shell改为要求session_shellcapability。workspace_mutationcapability。AUTHORIZATION_FORBIDDEN (-32007)错误契约补齐到 session / workspace 扩展,并在可用时返回credential_id便于拒绝路径诊断。Interrupt / State Store
credential_id进入 interrupt runtime binding 与 state-store persistence,但仍不参与 ownership 或 authz 主判定。identity之外,增加对credential_id的可选一致性校验,避免轮换/错配时误回放到错误 credential 视角。credential_id列,并覆盖 legacy schema migration。Agent Card / Docs
bearerAuth/basicAuth。credential_id、credential disable、high-risk capability gating,以及 authz/interruption 诊断语义说明。Tests / CI
tests/server/test_auth.py。quality-gate:为测试假凭证补充 allowlist 标注,并接受ruff自动格式化结果。验证
./scripts/doctor.shquality-gate,runtime-matrix (3.11),runtime-matrix (3.12)关联