Skip to content

fix(acp): enforce authentication discriminator boundaries - #184

Open
YoungSx wants to merge 3 commits into
mainfrom
fix/acp-auth-discriminator-boundaries
Open

fix(acp): enforce authentication discriminator boundaries#184
YoungSx wants to merge 3 commits into
mainfrom
fix/acp-auth-discriminator-boundaries

Conversation

@YoungSx

@YoungSx YoungSx commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

原始 initialize 报文把认证 type 写成空白、数字或 null 时,SDK 会把它当作缺省 agent,继而发出不该发送的 authenticate。现在只有未提供 type 或精确的 agent 可以执行认证;未知字符串保持原值但不可执行,错误 JSON 类型按协议拒绝。

认证报文的读写共用版本规则:v1 使用 id,显式 v2 使用 methodId 并要求判别字段;未知载荷和 terminal 的 args/env 在往返中保留。直接 DTO、集合和 initialize 嵌套路径均覆盖,生产默认仍为 v1。

依据:ACP AuthMethod schema 的缺省判别规则及 terminal 方法不得传给 authenticate 的要求;v2 schema 的显式判别与字段名。

验证:

  • SDK 593/593;格式、分析器和构建零警告、零错误。Presentation 鉴权定向 26/26。
  • 包兼容基线 1.0.0;本次 nupkg 外部消费者构建/运行、37 个草案类型诊断和两种抑制方式通过。
  • 反向验证:移除判别白名单后,16 项中的 9 项因捕获到真实 authenticate 报文而失败;恢复后全套通过。
  • Application 120/120。测试指标收集器按 trace 筛选并使用线程安全队列;受控并发 trace 在原实现上 1/8 失败,修复后完整程序集通过。
  • 当前提交 4de1fbc1 的 GitHub CI:16 项通过,1 项仓库条件 GUI 检查跳过;PR 可合并,无冲突。条件跳过不算 Windows 真机 GUI 验证。

Refs #147。交付该单 PR A;终端交互登录为后续 PR B,本 PR 不关闭总单。

Default only an absent v1 type to agent, reject non-string discriminators, and preserve unsupported strings and payload fields. Share version-aware authentication serialization across DTO, collection, and initialize roots so unknown fields cannot override the negotiated method identity.

Add raw initialize transport regressions, presentation selection coverage, and schema round-trip properties. Validation: 593 SDK tests, 26 presentation authentication tests, analyzer and package validation, external nupkg consumer, and a 9-case failing whitelist mutation.

Refs #147
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
salmonegg Ready Ready Preview Sep 8, 2026 6:03pm UTC

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant