summaryrefslogtreecommitdiff
path: root/yarns/900-local.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-05 12:57:22 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-05 12:57:22 +0100
commit89cc8f3239f824755d9d19b3b5877ff62900b787 (patch)
tree846ebdd4ead54782034c5576c06924c58e953706 /yarns/900-local.yarn
parent9eed0d65ba6ff39aa41a0bfbc3926605416b2dfe (diff)
downloadick2-89cc8f3239f824755d9d19b3b5877ff62900b787.tar.gz
Refactor: change token generation to name the user
Diffstat (limited to 'yarns/900-local.yarn')
-rw-r--r--yarns/900-local.yarn15
1 files changed, 1 insertions, 14 deletions
diff --git a/yarns/900-local.yarn b/yarns/900-local.yarn
index 43f710c..409a8e6 100644
--- a/yarns/900-local.yarn
+++ b/yarns/900-local.yarn
@@ -28,18 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
]
cliapp.runcmd(argv, stdout=None, stderr=None)
- IMPLEMENTS GIVEN an access token for scopes (.+)
- scopes = get_next_match()
- key = open('token.key').read()
- argv = [
- os.path.join(srcdir, 'create-token'),
- scopes,
- ]
- token = cliapp.runcmd(argv, feed_stdin=key)
- write('token.jwt', token)
- vars['issuer'] = 'localhost'
- vars['audience'] = 'localhost'
-
IMPLEMENTS GIVEN an access token for (\S+) with scopes (.+)
user = get_next_match()
scopes = get_next_match()
@@ -49,8 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
scopes,
]
token = cliapp.runcmd(argv, feed_stdin=key)
- filename = '{}.jwt'.format(user)
- write(filename, token)
+ store_token(user, token)
vars['issuer'] = 'localhost'
vars['audience'] = 'localhost'