Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug(sdk/go): gateways with host-derived names (containing dots) cannot be loaded

未关闭 适合新手
#4,509 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
api

调研方向

从 gateway/paths.go 中的 validateGatewayName 开始,位于 sdk/go/openshell/v1/gateway 下,追踪 LoadConfig、NewClient(包括名称为空时的活动网关路径)和 ListGateways 如何调用它。阅读现有的路径校验测试,查看哪些遍历用例已被覆盖。当 gw.example.com 这类带点的名称和 IPv4 主机能够被加载、列出并解析为活动网关,而 .. 和路径分隔符仍然被拒绝时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

state:triage-needed
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.com and IPv4 hosts.
  • Path traversal (.., separators) is still rejected.
Reproduction Steps
  1. openshell gateway add https://gw.example.com (or create $XDG_CONFIG_HOME/openshell/gateways/gw.example.com/metadata.json with {"gateway_endpoint":"https://gw.example.com:443","auth_mode":"none"} and active_gateway = gw.example.com).
  2. 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。