aboutsummaryrefslogtreecommitdiffstats
path: root/src/devtools
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-02-15 17:17:37 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2018-02-15 17:23:33 +0100
commitfb444de0bcb53917086c724444d7f8df25e8e806 (patch)
tree47c265199c7a841e4042d89dd54039af39dd5e28 /src/devtools
parent66df82496e8b5cf0e49e8fe4ddd57827bbd0e3c5 (diff)
afb-monitor: Add session and rework permissions
The new verb session is available to get session info and to renew the token. See examples below. The permission required is now just to being check meaning having the token. Example: afb-client-demo -H localhost:5555/api?token=456 monitor session ON-REPLY 1:monitor/session: OK { "response":{ "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938", "token":"", "timeout":32000000, "remain":31999985 }, "jtype":"afb-reply", "request":{ "status":"success", "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938" } } monitor session {"refresh-token":true} ON-REPLY 5:monitor/session: OK { "response":{ "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938", "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc", "timeout":32000000, "remain":32000000 }, "jtype":"afb-reply", "request":{ "status":"success", "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc" } } Change-Id: Ic93bae80616e5dad1640e73ac9f472b7b385104f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/devtools')
-rw-r--r--src/devtools/monitor-api.json55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/devtools/monitor-api.json b/src/devtools/monitor-api.json
index 81d1028a..3c8867cd 100644
--- a/src/devtools/monitor-api.json
+++ b/src/devtools/monitor-api.json
@@ -301,32 +301,13 @@
}
]
}
- },
- "x-permissions": {
- "trace": {
- "permission": "urn:AGL:permission:monitor:public:trace"
- },
- "set": {
- "permission": "urn:AGL:permission:monitor:public:set"
- },
- "get": {
- "permission": "urn:AGL:permission:monitor:public:get"
- },
- "get-or-set": {
- "anyOf": [
- { "$ref": "#/components/x-permissions/get" },
- { "$ref": "#/components/x-permissions/set" }
- ]
- }
}
},
"paths": {
"/get": {
"description": "Get monitoring data.",
"get": {
- "x-permissions": {
- "$ref": "#/components/x-permissions/get-or-set"
- },
+ "x-permissions": { "session": "check" },
"parameters": [
{
"in": "query",
@@ -358,9 +339,7 @@
"/set": {
"description": "Set monitoring actions.",
"get": {
- "x-permissions": {
- "$ref": "#/components/x-permissions/set"
- },
+ "x-permissions": { "session": "check" },
"parameters": [
{
"in": "query",
@@ -386,9 +365,7 @@
"/trace": {
"description": "Set monitoring actions.",
"get": {
- "x-permissions": {
- "$ref": "#/components/x-permissions/trace"
- },
+ "x-permissions": { "session": "check" },
"parameters": [
{
"in": "query",
@@ -416,6 +393,32 @@
}
}
}
+ },
+ "/session": {
+ "description": "describes the session.",
+ "get": {
+ "x-permissions": { "session": "check" },
+ "parameters": [
+ {
+ "in": "query",
+ "name": "refresh-token",
+ "required": false,
+ "schema": { "type": "boolean" }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "A complex object array response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/afb-reply"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}