Skip to content

feat:pi协议中添加加密字段 - #1463

Open
overflow65537 wants to merge 3 commits into
mainfrom
feat/secret
Open

feat:pi协议中添加加密字段#1463
overflow65537 wants to merge 3 commits into
mainfrom
feat/secret

Conversation

@overflow65537

@overflow65537 overflow65537 commented Aug 24, 2026

Copy link
Copy Markdown
Member

Sourcery 摘要

为 PI 协议添加加密密码字段支持,同时防止密码值出现在面向用户或可共享的数据中。

新功能:

  • 为 PI 输入字段添加 password 标志,用于标识敏感值并定义其在各客户端中的处理方式。

改进:

  • 记录密码输入的安全处理要求,包括掩码显示、加密配置存储,以及从日志、遥测数据、默认值和预设值中排除。

文档:

  • 更新英文和中文 Project Interface V2 文档,添加密码字段行为、示例以及 v2.10.0 版本条目。

维护工作:

  • 扩展接口架构,以支持新的 password 输入属性。
Original summary in English

Sourcery 摘要

为 PI 协议添加安全密码字段支持,并记录其处理要求。

新功能:

  • 为 PI 协议输入字段添加 password 属性,用于标识机密值并定义客户端的安全处理方式。

增强功能:

  • 明确密码输入的安全处理要求,包括掩码显示、加密配置存储,以及从日志、遥测数据、默认值和预设值中排除。

文档:

  • 更新英文和中文 Project Interface V2 文档,加入密码字段行为、示例以及 v2.10.0 条目。

杂项:

  • 扩展接口架构,以支持新的密码输入属性。
Original summary in English

Sourcery 摘要

为 PI 协议添加安全密码字段支持,并记录其处理要求。

新功能:

  • 为 PI 输入字段添加 password 属性,用于标识机密值并定义客户端的安全处理方式。

增强功能:

  • 明确密码值的安全处理要求,包括掩码显示、加密配置存储,以及从日志、遥测数据、默认值和预设值中排除。

文档:

  • 在英文和中文的 Project Interface V2 规范中记录密码输入行为、示例以及 v2.10.0 接口版本。

例行工作:

  • 扩展接口架构,以支持新的密码输入属性。
Original summary in English

Summary by Sourcery

Add secure password-field support to the PI protocol and document its handling requirements.

New Features:

  • Add a password attribute to PI input fields to identify secret values and define secure client handling.

Enhancements:

  • Specify secure handling for password values, including masked display, encrypted configuration storage, and exclusion from logs, telemetry, defaults, and presets.

Documentation:

  • Document password input behavior, examples, and the v2.10.0 interface version in the English and Chinese Project Interface V2 specifications.

Chores:

  • Extend the interface schemas to support the new password input attribute.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

您好——我发现了 1 个问题

面向 AI Agent 的提示
请处理本次代码审查中的评论:

## 单独评论

### 评论 1
<location path="docs/en_us/3.3-ProjectInterfaceV2.md" line_range="726" />
<code_context>
+      - **Logs and telemetry:** Never write the plaintext to logs, telemetry, crash reports, or any shareable output. When a placeholder is needed, use a mask such as `******`, or omit the field entirely.
+      - **Config storage:** When writing the user configuration file, the value must be stored encrypted. Plaintext must not be persisted. After loading the config, decrypt only in memory for runtime use such as `pipeline_override` substitution and `pretask` arguments.
+      - **Encryption:** The algorithm and ciphertext format are Client-defined; ciphertext need not be interoperable across Clients or machines. Prefer OS-provided credential protection (e.g. Windows DPAPI, macOS Keychain, Linux Secret Service).
+      - **`default` / `preset`:** Do not set `default` on password fields, and do not include password-field plaintext in `preset`. `interface.json` is typically distributed with resources, so plaintext secrets must not appear in it.
+
   - **hotkeys** `object[]`  
</code_context>
<issue_to_address>
**🚨 issue (security):** 更新后的 `interface.schema.json``interface_import.schema.json` 接受带有明文 `default` 的密码输入,也接受包含密码字段值的预设,尽管协议明确禁止这两种情况。因此,基于架构的验证和编辑器工具会将不安全的配置报告为有效,从而允许分发或持久化明文机密信息。

**触发条件:** 资源作者在 `default``preset` 中包含密码字段的明文时。

**建议修复:** 添加条件架构约束,在 `password``true` 时拒绝 `default`;并限制预设值,使其不能包含密码字段;或者说明这些安全规则需要单独的语义验证器来执行。
</issue_to_address>

Sourcery 对开源项目免费——如果您喜欢我们的审查结果,请考虑分享它们 ✨
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我会利用这些反馈来改进审查结果。
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/en_us/3.3-ProjectInterfaceV2.md" line_range="726" />
<code_context>
+      - **Logs and telemetry:** Never write the plaintext to logs, telemetry, crash reports, or any shareable output. When a placeholder is needed, use a mask such as `******`, or omit the field entirely.
+      - **Config storage:** When writing the user configuration file, the value must be stored encrypted. Plaintext must not be persisted. After loading the config, decrypt only in memory for runtime use such as `pipeline_override` substitution and `pretask` arguments.
+      - **Encryption:** The algorithm and ciphertext format are Client-defined; ciphertext need not be interoperable across Clients or machines. Prefer OS-provided credential protection (e.g. Windows DPAPI, macOS Keychain, Linux Secret Service).
+      - **`default` / `preset`:** Do not set `default` on password fields, and do not include password-field plaintext in `preset`. `interface.json` is typically distributed with resources, so plaintext secrets must not appear in it.
+
   - **hotkeys** `object[]`  
</code_context>
<issue_to_address>
**🚨 issue (security):** The updated `interface.schema.json` and `interface_import.schema.json` accept a password input with a plaintext `default`, and accept presets containing values for password fields, even though the protocol explicitly forbids both. Schema-based validation and editor tooling therefore report insecure configurations as valid, allowing plaintext secrets to be distributed or persisted.

**Triggers:** When a resource author includes a password field's plaintext in `default` or `preset`.

**Suggested fix:** Add conditional schema constraints that reject `default` when `password` is `true`, and constrain preset values so password fields cannot be included, or document that these security rules require a separate semantic validator.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/en_us/3.3-ProjectInterfaceV2.md Outdated
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