-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fall back when keyring is locked #7037
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,9 +46,14 @@ def get_credential( | |
return default | ||
|
||
import keyring | ||
import keyring.errors | ||
|
||
for name in names: | ||
credential = keyring.get_credential(name, username) | ||
try: | ||
credential = keyring.get_credential(name, username) | ||
except keyring.errors.KeyringLocked: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is missing the #3012 error which is common for headless servers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like no retry should happen, even with different service names, when getting a |
||
self._is_available = False | ||
break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This flow-control doesn't make sense (we shouldn't abort trying all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the keyring is locked because the user canceled, asking them again and again is not very good UX. A single |
||
if credential: | ||
return HTTPAuthCredential( | ||
username=credential.username, password=credential.password | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary.