diff options
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]) |