summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-04-16 10:04:51 +0300
committerLars Wirzenius <liw@liw.fi>2017-04-16 10:04:51 +0300
commit9f8ed7a832c8ed4797d84ef5dc06a152ea815f65 (patch)
treee8144f0b7ddb9ce6064e68c70af94523dee174af
parent629703019d975021a5f75ddd45d38fdbe1a991a2 (diff)
downloaddistixapi-9f8ed7a832c8ed4797d84ef5dc06a152ea815f65.tar.gz
Add dummy authentication plugin
-rwxr-xr-xdistix-backend12
1 files changed, 11 insertions, 1 deletions
diff --git a/distix-backend b/distix-backend
index 559ff9d..8259c30 100755
--- a/distix-backend
+++ b/distix-backend
@@ -8,6 +8,16 @@ import sys
import bottle
+
+class AuthenticationPlugin(object):
+
+ name = 'AuthenticationPlugin'
+
+ def apply(self, callback, route):
+ log('AuthenticationPlugin called on {}'.format(route['rule']))
+ return callback
+
+
@bottle.route('/')
def root():
return 'This is the root'
@@ -42,4 +52,4 @@ with open(port_file, 'w') as f:
f.write('{}\n'.format(port))
-bottle.run(port=port, quiet=True)
+bottle.run(port=port, quiet=True, plugins=[AuthenticationPlugin()])