diff options
Diffstat (limited to 'distix-backend')
-rwxr-xr-x | distix-backend | 12 |
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()]) |