bug(sdk/go): gateways with host-derived names (containing dots) cannot be loaded
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 gateway/paths.go 中的 validateGatewayName 开始,位于 sdk/go/openshell/v1/gateway 下,追踪 LoadConfig、NewClient(包括名称为空时的活动网关路径)和 ListGateways 如何调用它。阅读现有的路径校验测试,查看哪些遍历用例已被覆盖。当 gw.example.com 这类带点的名称和 IPv4 主机能够被加载、列出并解析为活动网关,而 .. 和路径分隔符仍然被拒绝时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
User Story
I use OpenShell and build automation against its SDKs. While reviewing sdk/ I hit this behavior and reproduced it with the minimal test below against main. Any gateway added by URL without --name is affected.
Problem Statement
openshell gateway add https://gw.example.com derives the gateway name from the host (gw.example.com). The CLI accepts any single path component as a name, but the Go SDK's validateGatewayName rejects any name containing a dot (gateway/paths.go).
Impact / Why This Matters
gateway.NewClient("gw.example.com") and gateway.LoadConfig fail with invalid gateway name: name must not contain dots; when that gateway is the active one, NewClient("") fails too, and ListGateways() silently omits it. Users must re-register gateways under a dot-free name to use the Go SDK.
Acceptance Criteria
- The Go SDK loads, lists and resolves (as active) any gateway name the CLI can create, including host-derived names such as
gw.example.comand IPv4 hosts. - Path traversal (
.., separators) is still rejected.
Reproduction Steps
openshell gateway add https://gw.example.com(or create$XDG_CONFIG_HOME/openshell/gateways/gw.example.com/metadata.jsonwith{"gateway_endpoint":"https://gw.example.com:443","auth_mode":"none"}andactive_gateway=gw.example.com).- Call
gateway.LoadConfig("gw.example.com"),gateway.LoadConfig(""),gateway.ListGateways().
Suggested UX (if applicable)
No response
Environment
- OpenShell:
main@ 82977e2 (2026-10-13) - SDK: Go (
sdk/go/openshell/v1/gateway) - Toolchain: Go 1.25.4 linux/amd64, Node 22
Logs
gateway: invalid gateway name: name must not contain dots
gateway: no active gateway: active_gateway contains invalid name "gw.example.com": gateway: invalid gateway name: name must not contain dots
ListGateways omits the CLI-registered gateway
- 主要语言
- Rust
- 星标
- 15.4k
- 派生
- 1.7k
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 374
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug(sdk/go): edge (Cloudflare Access) token is cached for the client lifetime and never reloaded未关闭state:triage-needed
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
docs(upgrade): no migration notes for 0.1.1, 0.1.2, or 0.1.3 (only the 0.1.0 page exists)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭state:triage-needed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
V1 manifest lists written by Java lose added/existing/deleted file counts可能已有人在做 @kacper-li-airspace-intelligence 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/iceberg-rust#3445 ·
维护者通常 4 天内回复
-
Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)可能已有人在做 @mangeshraut712 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
CapSoftware/Cap#2546 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
area::tern-sync kind::cleanup triage::ready
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复