aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-api-ws.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-12 17:56:20 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-12 17:56:20 +0200
commita138fda9841c46e28de93e32aee62956e26556b1 (patch)
treeebb792f5d289f4a027a29b5fb573807ab2240327 /src/afb-api-ws.c
parent09010fa0093bee944738b728bf3277961d9bd6d7 (diff)
Add credential data to xreq
This will allow soon to check the credentials when evaluating calls. Change-Id: I993216ccbc02538dcd92e49fcb2de0541eeb8c01 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-api-ws.c')
-rw-r--r--src/afb-api-ws.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/afb-api-ws.c b/src/afb-api-ws.c
index 472a44d4..3e0b281c 100644
--- a/src/afb-api-ws.c
+++ b/src/afb-api-ws.c
@@ -949,6 +949,7 @@ static void api_ws_server_called(struct api_ws_client *client, struct readbuf *r
wreq->xreq.context.flags = flags;
/* makes the call */
+ wreq->xreq.cred = afb_cred_addref(client->cred);
wreq->xreq.api = client->api;
wreq->xreq.verb = verb;
afb_apis_call(&wreq->xreq);
@@ -1074,6 +1075,7 @@ static void api_ws_server_req_destroy_cb(struct afb_xreq *xreq)
struct api_ws_server_req *wreq = CONTAINER_OF_XREQ(struct api_ws_server_req, xreq);
afb_context_disconnect(&wreq->xreq.context);
+ afb_cred_unref(wreq->xreq.cred);
json_object_put(wreq->xreq.json);
free(wreq->rcvdata);
api_ws_server_client_unref(wreq->client);