OAuth: non-interactive deployment discards a valid saved account when multiple accounts are authorized
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 62/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- authentication, cli
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 330
- Forks
- 171
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 18
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus QuantConnect/lean-cli
-
Keep the market-hours database when a refresh returns malformed JSONEvtl. vergeben @pcbeingused333 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
QuantConnect/lean-cli#709 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 50/100
QuantConnect/lean-cli#706 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
cloud pull --encrypt leaves the project without its key path and encrypts referenced librariesEvtl. vergeben @Amadeus-22 hat das vor 6 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
QuantConnect/lean-cli#688 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
QuantConnect/lean-cli#681 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
QuantConnect/lean-cli#619 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in QuantConnect/lean-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
cline/mcp-marketplace#3576 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
griptape-ai/griptape-nodes-library-elevenlabs#30 ·
Maintainer antworten meist innerhalb von 1 Tag
-
docs: Release playbookOffendocumentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
awslabs/social-messaging-agent-runtime-toolkit#140 ·
Maintainer antworten meist innerhalb von 1 Tag
-
subtask
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
fga-eps-mds/2026.2-MeasureSoftGram-DOC#187 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
NSPG13/agent-bounties#1747 ·
Maintainer antworten meist innerhalb von 1 Tag