bitwarden-crd-operator/src/lookups/bitwarden_lookup.py
Tobias Trabelsi d316c8567e
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
working jinja template type
2022-11-26 21:33:31 +01:00

10 lines
363 B
Python

import json
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)