Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#4,509 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api

Direzione di ricerca

Inizia da validateGatewayName in gateway/paths.go sotto sdk/go/openshell/v1/gateway e segui come LoadConfig, NewClient (incluso il percorso del gateway attivo con nome vuoto) e ListGateways la richiamano. Leggi i test esistenti sulla validazione dei percorsi per vedere quali casi di traversal sono già coperti. È completato quando i nomi con punti come gw.example.com e gli host IPv4 vengono caricati, elencati e risolti come attivi, mentre .. e i separatori di percorso continuano a essere rifiutati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Rust
Stelle
16.3k
Fork
1.8k
Merge medio
2g 6h
PR unite (30g)
397

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/OpenShell

Tutte le issue di NVIDIA/OpenShell

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.