aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-api-so-v2.c
AgeCommit message (Collapse)AuthorFilesLines
2019-12-02afb-auth: Increase and improve use of afb-authJose Bollo1-1/+1
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-04-02Add conditionnal support of dynamic bindingsJose Bollo1-1/+1
The load of dynamic bindings becomes removable. This is a step in direction of a tiny binder library. Also refactor AGL_DEVEL Signed-off-by: Jose Bollo <jose.bollo@iot.bzh> Change-Id: If283f431fd8a831429e717b2770464cb54476dc7
2019-04-02Add conditionnal support of bindings version 2Jose Bollo1-0/+3
Bindings version 2 will become legacy soon. This patch allows their removal Change-Id: Iecad3abd0ddd714e5d55c0b935be756a29d1ca37 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-08-02afb-export: Manage path of librariesJosé Bollo1-3/+9
This change allows a binding to know its installation path. This path is retrieved using the api function 'afb_api_settings'. The path is returned --if known-- as a string of key "binding-path". Change-Id: Ie1a349dc4936d4ccf173f1f77e118099f7f0599a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-02Improve parsing of json stringJose Bollo1-3/+3
Change-Id: I7100961ef8f8a75d623a0667178f191dd4cfb9d3 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-13afb-api-so-v2: Monitor the preinit to catch SEGVJosé Bollo1-1/+24
Add monitoring of preinitialisation of bindings v2 in the hope to better handle arbitrary code execution. Change-Id: I86354caedb17ef9d4904c1f4f47b1ea3c6dd4c40 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-15api-v3: First draftJosé Bollo1-92/+33
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>
2018-01-31afb-api: Enforce api names to be hookableJosé Bollo1-1/+1
Change-Id: Ic1d5cb208c636d3261e1a96c4a81b488cb84a60e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Provide API and VERB name of requestsJosé Bollo1-1/+2
Change-Id: I9a86c6314f871334231e50f9cea60b54aed434b9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-export: record apiset at creationJosé Bollo1-1/+1
Change-Id: I058eaee990e34990d0860a316ba8c348c23eff5f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-auth: Move json serialisation of afb_authJosé Bollo1-76/+3
Change-Id: Ifa50d1b7aa8d900cd6786f6950e0a738301d6c92 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-api: Define the notion of group for concurrencyJosé Bollo1-1/+1
Change-Id: Iafbbff8387bb1f8577cb7aeb6e8ed4b14ab1f4a4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Refactor of starting apisJosé Bollo1-47/+2
Change-Id: Ib2efcd8747c3537714dfa7058bb0623d6e283c3d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09minor cleanupJosé Bollo1-1/+0
Change-Id: I32d44b1150814d8f80d5db44a5730c87606c054b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-export: refactor of binder interfaceJosé Bollo1-47/+35
The interfaces of the binder called afb_ditf and afb_svc are merged together to create the afb_export structure. Change-Id: I841ba04d7b2f94bfc19f691ec746d0bd221f164d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-api-so-v2: improve generation of descriptionJosé Bollo1-3/+30
Change-Id: Ibe8fbbec59cc8db35c635346f0d441f0140eced5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-07Allow renaming of APIJosé Bollo1-11/+11
The function afb_daemon_rename_api allows to rename an API during the preinit phase. Change-Id: I35477ba99d35b1dc51a7cacf8e55c3f02d86d7b4 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-07afb-ditf: track daemon stateJosé Bollo1-3/+5
Change-Id: Ic21c79dcd9908919a1a8d13e8747ef0bd2490477 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31Make noconcurrency more efficientJosé Bollo1-35/+2
The previous handling of noconcurrency suffered of inefficiency, was complicated and dedicated to api-so-v2. Change-Id: I32aea9187663ac533819496e9dc9b944db0d89ec Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31afb-svc: make service existing during its initialisationJosé Bollo1-1/+13
The initialisation of services is splitted in two parts: - the creation and allocation of the structure for the service. - the initialisation once the structure is ready and recorded. Change-Id: I05c89fb513869d45e6b8413699fba234f00ce6b1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-06-28Bindings V2: reintroduce field 'info' for verbsJosé Bollo1-1/+2
CAUTION, this breaks binary compatibility Change-Id: I67acfffe1f04cdddee0ad1230b227b080da1ab06 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30Make api descriptions uniqueJosé Bollo1-2/+2
Before this commit, the bindings version 1 were described differently from the bindings version 2. They now all describes themselves equally using openAPI 3. Change-Id: I73c2017d0bcbf3c3b01db0c58b03e328e4f44fda Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30Adds hooks for service (svc)José Bollo1-0/+2
Change-Id: I42265fcee9eae8219ef0cf56d3c8446d2c0fc015 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30Record API names in service descriptorsJosé Bollo1-1/+1
Change-Id: Ie437a6987df7f27a4a68b9c022d8cad8ab4f2cfe Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29Add vfail and vsuccess interfacesJosé Bollo1-0/+1
This now factorizes code needed to asprintf the arguments in an allocated string. But the most interesting effect is the ability to handle va_list of arguments. It can be used for library of tools. Change-Id: I4ba74c9984786f07abe0c7e53d7ef79dca863735 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-22Bindings V2: Remove explicit references to daemon/serviceJosé Bollo1-25/+118
Usage shown that managing daemon interface and service interface wasn't obvious. This evolution hides the complexity by setting up an internal hidden variable. Change-Id: I667b1ee4e3a7b5ad29d712ee20ad5dd1878b97f3 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-19Bindings V2: rename init functionsJosé Bollo1-5/+5
The new naming is closer to the functionnal design and closer to V1 names. Change-Id: I8970338056a30564b84eaa1a7da6df3a9e6aa579 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-19bindings v2: Enforce to explicitely ask for concurrencyJosé Bollo1-1/+35
Change-Id: Ic20d1eb1c8515cd86444ad62b0daacbcd75e9b7e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11improve logJosé Bollo1-1/+1
Change-Id: I218356c3122179887e8be885affb82cdc6403dbf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare permission for binding version 2José Bollo1-66/+8
Change-Id: I38c1291b3c11a9b436d00ef6dab4f7efb86e4996 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare bindings version 2José Bollo1-11/+21
Change-Id: Ic9e417d9a36f5da08883c3ded127d8350ff893cc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare xreq to be aware of the versionJosé Bollo1-5/+1
Change-Id: If8a1ac53e58ff644d7903aebd263d7d42308c756 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-26Sort verbs and compute their permissionsJosé Bollo1-7/+68
For the version 2, the verbs are alphabetically sorted and the permissions are computed for further evaluation. Change-Id: I10b50f841c920e9912bf734238f35e52aecedcc1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-25Make monitor use the interface version 2José Bollo1-4/+13
Enforce monitor API to be a kind of standard binding. Change-Id: I4739f879d5e076eb3505f5fe2cf658e6f9299de6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-21afb-api-so-v2: split the declaration in two partsJosé Bollo1-31/+43
Having a part not linked to an existing opened shared library might be useful for internal APIS. Change-Id: I56348f07c87f6844682e3ea56dc07d7ee296bfbf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-20cleanup and improvement of xreqJosé Bollo1-2/+3
Change-Id: Iefda7f9d8f979a50fb2586a27edf0ca16d056a1f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-13Introduce apiset for grouping apisJosé Bollo1-7/+8
This will be used at the end for debugging facilities. Change-Id: I75e3345667e1f58143c77a885e166375680ca194 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-10Refactor of API interfacesJosé Bollo1-3/+21
The new interface has increased functionnality, it allows to set debug flags by API. Change-Id: Ibd35fb02ed645e22cac8e7021b37b96e07e79877 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-07Add hooking of daemon interfaceJosé Bollo1-4/+12
Change-Id: I5840609f4300ade98412e8527ac5ce1f1e8c0c59 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-05Make daemon interface commonJosé Bollo1-84/+5
For the future, having only one piece of code to handle daemon interface to bindings is an improvement. Change-Id: I806c424eb1a82637d27bc84b921612789907d971 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-04Ensure that subcall_sync use subcallJosé Bollo1-6/+2
The intent is to provide the asynchronous subcall as standard. This is needed for fixing subcall across connections (DBus or WebSocket). Change-Id: Ia046cfa4d0124bfa3ba7eb8e8f936eeafcf09875 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-04Launch job at a earlier stepJosé Bollo1-1/+0
Change-Id: I3fcb96e4d748e38eacc4d413a451143dd9b4a10d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-04Definitive switch to internal's xreqJosé Bollo1-63/+1
This switch allows to work on a common base for the requests. Change-Id: I94e7fdda80c1966af399309334c41c7c8c8259dc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-31Factorize common code for handling requestsJosé Bollo1-7/+34
The common code for session handling is shared using struct afb_xreq. At the moment only hreq leverages the new feature. The objective is double: make the work of writing new internal requests more easy and prepare to check permissions. Change-Id: If3ca311d68c2d8c427d1125f31a2704b150c2c94 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-30Start to implement the bindings V2José Bollo1-0/+306
More work has to be done for merging common code. Change-Id: I72b01901f978854843967c12bfcb3cc59cc10310 Signed-off-by: José Bollo <jose.bollo@iot.bzh>