From 9f8ed7a832c8ed4797d84ef5dc06a152ea815f65 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 16 Apr 2017 10:04:51 +0300 Subject: Add dummy authentication plugin --- distix-backend | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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()]) -- cgit v1.2.1