diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-16 14:49:42 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-16 14:49:42 +0300 |
commit | e4820d5adafffe5f93b28ca02fcb8415c6dc054d (patch) | |
tree | 1fb32880de534d8875553d539ef1c29a97e53f16 /qvisqve | |
parent | a2fa0e9ed35da83e4e6a2c4f5282473d132e1497 (diff) | |
download | qvisqve-e4820d5adafffe5f93b28ca02fcb8415c6dc054d.tar.gz |
Refactor: code create the various routers behind the Qvisqve API
Diffstat (limited to 'qvisqve')
-rw-r--r-- | qvisqve/api.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/qvisqve/api.py b/qvisqve/api.py index a08dd73..d8b3001 100644 --- a/qvisqve/api.py +++ b/qvisqve/api.py @@ -32,20 +32,22 @@ class API: storedir = self._config['store'] baseurl = self._config['token-issuer'] - routers = [ - qvisqve.VersionRouter(), - qvisqve.ManagementRouter(storedir, baseurl), - qvisqve.TokenRouter( - self._create_token_generator(), self._get_clients(), - self._attempts), - qvisqve.LoginRouter(), - qvisqve.AuthRouter( - self._get_applications(), self._get_users(), - self._attempts), - ] - + tg = self._create_token_generator() + clients = self._get_clients() + users = self._get_users() + applications = self._get_applications() + + version = qvisqve.VersionRouter() + mgmt = qvisqve.ManagementRouter(storedir, baseurl) + token = qvisqve.TokenRouter(tg, clients, users, self._attempts) + login = qvisqve.LoginRouter() + auth = qvisqve.AuthRouter(applications, users, self._attempts) + + routers = [version, mgmt, token, login, auth] self._routes = [] for router in routers: + qvisqve.log.log( + 'trace', msg_text='adding routes', router=router) self._routes.extend(router.get_routes()) qvisqve.log.log( |