-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] earthaccess.login tries other strategies when it should not #945
Comments
There's the problem: earthaccess/earthaccess/__init__.py Line 89 in 3f8b03a
This is pretty magical! There are two places we are trying multiple strategies: one in |
Perhaps the "all strategy" logic should be moved into the |
Yep, we should not be doing that. |
Yeah, to me it makes the most sense for this to all be encapsulated in the |
Is this issue already tracked somewhere, or is this a new report?
Current Behavior
When calling
earthaccess.login
with a strategy other than"all"
, it might call one or more other strategies.Expected Behavior
When calling
earthaccess.login
with a strategy other than"all"
, it should attempt only the specified strategy.Steps To Reproduce
The following should ignore the env vars as well as netrc, and only prompt for creds, but does not.
It uses the env vars to login, even though the strategy is
"interactive"
, not"all"
(of course, replaceusername
andpassword
with valid Earthdata Login creds):If the creds are valid, you are not prompted for creds, as the env vars are used to successfully login, and thus the "interactive" strategy is skipped.
Conversely, if you use invalid creds for the env vars, login will still attempt to use them, but since login will fail with them, the "netrc" strategy will be tried. If you have a valid netrc entry, login will succeed without prompting you for creds.
Only when neither valid env vars nor a valid netrc entry exists will you will be prompted to enter creds. However, neither of the other strategies should be attempted at all, not even if a user enters invalid creds interactively.
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: