From 0dc8b87f5d8a03183c1b947640f6315545e4207b Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 13 Jul 2017 18:47:18 +0200 Subject: Create an auth verb to raise privilege of session Simply raise to a LOA of 1 the current session if asked Need to add some checks to not allow anyone raise its session must hold a specific permission urn:AGL:permission::platform:can:write to be able to authenticate. Change-Id: Id4e01ca20ba8437e97a64db682fdd3ebf45ce7b4 Signed-off-by: Romain Forlot --- low-can-binding/binding/low-can-cb.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'low-can-binding/binding/low-can-cb.cpp') diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index e25d6eae..a7e4396c 100644 --- a/low-can-binding/binding/low-can-cb.cpp +++ b/low-can-binding/binding/low-can-cb.cpp @@ -351,6 +351,12 @@ static void do_subscribe_unsubscribe(struct afb_req request, bool subscribe) afb_req_fail(request, "error", NULL); } +void auth(struct afb_req request) +{ + afb_req_session_set_LOA(request, 1); + afb_req_success(request, NULL, NULL); +} + void subscribe(struct afb_req request) { do_subscribe_unsubscribe(request, true); -- cgit 1.2.3-korg