bug: workspace access hint suggests a --subject command that fails for hyphen-leading OIDC subjects
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #4911 của @viwe-monai — đã đóng, không merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu tại crates/openshell-cli/src/main.rs, ở các đối số subject của workspace member add và workspace member remove, rồi đọc crates/openshell-server/src/auth/workspace_authz.rs, nơi gợi ý khắc phục được tạo bằng shell_quote_for_hint. Kiểm tra các bài kiểm thử hiện có về phân tích đối số CLI và tạo gợi ý. Công việc hoàn tất khi cả hai lệnh chấp nhận subject bắt đầu bằng dấu gạch nối, gợi ý được sao chép chạy thành công và có bài kiểm thử bao quát cả hai hành vi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
User Story
I use OpenShell with OIDC sign-in and workspaces. When a workspace denied me, I copied the suggested openshell workspace member add command from the error and it failed, because my OIDC subject starts with -. I need the suggested command to work as printed, so a user can grant access without working out clap's argument parsing.
Problem Statement
When a principal lacks workspace access, the gateway's permission-denied message suggests a remediation command (crates/openshell-server/src/auth/workspace_authz.rs, built with shell_quote_for_hint):
openshell workspace member add --workspace '<ws>' --subject '<subject>' --role user
The subject is shell-quoted, but quoting doesn't stop clap from parsing it. OIDC subjects are opaque strings and can start with -. When one does, --subject '-oAbC…' fails with error: unexpected argument '-o' found, because --subject in crates/openshell-cli/src/main.rs (workspace member add and workspace member remove) is a plain #[arg(long)] that doesn't accept hyphen-leading values.
Impact / Why This Matters
- The copy-paste remediation fails for any user whose subject starts with
-, and clap's error points at a flag that doesn't exist, not at the cause. - The workaround,
--subject=-oAbC…, isn't obvious and isn't mentioned anywhere.
Acceptance Criteria
-
openshell workspace member add --subject '<value starting with ->' …andworkspace member removeaccept the subject (for example viaallow_hyphen_values), or the hint emits--subject=<quoted>. - The remediation hint, copied verbatim, succeeds for a subject that starts with
-. - A test covers a hyphen-leading subject in both the hint and the CLI parsing.
Reproduction Steps
- Sign in to an OIDC-enabled gateway as a user whose
subclaim starts with-. - Run any command against a workspace you aren't a member of, and copy the suggested
openshell workspace member add … --subject '-…' --role usercommand. - As a workspace admin, run the copied command.
- Observe
error: unexpected argument '-o' found.
Environment
- OpenShell: CLI
0.1.5-dev.124+g92434dcb2; gateway0.1.6-dev.26+g229382e51 - OS: macOS (arm64)
- Runtime, deployment, or integration: OIDC authentication with workspaces
Suggested UX (if applicable)
openshell workspace member add --workspace 'my-ws' --subject='-oAbC123…' --role user
Logs
error: unexpected argument '-o' found
- Ngôn ngữ chính
- Rust
- Star
- 17.1k
- Fork
- 1.8k
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 329
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/OpenShell
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
state:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(install): install.sh prints gawk "escape sequence \. treated as plain ." warnings on RPM hostsCó thể đã có người làm @ericcurtin đã nhận 3 ngày trước. Đang mởstate:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(sdk/go): browser login callback binds 127.0.0.1 but redirect_uri uses localhostCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởstate:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NVIDIA/OpenShell#4518 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
state:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/OpenShell
Issue tương tự
-
bug priority: P3 ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
shep-pm/shep-kelpie#1332 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ramensoftware/windhawk#1156 · 2 bình luận ·
-
units: No `#` in rustdoc headingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100
rust-bitcoin/rust-bitcoin#7089 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
phase:3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pchrysostomou/ananke#183 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/tools bug session-analysis
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày