summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdistix-backend20
1 files changed, 3 insertions, 17 deletions
diff --git a/distix-backend b/distix-backend
index e4ee380..ea621c0 100755
--- a/distix-backend
+++ b/distix-backend
@@ -4,6 +4,7 @@
import os
import random
import sys
+import yaml
import bottle
@@ -11,22 +12,6 @@ import distixapi
-users = {
- 'users': {
- 'fooser': {
- 'salt': 'nacl',
- 'password': distixapi.encrypt_password('nacl', 'password'),
- 'scopes': ['get', 'put'],
- },
- 'no': {
- 'salt': 'nacl',
- 'password': distixapi.encrypt_password('nacl', 'password'),
- 'scopes': [],
- },
- },
-}
-
-
class AuthenticationPlugin(object):
name = 'AuthenticationPlugin'
@@ -56,6 +41,7 @@ def version():
pid_file = sys.argv[1]
port_file = sys.argv[2]
+users_file = sys.argv[3]
@@ -76,5 +62,5 @@ port = random.randint(1025, 32767)
with open(port_file, 'w') as f:
f.write('{}\n'.format(port))
-
+users = yaml.safe_load(open(users_file))
bottle.run(port=port, quiet=True, plugins=[AuthenticationPlugin()])