Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat: allow specifying callback port for OIDC auth

Đang mở
#3,300 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
authentication, cli

Hướng nghiên cứu

Bắt đầu tại crates/openshell-cli/src/oidc_auth.rs quanh các dòng 188-190 và theo dõi cách listener port đi đến việc xây dựng redirect_uri. Cập nhật docs/reference/gateway-auth.mdx quanh các dòng 92-98 và 123, sau đó bổ sung coverage cho unit test đối với port được cấu hình và lỗi xung đột bind. Công việc được hoàn tất khi biến môi trường chọn listener port, các port không hợp lệ hoặc không khả dụng tạo ra lỗi có thể xử lý được, và hành vi ephemeral mặc định vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

state:triage-needed
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
Ngôn ngữ chính
Rust
Star
8.7k
Fork
1.3k
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
297

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/OpenShell

Tất cả issue của NVIDIA/OpenShell

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.