Skip to content

Commit

Permalink
Fixed secret file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tdickman committed Apr 2, 2018
1 parent e464da1 commit d3b41cc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ksec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/python3
# Usage ##
# ksec COMMAND AND ARGUMENTS
#
Expand All @@ -14,9 +14,10 @@

with open('.secrets.yaml') as f:
for doc in yaml.load_all(f):
for key, value in doc['data'].items():
decoded_value = base64.b64decode(value).decode()
os.environ[key.upper()] = decoded_value
for secret in doc['items']:
for key, value in secret['data'].items():
decoded_value = base64.b64decode(value).decode()
os.environ[key.upper()] = decoded_value


subprocess.call('{}'.format(' '.join(sys.argv[1:])), shell=True)

0 comments on commit d3b41cc

Please sign in to comment.