efe53d202c0a8cf9126fb36689f4f74633634290
[src/app-framework-binder.git] / docs / afb-daemon-vocabulary.md
1 # Vocabulary for AFB-DAEMON
2
3 ## Binding
4
5 A shared library object intended to add a functionality to an afb-daemon
6 instance.  
7 It implements an API and may provide a service.
8
9 Binding made for services can have specific entry point called after
10 initialization and before serving.
11
12 ## Event
13
14 Message with data propagated from the services to the client and not expecting
15 any reply.
16
17 The current implementation allows to widely broadcast events to all clients.
18
19 ## Level of assurance (LOA)
20
21 This level that can be from 0 to 3 represent the level of
22 assurance that the services can expect from the session.
23
24 The exact definition of the meaning of these levels and how to use it remains to
25 be achieved.
26
27 ## Request
28
29 A request is an invocation by a client to a binding method using a message
30 transferred through some protocol:
31
32 - HTTP
33 - WebSocket
34 - DBUS
35 - ...
36
37 and served by ***afb-daemon***
38
39 ## Reply/Response
40
41 This is a message sent to client as the result of the request.
42
43 ## Service
44
45 Service are made of bindings running by their side on their binder.  
46 It can serve many client.  
47 Each one attached to one session.
48
49 The framework establishes connection between the services and the clients.  
50 Using sockets currently but other protocols are considered.
51
52 ## Session
53
54 A session is meant to be the unique instance context of a client,
55 which identify that instance across requests.
56
57 Each session has an identifier.  
58 Session identifier generated by afb-daemon are UUIDs.
59
60 Internally, afb-daemon offers a mechanism to attach data to sessions.  
61 When the session is closed or disappears, the data attached to that session
62 are freed.
63
64 ## Token
65
66 The token is an identifier that the client must give to be authenticated.
67
68 At start, afb-daemon get an initial token.  
69 This initial token must be presented by incoming client to be authenticated.
70
71 A token is valid only for a period.
72
73 The token must be renewed periodically.  
74 When the token is renewed, afb-daemon sends the new token to the client.
75
76 Tokens generated by afb-daemon are UUIDs.
77
78 ## UUID
79
80 It stand for Universal Unique IDentifier.
81
82 It is designed to create identifier in a way that avoid has much as possible
83 conflicts.  
84 It means that if two different instances create an UUID, the
85 probability that they create the same UUID is very low, near to zero.
86
87 ## x-afb-reqid
88
89 Argument name that can be used with HTTP request.  
90 When this argument is given, it is automatically added to the "request" object of the answer.
91
92 ## x-afb-token
93
94 Argument name meant to give the token without ambiguity.  
95 You can also use the name **token** but it may conflicts with others arguments.
96
97 ## x-afb-uuid
98
99 Argument name for giving explicitly the session identifier without ambiguity.  
100 You can also use the name **uuid** but it may conflicts with others arguments.