summaryrefslogtreecommitdiff
path: root/ick2/controllerapi.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-07-21 11:45:29 +0300
committerLars Wirzenius <liw@liw.fi>2019-08-03 21:06:50 +0300
commit7a6bc2f7749c10c1d3344ea0196e81ae95b7f0d7 (patch)
treee52472ac9665bc21886ccf27b7a79e76079d6afe /ick2/controllerapi.py
parent4f2207571928dc685102e3b3ff55e79cd3d46b6d (diff)
downloadick2-7a6bc2f7749c10c1d3344ea0196e81ae95b7f0d7.tar.gz
Add: TokenGetter
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r--ick2/controllerapi.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py
index b28e1f7..a673e0d 100644
--- a/ick2/controllerapi.py
+++ b/ick2/controllerapi.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2017-2018 Lars Wirzenius
+# Copyright (C) 2017-2019 Lars Wirzenius
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@@ -18,8 +18,9 @@ import ick2
class ControllerAPI:
- def __init__(self, state):
+ def __init__(self, state, token_getter):
self._state = state
+ self._token_getter = token_getter
self._apis = {}
def set_apt_server(self, domain): # pragma: no cover
@@ -30,6 +31,7 @@ class ControllerAPI:
def set_auth_url(self, url): # pragma: no cover
self._set_url('set_auth_url', url)
+ self._token_getter.set_auth_url(url)
def set_notify_url(self, url): # pragma: no cover
self._set_url('set_notify_url', url)
@@ -60,7 +62,9 @@ class ControllerAPI:
for path in apis:
if path not in self._apis:
- self._apis[path] = apis[path](self._state)
+ api = apis[path](self._state)
+ api.set_token_getter(self._token_getter)
+ self._apis[path] = api
routes = []
for path, api in self._apis.items():