OAuth: non-interactive deployment discards a valid saved account when multiple accounts are authorized
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- authentication, cli
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 330
- Fork
- 171
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 QuantConnect/lean-cli
-
Keep the market-hours database when a refresh returns malformed JSONCó thể đã có người làm @pcbeingused333 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
QuantConnect/lean-cli#709 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
QuantConnect/lean-cli#706 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
cloud pull --encrypt leaves the project without its key path and encrypts referenced librariesCó thể đã có người làm @Amadeus-22 đã nhận 6 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
QuantConnect/lean-cli#688 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
QuantConnect/lean-cli#681 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
QuantConnect/lean-cli#619 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của QuantConnect/lean-cli
Issue tương tự
-
fuzz fuzz-unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
neilsh/stunt-reel#220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Issue]: use_fp4_cache is accepted but ignored; the launcher always writes FP8 recordsCó thể đã có người làm @0z5a đã nhận hôm nay. Đang mở
Độ 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
-
area: cli priority: p3 size: S type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
finos/open-resource-broker#757 ·
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 65/100
Maintainer thường phản hồi trong vòng 6 ngày