From 0156b1645a201e44d5285c96d32cbfa5a9eb6814 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Mon, 30 May 2016 13:22:34 +0200 Subject: Improves the documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iac5ee5c2ca014ced5fe836601e9afc362a9d4fda Signed-off-by: José Bollo --- doc/afb-application-writing.html | 68 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) (limited to 'doc/afb-application-writing.html') diff --git a/doc/afb-application-writing.html b/doc/afb-application-writing.html index adb5ca7b..7c0278da 100644 --- a/doc/afb-application-writing.html +++ b/doc/afb-application-writing.html @@ -8,18 +8,63 @@

HOWTO WRITE an APPLICATION above AGL FRAMEWORK

version: 1
-Date:    29 mai 2016
+Date:    30 mai 2016
 Author:  José Bollo
 

+ +

Writing an HTML5 application

+ +

Developpers of HTML5 applications (client side) can easyly create +applications for AGL framework using their prefered +HTML framework.

+ +

Developpers can also create powerful server side plugins to improve +their application. This server side plugin should return the mime-type +application/json and can be accessed either by HTTP or by Websockets.

+ +

In a near future, the JSON-RPC protocol will be available together +with the current x-afb-json1 protocol.

+ +

Two examples of HTML5 applications are given:

+ + + + + +

Writing a Qt application

+ +

Writing Qt applications is also possible because Qt offers APIs to +make HTTP queries and to connect using WebSockets.

+ +

It is even possible to write a QML application. +It is demontrated by the sample application token-websock:

+ + + +

Writing a C application

@@ -36,5 +81,26 @@ Its source code is here

The current implementation use libsystemd and file descriptors. This may be changed in the future to also support secure sockets and being less dependant of libsystemd.

+ + +

Handling sessions within applications

+ + +

Exchanging tokens

+ +

Applications are communicating with their binder afb-daemon using +a network connection or a kind of network connection (unix domain +socket isn’t currently implemented but could be used in near future). +Also, HTTP protocol is not a connected protocol. It means that +the socket connection can not be used to authenticate a client.

+ +

For this reason, the binder should authenticate the application +by using a commonly shared secret named token.

+ +

At start, the framework communicate a common secret to both the binder +and its client: the application. When the application

+ + +

Handling sessions

-- cgit 1.2.3-korg