Store a per-profile API URL for multi-environment auth
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- rust
- 領域
- api, authentication, cli
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 29
- フォーク
- 7
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Screenly/cli のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
Improve error messages when not logged in再び着手できるかも @sergey-borovkov が 297 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
trezor/trezor-firmware#7997 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
oxidecomputer/management-gateway-service#506 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
scylladb/nodejs-rs-driver#566 ·
メンテナーはふだん 1 日以内に返信
-
A-ABI needs-triage relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs T-opsem
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信