-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update installation instructions (#94)
* update installation instructions Signed-off-by: Mirko Mollik <mirkomollik@gmail.com> * fix: update documentation Signed-off-by: Mirko Mollik <mirkomollik@gmail.com> --------- Signed-off-by: Mirko Mollik <mirkomollik@gmail.com>
- Loading branch information
Showing
19 changed files
with
174 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ tmp | |
.env | ||
site | ||
application.zip | ||
.venv/ | ||
|
||
# dependencies | ||
node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Holder App | ||
|
||
The holder app is a client that is interacting with the holder backend. THe business logic is implemented in the backend, the client is only responsible for displaying the data and interacting with the user. | ||
|
||
The application is responsive, so it can be used on mobile devices as well as on desktops. | ||
|
||
There are two ways to receive a credential: | ||
|
||
- **Camera**: The user can scan a QR code that contains either a OID4VCI URL or a OID4VP URL. For this action the permission of the camera is required. | ||
- **Clipboard**: When going into the scan view, the application will automatically check the clipboard for a valid URL. This validation is done by checking if the URL starts with `oid4vci://` or `oid4vp://` on the client. For this action the permission of the clipboard is required. In case there was no permission granted to read from the clipboard, the user is able to manually paste the URL into the input field via the menu icon in the top right corner. | ||
|
||
## Tech stack | ||
|
||
Angular is used to build the frontend with the esbuild builder. It is also built as a Progressive Web App (PWA) to allow the user to install the app on the device. | ||
|
||
## Configuration | ||
|
||
In the app initialization, the app is loading the `config.json` file from the asset folder. This approach allows to change the configuration without rebuilding the app. The configuration can be mounted into the docker container. | ||
|
||
The file includes the following properties: | ||
|
||
- backendUrl: the url of the backend service | ||
|
||
In development mode, you need to update the `config.json` file in the `src/assets` folder. In production, you can mount the file into the docker container. | ||
TODO: to avoid a cached config file, a random parameter should be added to the url. | ||
|
||
## Authentication | ||
|
||
The application will send a GET request to `$backendUrl/auth` to get the OIDC configuration. The configuration will be used to authenticate the user via the keycloak instance. | ||
|
||
It is also possible on the login screen to change the backend url to a different instance. This is useful for testing different environments or to use one hosted client instance. In this case the manuel configured backendUrl is stored in the local storage. When the app is started, it will prioritize the stored url over the one in the config file. | ||
|
||
## Language support | ||
|
||
The application is right now only available in English. A multi language support is planned for the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Holder backend | ||
|
||
The holder backend is a service for managing the wallet of multiple users. It will store the credentials and will interact with the different relying parties to receive or present credentials. | ||
|
||
## Tech stack | ||
|
||
The backend is based on nestjs, where all endpoints are published as rest api. The OpenAPI interface can be found at `/api`. | ||
|
||
## Configuration | ||
|
||
Configuration is done via environment variables. By default the service will use the `.env` file in the app folder, but for production you can pass the variables via the environment into the docker container. | ||
The required variables will be checked on startup. If a variable is missing, the service will exit with an error message. | ||
|
||
## Database | ||
|
||
The backend is using `typeorm`, allowing to use different database. Right now it supports `sqlite` and `postgres`. The type is define via the `DB_TYPE` environment variable. The default value is `postgres`. | ||
|
||
## Key management | ||
|
||
There are two different key management systems supported by the backend to manage the keys of the users. | ||
|
||
- `db`: the keys are stored in the database | ||
- `vault`: the keys are stored in a hashicorp vault instance | ||
|
||
The type is set via `KM_TYPE`, the default value is `db`. | ||
|
||
The implementation of other vault systems or other approaches are possible by implementing the `KeysService` interface. | ||
|
||
The key management option is equal for all users and can not be set individually. | ||
|
||
## Authentication | ||
|
||
Authentication is realized via open id connect. The JWT needs to have the role `holder` to be able to access the endpoints. | ||
|
||
To validate if the token got revoked, the backend needs a service account with the required permissions. | ||
|
||
## Health check | ||
|
||
The service is exposing a health check endpoint at `/health`. It will return a `200` status code if the service is healthy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Holder Browser Extension | ||
|
||
The browser extension is a client that available as a browser extension. Right now there is only a chrome extension available. Like the holder app, the business logic is implemented in the backend, the client is only responsible for displaying the data and interacting with the user. | ||
|
||
Most of the code is shared between the holder app and the browser extension. The main difference is the way how to interact with QR-Codes. For this the extension is using the `chrome.tabs` API to inject a content script into the current tab. This script is responsible for scanning all images on the page and check if it is a QR-Code. If a QR-Code is found with the correct schema like `oid4vci://` or `oid4vp://`, the extension will render a button next to the QR-Code that the user can click to start the scanning process. | ||
|
||
## Tech stack | ||
|
||
Angular is used to build the frontend with the webpack builder. The older builder is used because it allows to compile multiple entry points. | ||
Esbuild could also be used to speed up the build, but then two jobs have to be executed to compile the app and the background script. | ||
|
||
## Configuration | ||
|
||
In the app initialization, the app is loading the `config.json` file from the asset folder. This approach allows to change the configuration without rebuilding the app. This configuration can be replaced in the compiled extension. But when the extension was pushed to the Chrome Web Store, the configuration is fixed. | ||
|
||
## Authentication | ||
|
||
Chapter is equal to the [holder app](../holder/holder-app.md#authentication). | ||
|
||
## Language support | ||
|
||
Chapter is equal to the [holder app](../holder/holder-app.md#language-support). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
# Contributing | ||
|
||
Contributions are always welcome. When opening a pull request, please make sure it is signed and explain the changes you made. In case you want to discuss about a new feature/change, open an issue and we can discuss it there. | ||
|
||
To ask specific questions, you can also join our [Discord](https://discord.gg/ac2AfUaV) server. There you will get regular update about the project and upcoming meetings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# Development | ||
|
||
To install all dependencies, run `pnpm install` in the root folder. | ||
|
||
Each app has its own `package.json` with specific jobs. In the root folder is one `package.json` with global jobs like `build`, `clean` and `lint`. | ||
Each app has its own `project.json` with specific jobs. You can either run them via the command line or via the plugin for your editor. | ||
|
||
The command `pnpm run init` will generate `.env` files for each app based on the example file. | ||
|
||
For vscode are pre defined tasks in the `.vscode` folder. You can run them via the command palette or the shortcut `ctrl+shift+p` and type `Run Task`. The `Start issuer, holder, verifier` task for example will start all three apps with their frontend and backend. The keycloak instance has to be started by yourself since it is not part of the monorepo. You can find it in the `deploys/keycloak` folder and start it with `docker-compose up -d`. | ||
|
||
## Known limitations | ||
|
||
The command `pnpm run -r init` will generate `.env` files for each app based on the example file. Applications inside the `apps` folder will not use the `.env` file in the root folder, this is only for the docker-compose setup. Instead use the `.env` files in the apps folder. In case it's an angular application, use the config file in the `assets/config` folder. | ||
When you are running node based tasks and you are adding or removing a dependency, the task will stop the nx daemon will not restart by itself when there are file changes in the app. To fix this, run `pnpm exec nx reset`. After this all node based tasks will work again as expected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Requirements | ||
|
||
- [node v20](https://nodejs.org/en/download/package-manager) | ||
- [pnpm v9](https://pnpm.io/installation) | ||
- [docker](https://docs.docker.com/get-docker) in case you want to use keycloak and the database in docker | ||
- editor [plugin for nx](https://nx.dev/getting-started/editor-setup) (optional) | ||
|
||
For an easy development setup, it is recommend to use vscode with the nx plugin to start tasks like building, testing and linting or to generate new code. You can also use Webstorm with the nx plugin, [see here](https://nx.dev/getting-started/editor-setup#official-integrations). | ||
|
||
|
||
## Running the documentation | ||
|
||
To run `mkdocs` locally: | ||
|
||
```bash | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip3 install -r requirements.txt | ||
mkdocs serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Intention | ||
|
||
## Why a cloud wallet | ||
|
||
A cloud wallet is able to move the whole complexity of the SSI algorithms to the server side, so the clients only need to render the data. This makes the development of new clients or integration into existing applications much easier. It also provides an equal security level for all users and does not exclude any smartphones because of their hardware capabilities. Besides that it allows the user to access his credentials from multiple devices without the need to sync them. | ||
|
||
Of course the user is losing offline capabilities and has to trust the server to not misuse personal data. But this is a tradeoff that can be acceptable for many use cases when you want to start with verifiable credentials with great user experience and low development effort. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mkdocs | ||
mkdocs-material |