summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-08-04 08:57:30 +0300
committerLars Wirzenius <liw@liw.fi>2018-08-04 08:57:30 +0300
commitaf3718de31d77399b4b2bce4d5ac0bca59b71312 (patch)
tree82586c546bb13fbe453f4e3ab76535cc7ca543c0
parenta2bd5bca4c60499b3f9a2b99ec0dd0645bc718fe (diff)
downloadqvisqve-af3718de31d77399b4b2bce4d5ac0bca59b71312.tar.gz
Change: NEWS, qvisqvetool
-rw-r--r--NEWS4
-rwxr-xr-xqvisqvetool17
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])