(no commit message)
[devwiki.git] / design / revisedclientarchitecture.mdwn
1 ## Revised Client Architecture
2
3 The architecture of the initial implementation needs to be re-factored to with give better Model, View, Controller separation, allowing for:
4
5 - more ways of interacting with the server than the ID Selector App and Web Provisioning;
6 - different storage strategies;
7 - ease of maintenance.
8 ### Overview
9
10 This diagram shows the proposed new architecture.
11 ![image](https://gitorious.org/petefoth-public-docs/petefoth-public-docs/blobs/raw/master/Moonshot/Proposed%20New%20Architecture.jpg)
12
13 The re-factored Moonshot Client software will have the following components:
14
15 *_identity-server_*  shared library offering C and Vala APIs.
16
17 - provides Create / Read / Update / Delete functionality for IDs
18 - is the only means of accessing the identity-storage-server
19 - includes the server functionality initially implemented in UI
20
21 *_identity-storage-server_*  encapsulates the Identity Store in a shared library offering a CRUD API to access the store.
22
23 - protects the store from multiple concurrent write access
24 - re-implemented per platform and per storage strategy so
25
26 -- one version each for Linux, Mac OS and Windows, local storage. DBus provides an appropriate mechanism under Linux and Mac OSX for protecting the store from multiple concurrent write access. It is not supported on Windows, so the Windows implementation will use a different mechanism.
27 -- one version for web storage, restful API. (Not in scope for this iteration).
28 -- other versions as required for different storage solutions  (Not in scope for this iteration).
29
30 *_identity-provisioning_* - not currently implemented. Provides CRUD operations via (for now) .msht and XML files, and via command line. Implemented in portable code as far as possible. Uses *_identity-server_*. Consists of
31
32 - *_identity-provisioning-file-handler_* - processes .msht (and XML and/or json, and maybe other format) files for file-based provisioning operations. Currently implemented as *_moonshot-webp_*, allowing only install access. Should also allow uninstall/revoke access.
33 - *_identity-provisioning-cli-handler_* - provides a command line API to identity CRUD functions
34
35 All of the components will be implemented in Vala. The shared libraries will be built with the -H option to enable access from C code, and introspection generated to allow use from other languages.. 
36
37 ### _identity-server_ detail
38
39 Implemented as a shared library in Vala.
40
41 Replaces the libmoonshot component from the initial implementation.
42
43 Owns the public APIs for accessing the Identity Store (rather than exposing APIs provided via DBus by moonshot-ui).
44
45 Provides new APIs needed by moonshot-ui to manage identities (e.g. CreateNewIdCard(), UpdateIdCard(), DeleteIdCard()) as well as the existing APIs provided by lib-moonshot (getIdentity(), GetDefaultIdentity(), InstallId_card()).
46
47 Uses the APIs provided by the *_identity-storage-server_* component (_-dbus-local-storage-server_ on Linux and Mac, _-windows-local-storage-server_ on Windows).
48
49 Uses GTK widgets for simple input from User.
50
51 ### _moonshout-ui_ detail
52
53 This is now just an App for managing Identities. It's *only* function is to allows a User to manage Identities and Services.
54
55 It no longer owns the IdentityStore.
56
57 It no longer *provides* APIs (via DBus) for use by others via libmoonshot.
58
59 Instead, it *uses* APIs provided by libmoonshot.
60
61 Implemented in Vala using GTK widgets.
62
63 ### _identity-provisioning_ detail 
64
65 The *_identity-provisioning-file-handler_* component replaces the moonshot-webp component. It provides the same InstallIdentityCard() functionality as the moonshot-webp component in the initial implementation, as well as new functions to uninstall and revoke identities. It has no UI - any interaction with the User is done when the file is processed by the *_identity-server_*
66
67 The *_identity-provisioning-cli-handler_* component is not part of the current iteration. In a future iterations it is intended to provide via the command line the same functionality as *_identity-provisioning-file-handler_* provides via files.
68
69 ### Use Case Implementation
70
71 The re-factored software is designed to implement the following use cases that were part of the first iteration:
72
73 1. User installs and identity by clicking on a .msht file downloaded from the Web
74 1. User creates and installs an identity card using the UI
75 1. User modifies an existing identity card using the UI
76 1. User deletes an existing identity card using the UI
77
78 It is designed to extend the above Uses cases as follows:
79
80 1. User can install .msht files when attached to emails
81 1. User can use .msht files can be used to delete or revoke identities 
82 1. User can create, view, update and delete installed identities via the command line 
83 1. User can create, view, update and delete installed identities using a script file
84
85 Not all of these will be implemented in the current phase, but the software will be implemented in a way that facilitates their implementation if future phases.