From 0e33c334157288ad550faf7071af5774f1445fdf Mon Sep 17 00:00:00 2001 From: Matthias Ludwig Date: Wed, 12 Jul 2023 11:05:01 +0200 Subject: [PATCH] feat: add sync with bitwarden before getting a secret --- src/utils/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/utils.py b/src/utils/utils.py index 630dc9d..fd96acb 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -8,9 +8,15 @@ class BitwardenCommandException(Exception): def get_secret_from_bitwarden(logger, id): + sync_bw(logger) return command_wrapper(logger, command=f"get item {id}") +def sync_bw(logger): + status_output = command_wrapper(logger, command=f"sync") + logger.info(f"Sync successful {status_output}") + + def unlock_bw(logger): status_output = command_wrapper(logger, "status", False) status = status_output['data']['template']['status']