Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉 適合新手
#4,509 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
72/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
go
領域
api

研究方向

從 sdk/go/openshell/v1/gateway 下 gateway/paths.go 中的 validateGatewayName 開始,追蹤 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 天 6 小時
30 天內合併 PR
397

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。