Skip to content

Commit

Permalink
Change collectionId to collection_id parameter on bitwarden plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
psalkowski committed Jan 18, 2023
1 parent ce37090 commit 4ee3787
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
minor_changes:
- lookup - bitwarden - implement filtering results by collectionId parameter (https://github.com/ansible-collections/community.general/issues/5849).
- bitwarden lookup plugin - implement filtering results by ``collection_id`` parameter (https://github.com/ansible-collections/community.general/issues/5849).
8 changes: 4 additions & 4 deletions plugins/lookup/bitwarden.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
field:
description: Field to fetch. Leave unset to fetch whole response.
type: str
collectionId:
collection_id:
description: Collection ID to filter results by collection. Leave unset to skip filtering.
type: str
version_added: 6.3.0
Expand All @@ -50,7 +50,7 @@
- name: "Get 'password' from Bitwarden record named 'a_test' from collection"
ansible.builtin.debug:
msg: >-
{{ lookup('community.general.bitwarden', 'a_test', field='password', collectionId='bafba515-af11-47e6-abe3-af1200cd18b2') }}
{{ lookup('community.general.bitwarden', 'a_test', field='password', collection_id='bafba515-af11-47e6-abe3-af1200cd18b2') }}
- name: "Get full Bitwarden record named 'a_test'"
ansible.builtin.debug:
Expand Down Expand Up @@ -113,7 +113,7 @@ def _get_matches(self, search_value, search_field, collection_id):
params = ['list', 'items', '--search', search_value]

if collection_id:
params.extend(['--collectionid', collection_id])
params.extend(['--collection_id', collection_id])

out, err = self._run(params)

Expand Down Expand Up @@ -152,7 +152,7 @@ def run(self, terms, variables=None, **kwargs):
self.set_options(var_options=variables, direct=kwargs)
field = self.get_option('field')
search_field = self.get_option('search')
collection_id = self.get_option('collectionId')
collection_id = self.get_option('collection_id')
if not _bitwarden.logged_in:
raise AnsibleError("Not logged into Bitwarden. Run 'bw login'.")

Expand Down

0 comments on commit 4ee3787

Please sign in to comment.