mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-06 06:04:24 -07:00
[PR #9028/1180843e backport][stable-9] bitwarden_secrets_manager lookup plugin: support more current versions of BWS CLI (#9036)
bitwarden_secrets_manager lookup plugin: support more current versions of BWS CLI (#9028)
* add support for getting secrets in the current version of bitwarden secrets manager
* format
* format2
* fragment
* fix formatting errors
* strip out junk before the version in cli output
* mock the --version command in the unit tests
* use LooseVersion comparison - russoz suggestion
* add blank line
(cherry picked from commit 1180843e35
)
Co-authored-by: Zac <zgibson@live.com>
This commit is contained in:
parent
721ea50420
commit
ab20c90929
3 changed files with 27 additions and 2 deletions
|
@ -45,6 +45,10 @@ MOCK_SECRETS = [
|
|||
class MockBitwardenSecretsManager(BitwardenSecretsManager):
|
||||
|
||||
def _run(self, args, stdin=None):
|
||||
# mock the --version call
|
||||
if args[0] == "--version":
|
||||
return "bws 1.0.0", "", 0
|
||||
|
||||
# secret_id is the last argument passed to the bws CLI
|
||||
secret_id = args[-1]
|
||||
rc = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue