-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BF: do not crash, just skip whenever trying to delete non existing pa…
…ssw in keyring Fixing bug leading to a crash: We have pairs or more in composite credentials. If user saved some but not all of them, then upon renew whenever we try to delete them all we would crash here since keyring cannot delete the ones it does not yet know. So the easiest (although adhoc due to need to match msg) is to handle such an exception. To get it tested, I had to use a "real" keyring's backend (so they are called), and for that I had to RF our Keyring helper class to be capable of being provided a keyring backend instance (or in other words -- a "keyring"). An odd logic abit I left behind is that even though we are now explicitly asking for what keyring will be used, so we could store/use that instance if no explicit backend is provided, but for consistency with current behavior (since to go against maint), decided to keep it as is and keep using module level bound interfaces of keyring module in case if no backend instance was provided. So now ._keyring could be either keyring module (no backend instance provided, or actual keyring backend if it was provided (used only in the tests). Added test also tests basic assumption that keyring is storing the name somewhere, and deletes entire section whenever we delete entire credential. Relies on "ad-hoc" way to specify the filename. Somewhat inquired in jaraco/keyrings.alt#45 on a better way. Closes #5889
- Loading branch information
1 parent
513c753
commit 3cddd7c
Showing
2 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters