[PR #7061/e75dc746 backport][stable-6] bitwarden lookup fix get_field
#7089
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #7061 as merged into main (e75dc74).
SUMMARY
A bitwarden record without any custom fields will throw a
KeyError
when you try to search withfield='notes'
. The code here tries to openmatch['fields']
without first checking if the keyfields
exists inmatch
.It turns out that with the current logic you can't get the
notes
field. It's either the login fields or custom fields. The new logic looks for your key in custom fields, then in login fields, then in the general fields for that record.Fixes #6617
ISSUE TYPE
COMPONENT NAME
bitwarden
ADDITIONAL INFORMATION
Here's the structure of a bitwarden record json object:
BEFORE AND AFTER
before:
after: