feat: allow specifying callback port for OIDC auth
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- authentication, cli
Direzione di ricerca
Inizia in crates/openshell-cli/src/oidc_auth.rs intorno alle righe 188-190 e segui come la porta del listener arriva alla costruzione di redirect_uri. Aggiorna docs/reference/gateway-auth.mdx intorno alle righe 92-98 e 123, quindi aggiungi la copertura dei test unitari per la porta configurata e un errore di collisione del bind. Il lavoro è completo quando la variabile d’ambiente seleziona la porta del listener, le porte non valide o non disponibili producono errori utilizzabili e il comportamento effimero predefinito rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
User Story
As an openshell consumer, I'd need the OIDC flow to work with a specific ephemeral port for SSO login. This is because the underlying auth0 provider does not allow regex on the port for allowed callback urls
Problem Statement
Provide a way to fix the CLI ephemeral callback port to a specific value so that it's easier to add the callback url
Impact / Why This Matters
Right now the SSO login requires whitelisting every possible ephemeral port in localhost which is not ideal.
Proposed Design
Provide the control of port via env variable OPENSHELL_OIDC_CALLBACK_PORT or something similar
Acceptance Criteria
- the callback port gets opened on specific port instead of any ephemeral port
Alternatives Considered
client credentials flow is what I am considering it for now
Agent Investigation
Spike Plan: feat: allow OIDC callback listener to bind a fixed port via env var
Scope decision: Env-var only (OPENSHELL_OIDC_CALLBACK_PORT) — no GatewayMetadata/clap changes.
Problem statement: The CLI's OIDC login flow binds an OS-assigned ephemeral port (127.0.0.1:0) for the local callback listener. Providers that require pre-registering exact redirect URIs can't reasonably whitelist the full ephemeral range, so login fails or requires impractical whitelisting.
Code changes (all in crates/openshell-cli/src/oidc_auth.rs):
- :188 — check OPENSHELL_OIDC_CALLBACK_PORT; if set, parse as u16 and bind that specific port with a wrapped, actionable error on bind failure; else keep current bind("127.0.0.1:0") behavior.
- No changes needed to redirect_uri construction (:189-190) or callback handling (:660-716) — they already work off whatever port the listener has.
Labels: area:cli, state:validated
Complexity: Low · Confidence: High · Est. files: 1 (+ docs, + tests)
Risks to include in the issue: - Bind-failure UX must give actionable guidance (today's raw OS error is not user-friendly).
- Fixed port is predictable, but existing CSRF state check + PKCE already prevent exploitation — mention, not a blocker.
- No interaction with token/mTLS storage or TUI (confirmed).
Docs impact: docs/reference/gateway-auth.mdx — add the new env var to the table (~line 92-98) and update prose at line 123.
Test additions: unit test setting the env var and asserting the bound port matches; a bind-collision test asserting the friendly error message.
Checklist
- I've reviewed existing issues and the architecture docs
- This is a design proposal, not a "please build this" request
- Lingua principale
- Rust
- Stelle
- 8.7k
- Fork
- 1.3k
- Merge medio
- 2g 7h
- PR unite (30g)
- 243
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/OpenShell
-
area:docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
state:triage-needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
area:cli state:validated
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
state:triage-needed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
area:build spike state:review-ready state:stale
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
Tutte le issue di NVIDIA/OpenShell
Issue simili
-
risk:low runtime status:in-progress type:test
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
EricSpencer00/Resilient#4835 · 1 commento ·
-
agent:ready documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
cesarferreira/stax#890 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100