-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
bitwarden lookup fix get_field
#7061
Conversation
when a bitwarden record has no custom fields,
|
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.
Thanks for your contribution!
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
suggestions committed |
If nobody objects, I'll merge this in ~a week. |
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #7089 🤖 @patchback |
* bitwarden lookup rewrite `get_field` * add changelog fragment * PEP8 add newline * Update changelogs/fragments/7061-fix-bitwarden-get_field.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Simon <simonleary@umass.edu> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e75dc74)
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #7090 🤖 @patchback |
* bitwarden lookup rewrite `get_field` * add changelog fragment * PEP8 add newline * Update changelogs/fragments/7061-fix-bitwarden-get_field.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Simon <simonleary@umass.edu> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e75dc74)
@simonLeary42 thanks for your contribution! |
…d` (#7090) bitwarden lookup fix `get_field` (#7061) * bitwarden lookup rewrite `get_field` * add changelog fragment * PEP8 add newline * Update changelogs/fragments/7061-fix-bitwarden-get_field.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Simon <simonleary@umass.edu> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e75dc74) Co-authored-by: simonLeary42 <71396965+simonLeary42@users.noreply.github.com>
…d` (#7089) bitwarden lookup fix `get_field` (#7061) * bitwarden lookup rewrite `get_field` * add changelog fragment * PEP8 add newline * Update changelogs/fragments/7061-fix-bitwarden-get_field.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/bitwarden.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Simon <simonleary@umass.edu> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e75dc74) Co-authored-by: simonLeary42 <71396965+simonLeary42@users.noreply.github.com>
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: