Giter Club home page Giter Club logo

ssi-hub's Introduction

EWF SSI Hub

Description

The SSI Hub aims to be a server application to provide SSI and IAM functionality as a part of an SSI wallet system. It performs the following functions:

  • Facilitates the credentials exchange between credential requesters and issuers.
  • Account multi-tenancy. Multiple users can store their data and data access is authorized appropriately.
  • Caches smart contract data such DID documents in order to improve read-query performance.

This repository was formerly refered to as the iam-cache-server.

Prepare

Development

$ git checkout develop
$ cp .env.dev .env
$ cp docker-compose.dev.yml docker-compose.yml

Set the following values in your .env:

ENS_URL=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_HOST=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PORT=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_ID=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_SECRET=<PUT_YOUR_VALUE_HERE>

Production

$ git checkout master
$ cp .env.dist .env
$ cp docker-compose.prod.yml docker-compose.yml

In production empty values need to be populated in .env file, while development is prepopulated with sample values

Installation

$ npm install

On Apple Silicon (M1) TARGET_ARCH=amd64 may be required for dependencies to be build. So execute TARGET_ARCH=amd64 npm install or set export TARGET_ARCH=amd64 in your shell.

Generating the keys pair

$ npm run generate:jwtkeys

Generating types for contracts

$ npm run build:contracts

Running the app

development

$ docker-compose up -d
$ npm run start:dev

production

$ npm run docker:start

Cookies

Note that when running in dev, you can change the cookie policy in cookies.service.ts from

sameSite: 'none',
secure: true

to

sameSite: 'strict',
secure: false,

In this way, an app hosted on localhost (assuming the cache-server is also served on localhost) will store the authentication cookies even if the requests aren't sent over a secure connection.

Test

Make sure ENABLE_AUTH=true is set as it is required for tests passing.

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Release Notes

Release note is generated using standard-version which generates CHANGELOG.md based on last tag version and commits history. this can be generated using the command.

 $ npm run release

Commit Message Guidelines

This repository follows Conventional Commits specification.

Commit message format

<type>(<scope>): <subject>

Samples:

feat(login.strategy): add optional numBlocksBack config
feat(deps): bump `passport-did-auth` and `iam-contracts` versions to latest

Using CLI

If you want to be lead step-by-step you can use cz-cli which will help you setup commit message according to our standards
$ npm run commit

In case if commit got interrupted (i.e. failed tests, failed eslint etc.) you can run
$ npm run commit:retry

Troubleshooting

error: unknown option 'hook'

In this case you need to initialize commitizen locally
$ commitizen init cz-conventional-changelog --save-dev --save-exact

Connection pooling

To calculate maximum number of connections use following formula:
LEAST({DBInstanceClassMemory/9531392}, 5000). This is taken from the AWS RDS "Maximum number of database connections" documentation.

Then divide maximum connections number by number of maximum amount of IAM Cache Server instances.
If you are going to host 4 instances of ICS then DB_MAXIMUM_CONNECTION_POOL should be 40/4=10

ssi-hub's People

Contributors

jrhender avatar harasz avatar jgiter avatar marcin-l-tsh avatar hejkerooo avatar knzeng-e avatar michalziobro avatar hrachocode avatar renovate-bot avatar dwojno avatar whitneypurdum avatar passerino avatar nichonien avatar ahmedolaibrahim avatar timtech4u avatar artursudnik avatar royki avatar kyleian avatar renovate[bot] avatar manihagh avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.