summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-05-31Add logging by requestJosé Bollo4-3/+75
Change-Id: I6dda714bcb8c36392c14a1981cfb8960f3db45b8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-31fix bad exit status reportJosé Bollo1-1/+0
Change-Id: Ieb3aac9610c3e60702fe709f283f5dc1805623d8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30Make api descriptions uniqueJosé Bollo2-29/+77
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é Bollo9-31/+364
Change-Id: I42265fcee9eae8219ef0cf56d3c8446d2c0fc015 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30fix commentsJosé Bollo2-4/+4
Change-Id: I6a3b2df272a1c88c530fd229ba612ee30160e3cc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30fix bug in hooking verbose callsJosé Bollo1-1/+4
Change-Id: I879d05968521a25cab73f65dad02a52357e62dab Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30Record API names in service descriptorsJosé Bollo4-8/+17
Change-Id: Ie437a6987df7f27a4a68b9c022d8cad8ab4f2cfe Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-30Bindings V1: allows to receive eventJosé Bollo2-5/+7
Don't enforce anymore to have the function 'afbBindingV1ServiceInit' defined when expecting events through 'afbBindingV1ServiceEvent'. This will allow to handle broadcasted events. Change-Id: Ib75904487ad99fdc50813deaf6013f4ba4c47421 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29Moves library resolution on top (hack)José Bollo1-41/+1
Avoid to tune executable byu executable. Should be redefined later. Change-Id: I02e55e642c1797768b7dbcd8406f59199a56891d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29Relax authorisation checlk for selfJosé Bollo4-5/+4
Change-Id: I115bbebb2f51be92578d1cc6b2fb5ae89813b630 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29Add vfail and vsuccess interfacesJosé Bollo5-0/+40
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-29Cleanup legacy internal functionsJosé Bollo3-83/+18
The functions afb_req_raw and afb_req_send are internal. They are now no more visible from bindings. Change-Id: I1f250a1800168a9c3772375477bf37a501f134a0 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29Add 'afb_service_call_sync' functionJosé Bollo6-43/+140
This new function allows to call features for the services synchronously. Also refactoring how are handled arguments to calls. The call to 'json_object_put' is now always done by the binder. Change-Id: I910517da75b179aeafc824da4ce29bc299711990 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-29afb-client-demo add options -H and -rJosé Bollo1-8/+58
The option -H (or --human) allows to output the emited JSON object as pretty formatted for being readable by human. The option -r (--raw) can be used in this case to still continue to print the raw output. Change-Id: I1da531794fb243413741f067cfea79f670c3a626 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-24fix concurrency for afb_msg_json_reply_errorJosé Bollo1-6/+1
Change-Id: I37ab68217c733456810e7e9ceb4e2e6c058f1b5b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-24Handles subcall sync within xreqJosé Bollo4-143/+138
Change-Id: Ieac7c589ddadfb67761332443a3fd92038b6d548 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-22Bindings V2: Remove explicit references to daemon/serviceJosé Bollo12-139/+215
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-19Add json2c for including json in C filesJosé Bollo2-0/+182
Change-Id: I08d8f1c249d5612831fcbc66fe5d0caee4e3a73d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-19Bindings V2: rename init functionsJosé Bollo4-13/+17
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-19Bindings V2: Refactor session flagsJosé Bollo3-18/+46
Change-Id: Idb104b3db69d785b11446fe9b66084839290362f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-19Fix cmake dependencydab_3.99.1dab/3.99.13.99.1Ronan Le Martret1-7/+8
* update documentation (get libmicrohttpd>=0.9.54 from upstream). Change-Id: I361708fecd3b670dba0f32230fa3bcbd86fa9c55 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
2017-05-18Fix a bug in subscribers countingJosé Bollo1-3/+4
To avoid as much as possible allocation/deallocation when possible sequences of subscribe/unsubscribe are encountered, the watch strucutre of events is destroyed only when either the event or the client is destroyed. This commit fixes a bad handling in the count of active subscribers. Change-Id: I3f240e69c3b21356ff07f584fe9bfb578d46732b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-15Fix the timer signal numberJosé Bollo1-1/+1
Change-Id: I2dc7520f41472afefc31be7d3ac1a205611c1828 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-12free SIGALRM for boost timersJosé Bollo2-4/+6
Change-Id: Ib6825c21b6589db6c7e9b8c5a179c347bcc0a93d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11generate skeleton from OpenAPI 3José Bollo4-353/+566
Change-Id: Ia2c9d42a12e9b425d34a3a70ae255d82a9320e8c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11improve logJosé Bollo2-3/+3
Change-Id: I218356c3122179887e8be885affb82cdc6403dbf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11Compiles for cynara if presentJosé Bollo2-8/+31
Change-Id: If8ef53f8a0a57bf6d19b0da3d13a7794a8d0eef9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11implement authorisation checkJosé Bollo4-6/+126
Change-Id: I2ef74b715a115acd11fa13744ba921e875f0bc65 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-11refactor hsrv using jobs queueJosé Bollo1-13/+16
Change-Id: I3d0c70efc2053340fcec93695006e01bb6b49e2c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05remove afb-perm compilerJosé Bollo2-539/+0
Change-Id: Ib35f33440ae7fafe72870ad437d39508aec7894e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05Add default cred to HTTP linkJosé Bollo2-0/+5
Change-Id: Ibb73cebc99094b33b61820482327296049c2026a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05Add user to contextJosé Bollo3-7/+22
At this time, user is the string representation of the uid. Change-Id: I65fbb4112f209fdb948d24e9c47fa73dacdf571f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05Expose session UUID from contextJosé Bollo2-3/+12
Change-Id: Ifcf08e840b4ac92889874700c630495b6dfc3e66 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05Improve includesJosé Bollo2-4/+4
Change-Id: I87278ce38270782e74bd29a7920fe6a6e63eea0d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05make function afb_context_set return a statusJosé Bollo2-5/+3
Change-Id: I5172c58288e5974001f3478f7cee94d7a98abe7d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05Change the effect of close sessionJosé Bollo1-5/+3
Using the flag AFB_SESSION_CLOSE now has effect only on the requesting binding. Before, all the session was closed. This could lead to unexpected conflicts. Change-Id: Ic945e8d164a8558eae05d169b0c5f372b036cf36 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-05session: start to manage concurrencyJosé Bollo4-34/+91
Change-Id: I5895fa14fcb496e71fba600994e7e454cf1d110b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Make LOA local to the bindingJosé Bollo4-40/+20
Change-Id: If0494a19a4ce2865af699491c1f6d7b73bce8f11 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04fix a warningJosé Bollo1-1/+1
Change-Id: Iaebb861a56a490decdca0eada52e26b902457d1d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04add function to get the current LOAJosé Bollo2-0/+6
Change-Id: I0f2a0eae8b4de982549fa4a87e2e0f8150c7d6cc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare permission for binding version 2José Bollo6-263/+10
Change-Id: I38c1291b3c11a9b436d00ef6dab4f7efb86e4996 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare bindings version 2José Bollo13-92/+160
Change-Id: Ic9e417d9a36f5da08883c3ded127d8350ff893cc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Prepare xreq to be aware of the versionJosé Bollo4-35/+18
Change-Id: If8a1ac53e58ff644d7903aebd263d7d42308c756 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-04Eliminate use of AFB_SESSION_CREATEJosé Bollo2-12/+2
AFB_SESSION_CREATE is obsolete since a while. Change-Id: I3dc3eb374f0842d7b210a106b72bce2e4c5c1512 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-26fix a warningJosé Bollo1-1/+1
Change-Id: I9aa2d121771a4a1cca2c4733b3f78ee72db70840 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-26cleanupJosé Bollo1-4/+1
Change-Id: I6296e8d0897e3a1619d1ad832a27dcb9828eae99 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-26Print credential in default request hookJosé Bollo1-1/+11
Change-Id: I67af78d8838de4c5386fd62c8f3b26d1ad8fb338 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-26Use upgrade abitlity of libmicrohttpdJosé Bollo3-25/+45
Since version 0.9.52, libmicrohttpd correctly handles upgrading of connections. Leveraging that feature is a best. Change-Id: Icde686cd9a3c12dda5ee74f354086ccff435796c 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>