diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-04 08:57:30 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-04 08:57:30 +0300 |
commit | af3718de31d77399b4b2bce4d5ac0bca59b71312 (patch) | |
tree | 82586c546bb13fbe453f4e3ab76535cc7ca543c0 /qvisqvetool | |
parent | a2bd5bca4c60499b3f9a2b99ec0dd0645bc718fe (diff) | |
download | qvisqve-af3718de31d77399b4b2bce4d5ac0bca59b71312.tar.gz |
Change: NEWS, qvisqvetool
Diffstat (limited to 'qvisqvetool')
-rwxr-xr-x | qvisqvetool | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/qvisqvetool b/qvisqvetool index bfd92fe..da5aab0 100755 --- a/qvisqvetool +++ b/qvisqvetool @@ -138,14 +138,14 @@ class QvisqveTool(cliapp.Application): def cmd_set_secret(self, args): kind, name, secret = args - kind = kinds.get(kind, kind) + path = paths[kind] api, token = self.get_api() secret = { 'secret': secret, } - path = '/{}/{}/secret'.format(kind, name) + path = '{}/{}/secret'.format(path, name) api.PUT(token, path, json.dumps(secret), json_content_type) self.output.write('Set secret for {}\n'.format(name)) @@ -161,6 +161,19 @@ class QvisqveTool(cliapp.Application): app['callbacks'] = app.get('callbacks', []) + [callback] api.PUT(token, path, json.dumps(app), json_content_type) + def cmd_allow_scope(self, args): + kind = args[0] + name = args[1] + scopes = args[2:] + + api, token = self.get_api() + + path = '{}/{}'.format(paths[kind], name) + r = api.GET(token, path) + entity = r.json() + entity['allowed_scopes'] = entity.get('allowed_scopes', []) + scopes + api.PUT(token, path, json.dumps(entity), json_content_type) + def cmd_GET(self, args): api, token = self.get_api() r = api.GET(token, args[0]) |