aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-auth.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-08Update copyright datesJosé Bollo1-1/+1
Signed-off-by: José Bollo <jose.bollo@iot.bzh> Change-Id: I01a566a693b8ec6239209c9323ae4ff15a07f737
2019-12-03afb-context: Move credentials to contextJosé Bollo1-17/+12
The split between context and credentials in requests was somehow artificial and awkward. This change move the credentials to the context and removes as many references to credentials as possible in favor of working on contexts. Change the value returned by afb_auth_check to be 1 if validated, 0 or less than zero if not validated. Bug-AGL: SPEC-2968 Signed-off-by: José Bollo <jose.bollo@iot.bzh> Change-Id: I979dc841e03247e126e3fa8433a1cc0d4108adf0
2019-12-02afb-auth: Increase and improve use of afb-authJose Bollo1-1/+79
This change factorize code for version V1 of bindings and centralizes management of authorisations in a single place. Bug-AGL: SPEC-2968 Change-Id: I6ad95d5bfa0d85dbb6d2060fc9ebca08b68eb4e9 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2019-11-29Use afb_token in contextsJose Bollo1-1/+1
Tokens are now object used in the context. Bug-AGL: SPEC-2968 Change-Id: I107d31732202b7b1172afaf09f3a52470f050d7c Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2019-02-06Update copyright datehalibut_7.90.0halibut/7.90.07.90.0José Bollo1-1/+1
Change-Id: I3aaa92b2bfb01699ee8ae609272e93032b6f1a9d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-15api-v3: First draftJosé Bollo1-53/+7
This commit introduces the bindings v3 API for bindings. The documentation has still to be improved and will come very soon. Change-Id: I8f9007370e29f671fdfd1da87fff7372a17db7af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-27Update date of copyright noticesJosé Bollo1-1/+1
Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-auth: Move json serialisation of afb_authJosé Bollo1-0/+89
Change-Id: Ifa50d1b7aa8d900cd6786f6950e0a738301d6c92 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07Improve handling of verbosity in bindingsJosé Bollo1-1/+0
The macro AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO is removed. The macro AFB_BINDING_PRAGMA_NO_VERBOSE_UNPREFIX is removed. The macro AFB_BINDING_PRAGMA_KEEP_VERBOSE_UNPREFIX is now used to activate the weakly named verbose macros DEBUG, INFO, NOTICE, WARNING, ERROR. The macros AFB_BINDING_PRAGMA_NO_VERBOSE_DATA and AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS can be used to tune what verbose parts are to be emitted: If AFB_BINDING_PRAGMA_NO_VERBOSE_DATA is defined then the macro will only report the file and the line that emitted the message. This mode is intended to reduce the count of static data plugin the binary. If AFB_BINDING_PRAGMA_NO_VERBOSE_DATA is not defined and AFB_BINDING_PRAGMA_NO_VERBOSE_DETAILS is defined, this is the opposite: the messages are emitted but not the file, line and function. When none of these 2 are difened, everything is emitted: the message and the details. Change-Id: Ibb83cd435797fadf90626cb06bbda77f0f8b3cde Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07Implement afb_req_has_permissionJosé Bollo1-3/+3
This new verb is available in bindings to check whether the client identified by a request has a given permission or not. Change-Id: I5eaa0892d8260d26bd76f37123251c103c981e10 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-auth: improve afb_auth_check_permissionJosé Bollo1-6/+12
The test was previously done in the caller but because afb_auth_check_permission can now be called by other callers, the test must be relocated. Change-Id: I08a3a92afbe0b4dcfb223335b1e76b2d4aff005f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-auth: export method to check a single permissionJosé Bollo1-5/+3
Change-Id: I45c4872f34ff8f25c14872d7b3610fa15f48062e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07afb-auth: revert order of arguments (minor)José Bollo1-8/+8
Change-Id: I29140a3c047799ee600051fb62998e7bb73d45f5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29Relax authorisation checlk for selfJosé Bollo1-1/+4
Change-Id: I115bbebb2f51be92578d1cc6b2fb5ae89813b630 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11Compiles for cynara if presentJosé Bollo1-7/+23
Change-Id: If8ef53f8a0a57bf6d19b0da3d13a7794a8d0eef9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11implement authorisation checkJosé Bollo1-0/+89
Change-Id: I2ef74b715a115acd11fa13744ba921e875f0bc65 Signed-off-by: José Bollo <jose.bollo@iot.bzh>