diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-04-16 10:04:51 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-04-16 10:04:51 +0300 |
commit | 9f8ed7a832c8ed4797d84ef5dc06a152ea815f65 (patch) | |
tree | e8144f0b7ddb9ce6064e68c70af94523dee174af | |
parent | 629703019d975021a5f75ddd45d38fdbe1a991a2 (diff) | |
download | distixapi-9f8ed7a832c8ed4797d84ef5dc06a152ea815f65.tar.gz |
Add dummy authentication plugin
-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()]) |