bug(sdk/go): gateways with host-derived names (containing dots) cannot be loaded
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 sdk/go/openshell/v1/gateway 下 gateway/paths.go 中的 validateGatewayName 開始,追蹤 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 天 6 小時
- 30 天內合併 PR
- 397
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NVIDIA/OpenShell 的其他 Issue
-
bug(sdk/go): browser login callback binds 127.0.0.1 but redirect_uri uses localhost可能重新可做 關聯的 PR 已關閉且未合併。 未關閉state:triage-needed
難度 2/5 1-3 小時 新手友好度 65/100
NVIDIA/OpenShell#4518 · 1 則留言 ·
維護者通常 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
NVIDIA/OpenShell#4515 · 1 則留言 ·
維護者通常 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
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backends可能已有人在做 @roboomp 今天認領。 未關閉bug prio:p2 providers triaged
難度 2/5 1-3 小時 新手友好度 82/100
can1357/oh-my-pi#15798 · 3 則留言 ·
維護者通常 1 天內回覆
-
requires-triage
難度 2/5 1-3 小時 新手友好度 68/100
apache/datafusion-comet#7001 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
-
Add a Storybook section to CONTRIBUTING.md可能已有人在做 @ChanakyaG2004 今天認領。 未關閉documentation good first issue
難度 2/5 1-3 小時 新手友好度 82/100
FlowwStar/FlowStar#995 · 2 則留言 ·
維護者通常 1 天內回覆