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