OAuth: non-interactive deployment discards a valid saved account when multiple accounts are authorized
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- authentication, cli
調査の方向性
The bug is in the OAuth account handling in lean/models/json_module.py, which drops a saved account when several accounts are authorized, even with interactive=False. Start from that account-selection logic and the config_build path that reports the missing --example-account option. Done when a valid saved account survives multiple authorized accounts, an invalid saved account is still discarded, and an explicit command-line account still overrides the saved one, with regression tests covering all three.
索引モデルが issue の本文から書いたものです。
説明
Problem
A non-interactive OAuth brokerage configuration rejects a valid account saved in lean.json whenever the authorization returns more than one account.
In lean/models/json_module.py, the OAuth account handling removes the saved account when either it is absent from the returned list or the list has more than one account. The latter condition applies even with interactive=False. Configuration then reports the account option as missing.
Reproduction
Use an OAuth module with an account choice filtered on its OAuth configuration, and:
- saved configuration:
{"project-id": 123, "example-user-name": "SampleUser", "example-account": "ACCOUNT1"}; - authorization account ids:
["ACCOUNT1", "ACCOUNT2"]; config_build(..., interactive=False), without an explicit account command-line option.
Observed: You are missing the following option: --example-account.
Expected: preserve ACCOUNT1, which is explicitly configured and is in the authorized account list.
Confirmed with a synthetic authorization on master 9479601 as well as 42fbdbd. Passing the same account explicitly as a command-line option succeeds on both. This is existing shared OAuth behavior, not specific to a newly added brokerage.
Suggested fix
Only discard a saved account when it is no longer authorized. If interactive mode intentionally asks users to choose again when several accounts are available, keep that policy confined to interactive mode. Add regression coverage for a valid saved account with multiple authorized accounts, an invalid saved account, and an explicit command-line override.
- 主要言語
- Python
- スター
- 330
- フォーク
- 171
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 18
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QuantConnect/lean-cli のほかの issue
-
Keep the market-hours database when a refresh returns malformed JSON対応中かも @pcbeingused333 が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
QuantConnect/lean-cli#709 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
QuantConnect/lean-cli#706 ·
メンテナーはふだん 2 日以内に返信
-
cloud pull --encrypt leaves the project without its key path and encrypts referenced libraries対応中かも @Amadeus-22 が 6 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
QuantConnect/lean-cli#688 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
QuantConnect/lean-cli#681 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
QuantConnect/lean-cli#619 ·
メンテナーはふだん 2 日以内に返信
QuantConnect/lean-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FinanceFlash/unvibecode#509 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/python-sdk#3821 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
Log-odds calibration uses upper middle score instead of median for even candidate sets対応中かも @flysheep-ai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信