From e213b794bfa6bc04679e0c99b3f495995b6c0520 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 5 Nov 2017 12:20:01 +0100 Subject: Add: implement getting access token for named user --- yarns/900-local.yarn | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'yarns') diff --git a/yarns/900-local.yarn b/yarns/900-local.yarn index 18bf056..43f710c 100644 --- a/yarns/900-local.yarn +++ b/yarns/900-local.yarn @@ -41,7 +41,18 @@ along with this program. If not, see . vars['audience'] = 'localhost' IMPLEMENTS GIVEN an access token for (\S+) with scopes (.+) - assert 0 + user = get_next_match() + scopes = get_next_match() + key = open('token.key').read() + argv = [ + os.path.join(srcdir, 'create-token'), + scopes, + ] + token = cliapp.runcmd(argv, feed_stdin=key) + filename = '{}.jwt'.format(user) + write(filename, token) + vars['issuer'] = 'localhost' + vars['audience'] = 'localhost' ## Controller configuration -- cgit v1.2.1