summaryrefslogtreecommitdiff
path: root/yarns/900-remote.yarn
diff options
context:
space:
mode:
Diffstat (limited to 'yarns/900-remote.yarn')
-rw-r--r--yarns/900-remote.yarn23
1 files changed, 7 insertions, 16 deletions
diff --git a/yarns/900-remote.yarn b/yarns/900-remote.yarn
index 6cc7f88..5e84c13 100644
--- a/yarns/900-remote.yarn
+++ b/yarns/900-remote.yarn
@@ -1,6 +1,6 @@
<!--
-Copyright 2017 Lars Wirzenius
+Copyright 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
@@ -21,22 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
## Authentication setup
- IMPLEMENTS GIVEN an RSA key pair for token signing
- V['private_key_file'] = os.environ['ICK_PRIVATE_KEY']
- assertTrue(os.path.exists(V['private_key_file']))
-
IMPLEMENTS GIVEN an access token for (\S+) with scopes (.+)
user = get_next_match()
- scopes = get_next_match()
- key = open(V['private_key_file']).read()
- argv = [
- os.path.join(srcdir, 'create-token'),
- scopes,
- ]
- token = cliapp.runcmd(argv, feed_stdin=key)
+ scopes = get_next_match().split()
+ create_api_client(user, scopes)
+ token = get_api_token(user, scopes)
store_token(user, token)
- V['issuer'] = 'localhost'
- V['audience'] = 'localhost'
## Controller configuration
@@ -46,13 +36,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
## Start and stop the controller
IMPLEMENTS GIVEN a running ick controller
- V['url'] = os.environ['ICK_URL']
+ V['url'] = os.environ['CONTROLLER']
IMPLEMENTS WHEN user stops ick controller
pass
IMPLEMENTS FINALLY stop ick controller
- pass
+ for client_id in get_client_ids():
+ delete_api_client(client_id)
## Controller state inspection