From 8cfe621c69abab445c370b22435f9c800159a029 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 13 Oct 2017 13:50:29 +0300 Subject: Change: make create-token be more easily useable --- create-token | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'create-token') diff --git a/create-token b/create-token index bbcee42..a99b611 100755 --- a/create-token +++ b/create-token @@ -23,20 +23,23 @@ import Crypto.PublicKey.RSA import apifw -filename = sys.argv[1] -iss = sys.argv[2] -aud = sys.argv[3] -scopes = ' '.join(sys.argv[4].split()) +# FIXME: These should agree with how ick controller is configured. +# See the Ansible playbook. +iss = 'localhost' +aud = 'localhost' -key_text = open(filename, 'r').read() + +key_text = sys.stdin.read() key = Crypto.PublicKey.RSA.importKey(key_text) +scopes = ' '.join(sys.argv[1].split()) + now = time.time() claims = { 'iss': iss, 'sub': 'subject-uuid', 'aud': aud, - 'exp': now + 3600, + 'exp': now + 86400, # FIXME: This is silly long 'scope': scopes, } -- cgit v1.2.1