Store a per-profile API URL for multi-environment auth
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- rust
- Lĩnh vực
- api, authentication, cli
Hướng nghiên cứu
Start with the TokenStore schema and migration paths, then trace read_token, Authentication::new, fetch_profile_info, and fetch_profiles_with_info. Resolve the open URL-capture decision before implementing. Done means profile URLs round-trip, legacy profiles fall back to the global default, and auth list uses each profile's host in tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
The multi-profile auth work in #293 stores only a token per profile, and every command resolves the API host from the single API_BASE_URL (defaulting to prod). Since multi-profile usually means multi-environment (for example a prod profile and a stage profile), this means:
auth listsends every stored token to the one host, so a stage token gets transmitted to the prod host and then shows blank because it 401s.- There is no way to keep a profile pinned to the environment its token belongs to.
Raised by @sergey-borovkov in review: it is much cheaper to decide the storage format now, while it is new, than to migrate it a second time later.
Proposal
Store an optional API URL per profile and use it wherever a profile's token is used (read_token/Authentication::new, fetch_profile_info, fetch_profiles_with_info). Profiles without a URL (including migrated legacy ones) fall back to the current global default, so this stays backward compatible.
Open decision — how is the URL captured?
This is the reason it was deferred from #293 rather than guessed at. Options:
screenly login --url <url>— explicit, but one more flag to pass.- Capture the resolved
API_BASE_URL(env or default) at login time and store it — zero new flags, but implicit and easy to get wrong if the env var isn't set. - Both:
--urloverrides, otherwise capture the resolved base URL.
Option 3 is probably the most forgiving. Worth agreeing on before implementing.
Scope / touch points
TokenStoreschema: each entry becomes token + optional url (migration-safe, since serdeOptiondefaults toNone).- Migration: legacy plain-text and existing single-token stores get
url: None→ global default. read_token/Authentication::new: resolve the active profile's url alongside its token.fetch_profile_info/fetch_profiles_with_info: use the per-profile url.- Tests: per-profile url round-trips, fallback to default when absent,
auth listhits each profile's own host.
Notes
- Not a blocker for #293; that PR intentionally leaves this out.
- Backward compatible if the url field is optional with a default.
- Ngôn ngữ chính
- Rust
- Star
- 29
- Fork
- 7
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không 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 Screenly/cli
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Improve error messages when not logged inCó thể làm lại được @sergey-borovkov đã nhận 299 ngày trước và không có pull request nào đang mở. Đang mở
Screenly/cli#270 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug CLI exec tool-calls
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
maintainer-needed p2 triaged ui windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai_p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/ClickHouse#123351 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
github/copilot-sdk#2804 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày