working jinja template type
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2022-11-26 21:33:31 +01:00
parent cb793a7490
commit d316c8567e
13 changed files with 78 additions and 44 deletions

View File

@ -1,5 +1,10 @@
from utils.utils import get_secret_from_bitwarden
import json
def bitwarden_lookup(id, field):
_secret_json = get_secret_from_bitwarden(id)
return _secret_json["login"][field]
from utils.utils import get_secret_from_bitwarden, parse_fields_scope, parse_login_scope
def bitwarden_lookup(id, scope, field):
_secret_json = json.loads(get_secret_from_bitwarden(id))
if scope == "login":
return parse_login_scope(_secret_json, field)
if scope == "fields":
return parse_fields_scope(_secret_json, field)