1.0.4 • Published 11 months ago

tydids-ssi-consent-router v1.0.4

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

Moleculer

tydids-ssi-consent-router

The microservice provides a solution for handling SSI (Self Sourvereign Identity) protected grants and ensuring that users have the ability to revoke consent. By using the microservice, developers can easily integrate SSI into their existing webforms without having to modify the underlying code.

Key Features

  • Scalability: Based on the moleculer.service microservice framework, it can be used directly for large scalability.
  • Durability: The storage backend is based on pouchdb which ensures durability.
  • Lightweight Design: Makes it easy to use SSI for consent in existing environments.

Demo

Open in Gitpod

Concept

The microservice is designed to be used in web applications that collect sensitive data, such as a user's real name, phone number, and email address. By using SSI, the microservice ensures that the user has the ability to revoke consent at a later time.

The way a developer uses this microservice is by letting a webform submit to the /frontend/submit endpoint. Depending on the configuration in the .env file, the user will either be redirected to a configured URL or the request will be forwarded to another URL, where the microservice will do a POST request and capture the results redirect location and send it with the response. In other words, the microservice can be used as a snap-in to existing webforms by setting the <form action> to the microservice and configuring the FORWARD_URLto the original target.

Installation

The microservice requires Node JS 18.x or higher to be installed. It can also run as a docker container.

To install the microservice, follow these steps:

git clone https://github.com/energychain/tydids-ssi-consent-router
cd tydids-ssi-consent-router
npm install
cp sample.env .env

Configuration

The configuration is mainly in the .env file. You need to configure at least the PRIVATE_KEY. To create a new private key, run npm run createPrivateKey.

Usage

To start the microservice, run npm start. A test webform should be accessible at http://localhost:3000/showcase.html

Useful links

NPM scripts

  • npm run dev: Start development mode (load all services locally with hot-reload & REPL)
  • npm run start: Start production mode (set SERVICES env variable to load certain services)
  • npm run cli: Start a CLI and connect to production. Don't forget to set production namespace with --ns argument in script
  • npm run ci: Run continuous test mode with watching
  • npm test: Run tests & generate coverage report
  • npm run dc:up: Start the stack with Docker Compose
  • npm run dc:down: Stop the stack with Docker Compose

License: Apache-2.0

Maintainer / Impressum

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.0

11 months ago