This commit is contained in:
parent
1b5f49aab0
commit
0cf001ead9
|
@ -17,7 +17,9 @@ ENV_KEY_VAULT_MOUNT_POINT = 'VAULT_MOUNT_POINT'
|
||||||
|
|
||||||
|
|
||||||
class SecretLoader:
|
class SecretLoader:
|
||||||
"""Priority order:
|
"""System for loading secrets from a variety of sources.
|
||||||
|
|
||||||
|
Priority order:
|
||||||
|
|
||||||
0. Hardcoded values. This is purely for prototyping.
|
0. Hardcoded values. This is purely for prototyping.
|
||||||
1. Files pointed to by environment variables.
|
1. Files pointed to by environment variables.
|
||||||
|
@ -70,8 +72,7 @@ class SecretLoader:
|
||||||
filepath = f'./secrets/{env_key.lower()}'
|
filepath = f'./secrets/{env_key.lower()}'
|
||||||
try:
|
try:
|
||||||
with open(filepath) as f:
|
with open(filepath) as f:
|
||||||
value = f.read().strip()
|
return f.read().strip()
|
||||||
return value
|
|
||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user