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 小时
- 30 天内合并 PR
- 18
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 一周以上 新手友好度 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 天内回复