summaryrefslogtreecommitdiff
path: root/yarns/lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'yarns/lib.py')
-rw-r--r--yarns/lib.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/yarns/lib.py b/yarns/lib.py
index 56707ba..7d83c08 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -181,9 +181,11 @@ def start_qvisqve():
os.mkdir(store)
os.mkdir(os.path.join(store, 'client'))
os.mkdir(os.path.join(store, 'application'))
+ os.mkdir(os.path.join(store, 'user'))
+
+ sh = qvisqve_secrets.SecretHasher()
if V['client_id'] and V['client_secret']:
- sh = qvisqve_secrets.SecretHasher()
client = {
'hashed_secret': sh.hash(V['client_secret']),
'allowed_scopes': V['allowed_scopes'],
@@ -202,6 +204,15 @@ def start_qvisqve():
with open(filename, 'w') as f:
yaml.safe_dump(spec, stream=f)
+ users = V['users']
+ for name in users or []:
+ filename = os.path.join(store, 'user', name)
+ spec = {
+ 'hashed_secret': sh.hash(users[name]),
+ }
+ with open(filename, 'w') as f:
+ yaml.safe_dump(spec, stream=f)
+
config = {
'gunicorn': 'background',
'gunicorn-log': 'gunicorn.log',