Skip to content

feat(ssh-agent): Porting identity-policy-based SSH Agent forwarding broker to the Tauri version. - #475

Merged
nyakang merged 1 commit into
nyakang:migration/gpuifrom
litcc:gpui
Aug 20, 2026
Merged

feat(ssh-agent): Porting identity-policy-based SSH Agent forwarding broker to the Tauri version.#475
nyakang merged 1 commit into
nyakang:migration/gpuifrom
litcc:gpui

Conversation

@litcc

@litcc litcc commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

背景

本 PR 将 Tauri 版本中已有的 SSH Agent 认证与可配置转发能力移植到 GPUI 版本,保持既有用户行为、数据兼容性和安全策略,不引入一套全新的 Agent 协议设计。

主要对齐 Tauri 提交:

  • 05884e1b:SSH Agent 认证与基础转发
  • a4792c02:可配置 Agent 转发、身份策略与 broker

主要变更

  • 将认证 endpoint 与 forwarding 配置解耦并迁移到 nyaterm-core
  • 将外部 Agent、多 endpoint、NyaTerm 已保存密钥和身份 fingerprint 策略接入 GPUI transport。
  • 移植 allowlist、AllowAll、身份合并、签名路由、超时、并发限制和 key revision 失效机制。
  • 在 GPUI 连接编辑器中补齐 Agent endpoint、转发来源、策略选择和身份预览。
  • 保留旧版 agent_endpoint / agent_forwarding 字段迁移逻辑。
  • 保留同步、备份、导入和跨平台 endpoint 的兼容行为。
  • 新增 GPUI 对应的 broker、状态管理、存储适配和集成测试。

GPUI 适配

  • nyaterm-core:持久化模型、迁移和结构校验。
  • nyaterm-transport:Agent broker、SSH channel wiring 和签名处理。
  • nyaterm-desktop:连接编辑器、预览 UI、session 配置构建。
  • nyaterm-store:保存密钥 revision、备份/同步兼容。
  • rustfmt.toml:建立 Rust 2024 项目的统一格式化基线,并忽略 targetvendor

兼容性与安全

  • 私钥不会发送到远程服务器,保存密钥仅在本地完成签名。
  • allowlist 使用精确 fingerprint 匹配。
  • Agent endpoint 与 forwarding 策略保持设备本地属性。
  • 旧配置会自动迁移到新的 canonical schema。
  • 单一外部 Agent 场景保留 raw relay,以兼容未知 Agent 扩展。
  • 未修改 vendor/ 内容。

验证

  • cargo check --workspace 通过。
  • nyaterm-core 测试通过。
  • nyaterm-store 测试通过。
  • 新增 SSH Agent broker 与 GPUI 连接编辑器测试通过。
  • transport 和 desktop 全量测试中的少量失败位于本次未修改的既有测试路径。
  • git diff --check 通过。

补充:488aa6brustfmt.toml 与功能移植相对独立;添加了一些格式化规则,看看是否可以合并

The broker merges identities from external agents and stored keys,
applies allowlist or allow-all policies, and routes signing requests to
the owning provider. Raw relay remains for single-provider topologies to
preserve unknown extensions.
@litcc

litcc commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@nyakang

nyakang commented Aug 20, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 488aa6bc5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rustfmt.toml Outdated
# Stable: No (tracking issue: #3347)
# Wrap comments to fit the line width
# Default value: false
wrap_comments = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restrict rustfmt options to stable settings

With the repository's stable Rust toolchain, this option and the other active settings marked Stable: No are ignored; notably, ignore = ["target", "vendor"] is ignored as well. Running the required cargo fmt --all -- --check now exits nonzero, emits unstable-option warnings, and reports formatting diffs across both vendor/ and project crates, so the standard formatting check cannot pass unless the configuration uses stable options or the repository explicitly pins nightly rustfmt.

AGENTS.md reference: AGENTS.md:L210-L217

Useful? React with 👍 / 👎.

@nyakang
nyakang marked this pull request as ready for review August 20, 2026 10:16
@nyakang
nyakang merged commit 8d128aa into nyakang:migration/gpui Aug 20, 2026
3 checks passed
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.

2 participants