src/app-framework-binder.git
5 years agomain-afb-client-demo: Allow scripting 21/14621/1
José Bollo [Fri, 22 Jun 2018 16:25:25 +0000 (18:25 +0200)]
main-afb-client-demo: Allow scripting

This version allows to pipe from a script shell.

Change-Id: Ia2bb3e059b8a5a1b097178d2883ef385e7efcdca
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-autoset: Automatic prefix with unix: 19/14619/1
José Bollo [Fri, 22 Jun 2018 16:24:46 +0000 (18:24 +0200)]
afb-autoset: Automatic prefix with unix:

Change-Id: I325d768b3bdfcb313b57e1752cbc156b3735b55a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-v3: Refactor verb description 17/14617/1
José Bollo [Fri, 22 Jun 2018 16:20:35 +0000 (18:20 +0200)]
afb-api-v3: Refactor verb description

Change-Id: Iaa1719ee2891d470f8229c6f1b98dd34265593a6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-api-so: accept symbolic links for bindings 15/14615/1
José Bollo [Fri, 22 Jun 2018 16:18:31 +0000 (18:18 +0200)]
afb-api-so: accept symbolic links for bindings

Change-Id: I1ef90b0f889767d04f84c8c7eb27d19c04390b15
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agohello3: Add verbs 13/14613/1
José Bollo [Fri, 22 Jun 2018 16:00:44 +0000 (18:00 +0200)]
hello3: Add verbs

Add the following verb for testing purpose:

 - close:    close the session
 - set-loa:  set the LOA of the session
 - setctx:   set the contextual data of a session
 - setctxif: set the contextual data of a session if not already set
 - getctx:   get the contextual data of a session
 - info:     returns the info of the session

Change-Id: Ie2ceb897ecdff01f6efd0a3b174b5794913726d9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoapi-v3: Add monitoring of faults in preinit functions 11/14611/1
José Bollo [Fri, 22 Jun 2018 12:05:28 +0000 (14:05 +0200)]
api-v3: Add monitoring of faults in preinit functions

Change-Id: I0abea1aa62d86372f07f61b7c5dc2e854137f99a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-client-demo: Add option to keep running 09/14609/1
José Bollo [Fri, 22 Jun 2018 12:00:43 +0000 (14:00 +0200)]
afb-client-demo: Add option to keep running

This option allows to keep the client running
even when its input is closed. This will be used for
tests and for reporting because it allows to write:

  echo 'monitor trace {"add":{"api":"*","request":"*","event":"*","session":"*","global":"*"}}' |
  afb-client -k $WSURL > logfile

to capture all events.

Change-Id: If1c7804556190fd8ec9388260fe014c50b498b1d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoImprove documentation of api v3 89/14589/3
José Bollo [Tue, 19 Jun 2018 18:16:28 +0000 (20:16 +0200)]
Improve documentation of api v3

The documentation is improved to reflect the new version.

Tune the options

Change-Id: I894c3db3bc0c10e89db66a9a51a9ad049bb8c0c4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agopackaging: Add V3 demo files 55/14555/1
Ronan Le Martret [Wed, 20 Jun 2018 13:06:00 +0000 (15:06 +0200)]
packaging: Add V3 demo files

Change-Id: Ia9b047bf01543f7cc1c794d91bf479d9848509d3
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
5 years agopackaging: Update spec and deb packaging 43/14543/1
Ronan Le Martret [Mon, 14 May 2018 16:21:23 +0000 (18:21 +0200)]
packaging: Update spec and deb packaging

 - sort files by packaging type

Change-Id: Ic914b5eedffce04356bb59db36be30ba81a8a20d
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
5 years agoFix a warning in using readlink 37/14537/1
José Bollo [Tue, 19 Jun 2018 16:27:36 +0000 (18:27 +0200)]
Fix a warning in using readlink

The use of the same buffer as input and output of readlink
leads to warnings due to restrict use in new versions of
GLIBC

Change-Id: Ifbf1277b88bd18a9df1e18211d4248e94c16d6da
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix warnings due to json-c evolution 35/14535/1
José Bollo [Tue, 19 Jun 2018 16:25:34 +0000 (18:25 +0200)]
Fix warnings due to json-c evolution

The library json-c now returns size_t instead of
int when querying length of arrays.

Change-Id: Id52bb8e77da12cb01e61e1a7c7f4ae2fcbe4634e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hsrv: Add processing of type application/json 95/14495/2
jobol [Mon, 18 Jun 2018 11:10:45 +0000 (13:10 +0200)]
afb-hsrv: Add processing of type application/json

Makes the data posted as application/json directly
available through json.

The previous processing made content transmitted
with the content-type application/json available as
a string in the field of name "" of the returned
json object.

Change-Id: I11615b9b147ee4daa1b1358c2bd36fd839d8a7a9
Signed-off-by: jobol <jose.bollo@iot.bzh>
5 years agoapi-v3: First draft 63/14363/3
José Bollo [Mon, 9 Apr 2018 16:16:07 +0000 (18:16 +0200)]
api-v3: First draft

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>
5 years agojobs: Switch back to sd_event 61/14361/1
jobol [Mon, 11 Jun 2018 14:54:37 +0000 (16:54 +0200)]
jobs: Switch back to sd_event

Change-Id: I8c9de83d857844b1c5d0d2d26385dbf19fcae228
Signed-off-by: jobol <jose.bollo@iot.bzh>
5 years agoafb-trace: Restore microsecond time 59/14359/1
José Bollo [Fri, 18 May 2018 23:45:36 +0000 (01:45 +0200)]
afb-trace: Restore microsecond time

This allow to use accurately float 64 bits for times
from 1970 to 2112.

Change-Id: I8f57a57edbf5469f827c0eeb80191de934d9841e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agogitignore: Ignore netbean files from nbproject/ 57/14357/1
José Bollo [Thu, 17 May 2018 09:55:29 +0000 (11:55 +0200)]
gitignore: Ignore netbean files from nbproject/

Change-Id: Ic89f9dde8111a20e8dfc5f536ec0e731b2b49df7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFixed spelling 55/14355/1
Sebastien Douheret [Fri, 1 Jun 2018 13:00:15 +0000 (15:00 +0200)]
Fixed spelling

Change-Id: Id7c183face3179a3b9cec7ed128e3a2561d9f3ad
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agoafb-client-demo: real raw output when --raw is set 53/14353/1
Sebastien Douheret [Fri, 1 Jun 2018 12:45:41 +0000 (14:45 +0200)]
afb-client-demo: real raw output when --raw is set

Having a 'real' raw output allows to pipe output with useful tools like jq.
For example:
 afb-client-demo 'localhost:5555/api?token=HELLO&uuid=c' hello ping | \
 jq .request.status

Change-Id: Ib871a257375bec26f315cdcdbb590033b645ac9d
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agoafb-client-demo: improved usage message 51/14351/1
Sebastien Douheret [Fri, 1 Jun 2018 12:38:11 +0000 (14:38 +0200)]
afb-client-demo: improved usage message

Change-Id: Ia529be2bf17d9bce3adfc5cb052afd724ae7bbdf
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agonetbean: update netbean config 49/14349/1
José Bollo [Thu, 17 May 2018 09:55:29 +0000 (11:55 +0200)]
netbean: update netbean config

Change-Id: I3c5e0e875cc5f16c8d366694b4a131768ab8ccd8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-client-demo: Add option -e/--echo 47/14347/1
José Bollo [Thu, 17 May 2018 09:44:09 +0000 (11:44 +0200)]
afb-client-demo: Add option -e/--echo

This option prints the command sent in the same way that it prints
the received actions.

Change-Id: I55d74f7b8645185f93e3b163cb772c8eb515fad0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agowrap-json: Update and fixes for y/Y 45/14345/1
José Bollo [Tue, 15 May 2018 07:20:44 +0000 (09:20 +0200)]
wrap-json: Update and fixes for y/Y

Change-Id: I9026f3498a4860851a41a0d5d56d1880ece75306
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook: Factorize call to pattern matching 43/14343/1
José Bollo [Fri, 4 May 2018 10:12:30 +0000 (12:12 +0200)]
afb-hook: Factorize call to pattern matching

The pattern matching actually use fnmatch but this
could be changed in the futur to some lighter version.

Change-Id: I4f3617cd4a5bdf95988428cb184cef9e9543771d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-apiset: manage deletion of apis 41/14341/1
José Bollo [Fri, 27 Apr 2018 13:55:43 +0000 (15:55 +0200)]
afb-apiset: manage deletion of apis

Change-Id: If8b4a2b8773e5e7ce3ae62839193c611eefcb811
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook: Refactor timestamps of hooks and trace 39/14339/1
José Bollo [Wed, 25 Apr 2018 14:48:58 +0000 (16:48 +0200)]
afb-hook: Refactor timestamps of hooks and trace

Change-Id: Iebcab280123d1f954eda3b1260d0b984ae3a98b5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Fix minor errors 37/14337/1
José Bollo [Wed, 18 Apr 2018 15:07:48 +0000 (17:07 +0200)]
jobs: Fix minor errors

Change-Id: I78aeb16fb1cf5b029fb24704d16c42152f9cc909
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years ago.gitignore: Ignore KDevelop files 35/14335/1
José Bollo [Tue, 17 Apr 2018 07:42:15 +0000 (09:42 +0200)]
.gitignore: Ignore KDevelop files

Change-Id: I832f09f44f00152bf2f1bbfc1f82bc4b7c9585e7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agowrap-json: Sync with app-afb-helpers-submodule 33/14333/1
José Bollo [Fri, 13 Apr 2018 07:53:26 +0000 (09:53 +0200)]
wrap-json: Sync with app-afb-helpers-submodule

Change-Id: Idc3360e7b96d5d9dd3fbb39ef97b3dc5d50c54bb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agowrap-json: Add base64 byte buffer support 31/14331/1
José Bollo [Thu, 12 Apr 2018 09:25:02 +0000 (11:25 +0200)]
wrap-json: Add base64 byte buffer support

Change-Id: I1c8e68b248e768b9a6f3cae712035c85b68572f9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-eventid: Fix comments 29/14329/1
José Bollo [Mon, 9 Apr 2018 12:18:46 +0000 (14:18 +0200)]
afb-eventid: Fix comments

Change-Id: I4ba49719a4776511d7f5448cd7fbf84caf7474e8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafs-supervisor: Add ws-server option 27/14327/1
José Bollo [Fri, 6 Apr 2018 22:01:33 +0000 (00:01 +0200)]
afs-supervisor: Add ws-server option

This allow exportation of the API of the supervisor.

Change-Id: I167ec94f00f40f8c3640377a46820e6a060b24f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Switch to fdev_epoll instead of sd_event 25/14325/1
José Bollo [Fri, 23 Mar 2018 17:58:37 +0000 (18:58 +0100)]
jobs: Switch to fdev_epoll instead of sd_event

Use by default an epoll of jobs for handling HTTP and
websockets. The sd_event loop remains available (to be checked).

Change-Id: Iaaad005c9880ba1818936a93c8626490666c9eec
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agofdev: Improve fdev handling with epoll 23/14323/1
José Bollo [Fri, 23 Mar 2018 16:46:59 +0000 (17:46 +0100)]
fdev: Improve fdev handling with epoll

Change-Id: I53c6eb394772e40f87000a0e5383be923f5d15f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Cosmetic changes 21/14321/1
José Bollo [Fri, 23 Mar 2018 13:01:09 +0000 (14:01 +0100)]
jobs: Cosmetic changes

Change-Id: I7505c3c5bcec9e2b7af645a59a3716cf9bfec552
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hsrv: remove dependency to systemd 19/14319/1
José Bollo [Fri, 23 Mar 2018 10:41:48 +0000 (11:41 +0100)]
afb-hsrv: remove dependency to systemd

Change-Id: I42428e7e57cb104b8575b60b1c7985782e9f779f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoMake DBUS transparency optional (off by default) 17/14317/1
José Bollo [Fri, 23 Mar 2018 10:16:32 +0000 (11:16 +0100)]
Make DBUS transparency optional (off by default)

The implementation of API transparency through
DBUS is not used at the moment.

To improve independancy to systemd (it relies on
systemd library) removing it should be possible.

Change-Id: I5750a92527dc3e9cf7dcd27625dce6a020797a3d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hswitch: Improve HTTP scanning of API/VERB 15/14315/1
José Bollo [Wed, 21 Mar 2018 08:40:41 +0000 (09:40 +0100)]
afb-hswitch: Improve HTTP scanning of API/VERB

The previous version wasn't accepting verbs containing
slashes (/) but the websocket did.

Some interesting use-cases are allowed by accepting to
include slashes in verbs.

Change-Id: I2786b5ed0e2686c3e68bb9b74923064d8953243c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafs-supervisor: Fix typo 13/14313/1
José Bollo [Wed, 21 Mar 2018 13:55:24 +0000 (14:55 +0100)]
afs-supervisor: Fix typo

Change-Id: Icc3c15f577f04117cdfaf2bcbcc4d15a99d02138
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoConvert pc.in from UTF-8 to US-ASCII 65/13865/2
Ronan Le Martret [Fri, 4 May 2018 16:42:26 +0000 (18:42 +0200)]
Convert pc.in from UTF-8 to US-ASCII

Change-Id: I14fd54002c6df3b3e566a9f5a61bc89b595f4e3d
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoCMakeLists: Fix c++ build 57/13857/3
Ronan Le Martret [Thu, 3 May 2018 14:50:55 +0000 (16:50 +0200)]
CMakeLists: Fix c++ build

On debian, for example, we need to specify C14 compatibility

Change-Id: I4fd4d6dbca03d085def61e373617ab5336ebcb0b
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agofdev: Improve readability
José Bollo [Fri, 16 Mar 2018 10:37:01 +0000 (11:37 +0100)]
fdev: Improve readability

Change-Id: If81cdf43703b6ff3128ea79940ce240f56918b9d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websock: Fix a double free
José Bollo [Thu, 15 Mar 2018 14:34:59 +0000 (15:34 +0100)]
afb-websock: Fix a double free

The commit 0ebdff94d461abd4328cf45a6281c15139a045eb of
libmicrohttpd fixed a bug but introduced a double free
of hreq resource attached to the connection. That commit
is between versions 0.9.59 and 0.9.60 of libmicrohttpd.

Now, hreq is freed in 'end_handler' of afb-hsrv.c

Change-Id: Ia865d65c5f9ef5ce787eb6545802ac8ea37ae468
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websock: Fix double close
José Bollo [Fri, 16 Mar 2018 10:39:07 +0000 (11:39 +0100)]
afb-websock: Fix double close

Integration with newer versions of libmicrohttpd
was closing two times the file descriptor:
 - one time by the websocket within afb
 - one time by the upgrade close of libmicrohttpd

Thanks to 'autoclose' feature of 'fdev', the solution
is quiet easily.

Bug-AGL: SPEC-1345

Change-Id: Ifb691b3f69c095b5ff44bfd7f7267ea24d52df6d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUpdate date of copyright notices
José Bollo [Tue, 27 Feb 2018 13:52:35 +0000 (14:52 +0100)]
Update date of copyright notices

Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Enforce session check (for token)
José Bollo [Tue, 27 Feb 2018 08:13:59 +0000 (09:13 +0100)]
afs-supervisor: Enforce session check (for token)

Change-Id: I6fdc419923944183d12c9c931e90e276f3dc8ac6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Force reply
José Bollo [Tue, 27 Feb 2018 07:48:14 +0000 (08:48 +0100)]
afs-supervisor: Force reply

Change-Id: Iba3a80e327b4324c1bdb4f8a0e7b73021d6e4ad6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-supervision: Fix typo
José Bollo [Tue, 27 Feb 2018 07:43:35 +0000 (08:43 +0100)]
afb-supervision: Fix typo

Change-Id: Iaff0340d64b02ee24f45caadd01d74314afabacd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Fix supervisor deafness
José Bollo [Mon, 26 Feb 2018 19:40:12 +0000 (20:40 +0100)]
afs-supervisor: Fix supervisor deafness

Change-Id: I68fc2799d1789cbcf5516539ab2af3ecd9b61e56
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add systemd service and config
José Bollo [Mon, 26 Feb 2018 17:57:24 +0000 (18:57 +0100)]
afs-supervisor: Add systemd service and config

Change-Id: I64bf8de01dbb8cf9581ed0be358d81fa84106520
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Remove dependency to systemd
José Bollo [Mon, 26 Feb 2018 17:56:47 +0000 (18:56 +0100)]
afs-supervisor: Remove dependency to systemd

Change-Id: I74b455f569f9bf1a6e6970163fb50a946875e42d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervisor: Make it a HTTP server
José Bollo [Mon, 26 Feb 2018 17:09:49 +0000 (18:09 +0100)]
supervisor: Make it a HTTP server

The supervisor now run as an HTTP server by default.

Change-Id: Ia0a654cd97c941f15b212c5364d739e2196662e4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Fix bugs
José Bollo [Mon, 26 Feb 2018 13:35:00 +0000 (14:35 +0100)]
afb-session: Fix bugs

Change-Id: Ib45e2db47827b4527435a40c4b79d02fb3ab488a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: cosmetic improvements
José Bollo [Mon, 26 Feb 2018 13:32:44 +0000 (14:32 +0100)]
afb-stub-ws: cosmetic improvements

Change-Id: Ib6adf0ca4bdfee9d3da07055430bfe1974ac28bc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Add traceses for tracing sessions
José Bollo [Mon, 26 Feb 2018 12:35:43 +0000 (13:35 +0100)]
afb-config: Add traceses for tracing sessions

Change-Id: I9d36eb9eb4991066f94b1340262ad27467fc591e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomemo-supervisor: added a memo for supervisor
José Bollo [Thu, 22 Feb 2018 15:33:28 +0000 (16:33 +0100)]
memo-supervisor: added a memo for supervisor

Change-Id: I2bf91ef9b1407d1a72eea3708782836c625ebdc0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-supervision: Fix error on 'trace'
José Bollo [Thu, 22 Feb 2018 13:55:24 +0000 (14:55 +0100)]
afb-supervision: Fix error on 'trace'

Change-Id: I81c89e6c9406df583087845d6b38a19fff8ab0eb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoxreq: export a function to get req
José Bollo [Thu, 22 Feb 2018 13:54:47 +0000 (14:54 +0100)]
xreq: export a function to get req

Change-Id: Ie7eac225f514349926341b7db61ea0eb9029c5d8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofdev: Introduce fdev for file event handling
José Bollo [Thu, 22 Feb 2018 12:22:48 +0000 (13:22 +0100)]
fdev: Introduce fdev for file event handling

This is an effort to keep cutting dependency to systemd.

Change-Id: I9a0c032a1095e297c7f3ac5b67827fda3658b8d9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-systemd: Integrate sd-fds features
José Bollo [Wed, 21 Feb 2018 15:07:56 +0000 (16:07 +0100)]
afb-systemd: Integrate sd-fds features

Change-Id: I59d194ba675912a42922f0905933b1cea796c78a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-systemd: Isolate systemd main entries
José Bollo [Wed, 21 Feb 2018 10:38:59 +0000 (11:38 +0100)]
afb-systemd: Isolate systemd main entries

This change prepares the possibilty to remove the dependency
to systemd/libsystemd.

Change-Id: Ife4181d6c7195230a11a32e527b8973af6a096e1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBump version to 5.99-FFRC0
José Bollo [Wed, 21 Feb 2018 10:12:10 +0000 (11:12 +0100)]
Bump version to 5.99-FFRC0

Change-Id: I58829d86b871260538ce40d4be8480849d7f4b80
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-monitor: Add session and rework permissions
José Bollo [Thu, 15 Feb 2018 16:17:37 +0000 (17:17 +0100)]
afb-monitor: Add session and rework permissions

The new verb session is available to get session info and
to renew the token. See examples below.

The permission required is now just to being check
meaning having the token.

Example:

afb-client-demo -H localhost:5555/api?token=456
monitor session
ON-REPLY 1:monitor/session: OK
{
  "response":{
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938",
    "token":"",
    "timeout":32000000,
    "remain":31999985
  },
  "jtype":"afb-reply",
  "request":{
    "status":"success",
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938"
  }
}
monitor session {"refresh-token":true}
ON-REPLY 5:monitor/session: OK
{
  "response":{
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938",
    "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc",
    "timeout":32000000,
    "remain":32000000
  },
  "jtype":"afb-reply",
  "request":{
    "status":"success",
    "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc"
  }
}

Change-Id: Ic93bae80616e5dad1640e73ac9f472b7b385104f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Verbs for timeout and remining time
José Bollo [Thu, 15 Feb 2018 15:51:25 +0000 (16:51 +0100)]
afb-session: Verbs for timeout and remining time

Change-Id: Ia1922187aa78d8633835c4a77e8aa533fa5d5f7d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-context: Early token change
José Bollo [Thu, 15 Feb 2018 15:50:31 +0000 (16:50 +0100)]
afb-context: Early token change

Change-Id: If27d84a702513b92f08c97ef91bf8cf89b5af238
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Fully exclude config monitoring
José Bollo [Thu, 15 Feb 2018 15:41:54 +0000 (16:41 +0100)]
afb-config: Fully exclude config monitoring

Change-Id: I93b3d49f46d4dec607b08cc439b6cb06cf68ec32
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Increase the default timeout of sessions
José Bollo [Thu, 15 Feb 2018 15:54:47 +0000 (16:54 +0100)]
afb-config: Increase the default timeout of sessions

The management of sessions is not very well understood
actually. People are using it without refreshing the token.
This has the effect that the binder closes sessions
after one hour.

So no demo can run more than one hour!

Increasing the timeout to more than one year will
solve the demo problem but will not fully solve the
overall problem.

Bug-AGL: SPEC-1296
Bug-AGL: SPEC-1293

Change-Id: Icb9adb4939a138c19be36280bf1e6643d04489ae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Use clock insensitive to time changes
José Bollo [Thu, 15 Feb 2018 15:23:54 +0000 (16:23 +0100)]
afb-session: Use clock insensitive to time changes

Bug-AGL: SPEC-1296
Bug-AGL: SPEC-1293

Change-Id: I1838175b48dff8fbf1fd65bd304f9cfe917ced80
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add verb for running discovery
José Bollo [Wed, 14 Feb 2018 14:18:34 +0000 (15:18 +0100)]
afs-supervisor: Add verb for running discovery

Change-Id: Iea9e54fa7a1c93ba3927c836d6ca5bcded77ca66
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add discovery mechanic
José Bollo [Wed, 14 Feb 2018 14:12:30 +0000 (15:12 +0100)]
afs-supervisor: Add discovery mechanic

Change-Id: Icfcdcc16d0433454c9bb0785d0690f7f173980ae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Improve name of supervisor api
José Bollo [Tue, 13 Feb 2018 11:18:49 +0000 (12:18 +0100)]
afs-supervisor: Improve name of supervisor api

Change-Id: Id0b43cecb91fa0a405c07f63d4f8c2f026c8a70c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Add retrieval of config
José Bollo [Tue, 13 Feb 2018 10:51:14 +0000 (11:51 +0100)]
supervision: Add retrieval of config

Change-Id: Id7bb91c267037cbd36c6cafef62d3c39a67e77db
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: export config to json
José Bollo [Tue, 13 Feb 2018 10:49:02 +0000 (11:49 +0100)]
afb-config: export config to json

Change-Id: I8918733753ec791e77eb8a71032ccdb35fa68d71
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Add supervision and supervisor
José Bollo [Thu, 29 Jun 2017 20:09:47 +0000 (22:09 +0200)]
supervision: Add supervision and supervisor

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Fix segfault on diconection
José Bollo [Tue, 13 Feb 2018 09:26:26 +0000 (10:26 +0100)]
afb-stub-ws: Fix segfault on diconection

Change-Id: I7826b86e4d4cc921b2daaca5c8dda0fd27faae10
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Protect against self-destruction
José Bollo [Mon, 12 Feb 2018 17:03:38 +0000 (18:03 +0100)]
afb-stub-ws: Protect against self-destruction

Change-Id: I43b15b8f675173a693816a0b8efd05fd024278f0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Add tracing of sessions
José Bollo [Mon, 12 Feb 2018 14:57:55 +0000 (15:57 +0100)]
afb-trace: Add tracing of sessions

Change-Id: Ieba4032bed526ca158dc69558177a038df95988b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Add function to enumerate sessions
José Bollo [Mon, 12 Feb 2018 13:27:46 +0000 (14:27 +0100)]
afb-session: Add function to enumerate sessions

Change-Id: Ifaa1aa02d0562c40763ac03b7c05df7f9f9c8127
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agotest-session: Add check of hooking
José Bollo [Mon, 12 Feb 2018 09:27:59 +0000 (10:27 +0100)]
test-session: Add check of hooking

Change-Id: I3ac86b41537651e360e7ea21ad425f2e1bffb852
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Insert call to hooking
José Bollo [Mon, 12 Feb 2018 08:12:47 +0000 (09:12 +0100)]
afb-session: Insert call to hooking

Change-Id: I7d91b133761c7c751300bf1344321e295cce1bc3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Add hooks for session
José Bollo [Wed, 7 Feb 2018 16:45:37 +0000 (17:45 +0100)]
afb-hook: Add hooks for session

Change-Id: I4fbd6bf57958abb366a742b12afb92bfc03ad299

6 years agoafb-session: Refactor and test unit
José Bollo [Wed, 7 Feb 2018 16:44:20 +0000 (17:44 +0100)]
afb-session: Refactor and test unit

The session are refactored and now to include a test unit.

Change-Id: Ia8c4b707191f3af95c0549b333d14b384a81eaa7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Fix a session leak bug
José Bollo [Wed, 7 Feb 2018 11:38:20 +0000 (12:38 +0100)]
afb-stub-ws: Fix a session leak bug

Change-Id: I55b72d7a4e7ca18e61addb3b0efa2ec75729060b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Improve doc of option --token
José Bollo [Wed, 7 Feb 2018 10:30:08 +0000 (11:30 +0100)]
afb-config: Improve doc of option --token

Change-Id: I196c7f2b216e031f52b208e19c6c2df8593d27c5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomain: Isolate HTTP initialization
José Bollo [Wed, 7 Feb 2018 10:27:52 +0000 (11:27 +0100)]
main: Isolate HTTP initialization

Initializations linked to HTTP are deferred
until starting the HTTP server.

Change-Id: I917c4c5db3c3ae894ee60fd16b9e09d4185fcdb4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Return an initialization status
José Bollo [Wed, 7 Feb 2018 10:25:37 +0000 (11:25 +0100)]
afb-session: Return an initialization status

Avoid exiting anywhere

Change-Id: Ic24a2c7435645632d609fb16849d33b204062397
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Fix a typo
José Bollo [Wed, 7 Feb 2018 08:31:29 +0000 (09:31 +0100)]
afb-session: Fix a typo

Change-Id: Ia834cfd203ab1471efa21ce650fcd7895370dc63
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Add argument to start
José Bollo [Tue, 6 Feb 2018 15:19:17 +0000 (16:19 +0100)]
jobs: Add argument to start

Change-Id: I89a75a036c60097fb898ab8723007ca6ebfc7f39
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-xreq: Export afb_request facilities
José Bollo [Tue, 6 Feb 2018 10:29:32 +0000 (11:29 +0100)]
afb-xreq: Export afb_request facilities

Internally, the binder can need to convert
afb_request to xreq and conversely.
Exporting this facilities is good.

Change-Id: I5bb01d701eee0ac30ad6ce490609f6124a9d5860
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Replace daemon by api name
José Bollo [Wed, 31 Jan 2018 16:16:18 +0000 (17:16 +0100)]
afb-trace: Replace daemon by api name

This replacement greatly improves the code.

Change-Id: If3fd6e6080eda2268ccf551998f99af01799be29
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-evt: Add event creation with prefix
José Bollo [Wed, 31 Jan 2018 16:15:27 +0000 (17:15 +0100)]
afb-evt: Add event creation with prefix

Change-Id: I2fd35e8ed59c28f4283be698a2586cdae5f7c8cf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api: Enforce api names to be hookable
José Bollo [Wed, 31 Jan 2018 13:52:08 +0000 (14:52 +0100)]
afb-api: Enforce api names to be hookable

Change-Id: Ic1d5cb208c636d3261e1a96c4a81b488cb84a60e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Allow to unhook some apis
José Bollo [Fri, 11 Aug 2017 15:00:08 +0000 (17:00 +0200)]
afb-hook: Allow to unhook some apis

The apis starting with a $ (dollar) will not be
tracked by hooks

Change-Id: I3b83458c288ef1eb27993d4c71785b32e5a72deb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Integrate systemd watchdog by default
José Bollo [Thu, 18 Jan 2018 10:17:25 +0000 (11:17 +0100)]
jobs: Integrate systemd watchdog by default

Change-Id: Iaa3ce3ee9188e3ddaf6ee70964963d29df78689f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Split jobs_get_sd_event
José Bollo [Thu, 18 Jan 2018 10:16:57 +0000 (11:16 +0100)]
jobs: Split jobs_get_sd_event

Provide a mutex locked internal function for getting
the event loop: get_sd_event_locked

Change-Id: I2635f901b3ec0fcf2c52f569f4c57cfd046601af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-common: Cleanup
José Bollo [Thu, 18 Jan 2018 09:50:41 +0000 (10:50 +0100)]
afb-common: Cleanup

Change-Id: Ifc5adbdc92c3d034c92dd432c72057f3267c4964
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Dichotomic mimetype search
José Bollo [Thu, 18 Jan 2018 09:44:24 +0000 (10:44 +0100)]
afb-hreq: Dichotomic mimetype search

Change-Id: I6d906c31cdcf07c5404f1eb81cd44683976465f7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Sort mimetypes
José Bollo [Thu, 18 Jan 2018 09:16:13 +0000 (10:16 +0100)]
afb-hreq: Sort mimetypes

Change-Id: I45ae5a702b83dabe081b625b4bcaf5de33ffa1e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Add json to known mimetypes
Loïc Collignon [Thu, 30 Nov 2017 10:47:15 +0000 (11:47 +0100)]
afb-hreq: Add json to known mimetypes

Change-Id: Ic11ebf7e569160dd25e66a1273904dfcd82bdeb8
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
6 years agoafb-client-demo: Fix memory leak
José Bollo [Fri, 5 Jan 2018 16:02:19 +0000 (17:02 +0100)]
afb-client-demo: Fix memory leak

Change-Id: I636b95459715f3b272509eb76e304a49593fb527
Signed-off-by: José Bollo <jose.bollo@iot.bzh>