add direct gopass adapter

This commit is contained in:
jem 2020-01-28 11:47:21 +01:00
parent 91f51a0bb6
commit 050e62aa49

View file

@ -2,8 +2,11 @@ from subprocess import check_output, call
import os import os
import sys import sys
def gopass_credential_from_env_path (env_path): def gopass_credential_from_env_path (env):
env_path = os.environ.get(env_path, None) env_path = os.environ.get(env, None)
return gopass_credential_from_path(env_path)
def gopass_credential_from_path (path):
credential = None credential = None
if env_path: if env_path:
@ -14,3 +17,4 @@ def gopass_credential_from_env_path (env_path):
credential = check_output(['gopass', env_path]) credential = check_output(['gopass', env_path])
return credential return credential