a88dc5b78ea620265866bee10c2882eb3181d161
[src/app-framework-main.git] / doc / application-framework.md
1
2 Application framework
3 =====================
4
5     version: 1
6     Date:    30 mai 2016
7     Author:  José Bollo
8
9 TABLE-OF-CONTENT-HERE
10
11 Foreword
12 --------
13
14 This document describes application framework fundamentals. 
15 FCF (Fully Conform to Specification) implementation is still under development.
16 It may happen that current implementation somehow diverges with specifications.
17
18 Overview
19 --------
20
21 The application framework on top of the security framework
22 provides components to install and uninstall applications
23 as well as to run them in a secured environment.
24
25 The goal of the framework is to manage applications and hide security details
26 to applications.
27
28 For the reasons explained in introduction, it was choose not to reuse Tizen
29 application framework directly, but to rework a new framework inspired from Tizen.
30
31 fundamentals remain identical: the applications are distributed
32 in a digitally signed container that should match widget specifications
33 normalized by the W3C. This is described by the technical
34 recommendations [widgets] and [widgets-digsig] of the W3 consortium.
35
36 As today this model allows the distribution of HTML, QML and binary applications
37 but it could be extended to any other class of applications.
38
39 The management of widget package signatures.
40 Current model is only an initial step, it might be extended in the
41 future to include new feature (ie: incremental delivery).
42
43
44 Comparison to other frameworks
45 ------------------------------
46
47 ### Tizen framework
48
49 ### xdg-app
50
51 ### ostro
52
53 organization of directory of applications
54 =========================================
55
56 The main path for applications are: APPDIR/PKGID/VER.
57
58 Where:
59
60  - APPDIR is as defined above
61  - PKGID is a directory whose name is the package identifier
62  - VER is the version of the package MAJOR.MINOR
63
64 The advantage of such an organization is to allow several versions to live together.
65 This is required for multiple reasons (ie: roll back) and to comply with developers habits.
66
67 Identity of installed files
68 ---------------------------
69
70 All the files are installed as user "userapp" and group "userapp".
71 All files have rw(x) for user and r-(x) for group and others.
72
73 This allows any user to read files.
74
75
76 labeling the directories of applications
77 -----------------------------------------
78
79
80 organization of data
81 ====================
82
83 The data of a user are contain within its directory and are labeled using the application labels
84
85 Setting Smack rules for the application
86 =======================================
87
88 For Tizen, the following rules are set by the security manager for each application.
89
90     System ~APP~             rwx
91     System ~PKG~             rwxat
92     System ~PKG~::RO         rwxat
93     ~APP~  System            wx
94     ~APP~  System::Shared    rxl
95     ~APP~  System::Run       rwxat
96     ~APP~  System::Log       rwxa
97     ~APP~  _                 l
98     User   ~APP~             rwx
99     User   ~PKG~             rwxat
100     User   ~PKG~::RO         rwxat
101     ~APP~  User              wx
102     ~APP~  User::Home        rxl
103     ~APP~  User::App::Shared rwxat
104     ~APP~  ~PKG~             rwxat
105     ~APP~  ~PKG~::RO         rxl
106
107 Here, ~PKG~ is the identifier of the package and ~APP~ is the identifier of the application.
108
109 What user can run an application?
110 =================================
111
112 Not all user are able to run all applications.
113 How to manage that?
114
115
116 [meta-intel]:       https://github.com/01org/meta-intel-iot-security                "A collection of layers providing security technologies"
117 [widgets]:          http://www.w3.org/TR/widgets                                    "Packaged Web Apps"
118 [widgets-digsig]:   http://www.w3.org/TR/widgets-digsig                             "XML Digital Signatures for Widgets"
119 [libxml2]:          http://xmlsoft.org/html/index.html                              "libxml2"
120 [openssl]:          https://www.openssl.org                                         "OpenSSL"
121 [xmlsec]:           https://www.aleksey.com/xmlsec                                  "XMLSec"
122 [json-c]:           https://github.com/json-c/json-c                                "JSON-c"
123 [d-bus]:            http://www.freedesktop.org/wiki/Software/dbus                   "D-Bus"
124 [libzip]:           http://www.nih.at/libzip                                        "libzip"
125 [cmake]:            https://cmake.org                                               "CMake"
126 [security-manager]: https://wiki.tizen.org/wiki/Security/Tizen_3.X_Security_Manager "Security-Manager"
127 [app-manifest]:     http://www.w3.org/TR/appmanifest                                "Web App Manifest"
128 [tizen-security]:   https://wiki.tizen.org/wiki/Security                            "Tizen security home page"
129 [tizen-secu-3]:     https://wiki.tizen.org/wiki/Security/Tizen_3.X_Overview         "Tizen 3 security overview"
130
131