From af3718de31d77399b4b2bce4d5ac0bca59b71312 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 4 Aug 2018 08:57:30 +0300 Subject: Change: NEWS, qvisqvetool --- NEWS | 4 ++++ qvisqvetool | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 129e92f..cdade77 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,10 @@ Version 0.9+git, not yet released * Disable gunicorn header size check. +* Qvisqve can now manage clients, users, applications via the API. + There is a command line tool, `qvisqvetool`, for doing that from the + command line. + Version 0.9, released 2018-02-09 --------------------------------- 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]) -- cgit v1.2.1