Skip to content

Commit

Permalink
Merge pull request #11 from Sphereon-Opensource/develop
Browse files Browse the repository at this point in the history
new release
  • Loading branch information
nklomp authored Apr 30, 2023
2 parents a7d9111 + 4962725 commit a09809c
Show file tree
Hide file tree
Showing 162 changed files with 23,963 additions and 11,758 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EBSI_DEFAULT_REGISTRY="https://api-pilot.ebsi.eu/did-registry/v4"
12 changes: 8 additions & 4 deletions .github/workflows/build-test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: yarn install
- run: yarn bootstrap
- run: yarn build
cache: 'pnpm'
- run: pnpm add -g pnpm
- run: pnpm install
- run: pnpm build
- name: run CI tests
env:
INCLUDE_POSTGRES_TESTS: true
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_PORT: 5432
run: yarn test:ci
run: pnpm test:ci
- run: npx codecov
35 changes: 15 additions & 20 deletions .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,27 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn cache dir)"
# - uses: actions/cache@v2
# id: yarn-cache
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-2-${{ hashFiles('**/package.json') }}

- run: yarn install
- run: yarn bootstrap
- run: yarn build
- name: run integration tests
cache: 'pnpm'
- run: pnpm add -g pnpm
- run: pnpm install
- run: pnpm build
- name: run CI tests
env:
INCLUDE_POSTGRES_TESTS: true
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_PORT: 5432
run: yarn test:ci
- run: git diff -u yarn.lock
run: pnpm test:ci
- run: npx codecov
- run: git diff -u pnpm-lock.yaml

- name: setup git coordinates
run: |
Expand All @@ -71,16 +66,16 @@ jobs:
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
# npm whoami

- run: git diff -u yarn.lock
- run: git diff -u pnpm-lock.yaml

- name: publish @latest when on main
if: github.ref == 'refs/heads/main'
run: yarn publish:latest
run: pnpm publish:latest

- name: publish @next when on develop
if: github.ref == 'refs/heads/develop'
run: yarn publish:next
run: pnpm publish:next

- name: publish @unstable when on unstable branch
if: startsWith(github.ref, 'refs/heads/feat')
run: yarn publish:unstable
run: pnpm publish:unstable
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ test/*.js
/packages/vc-api-issuer/plugin.schema.json
/packages/vc-api-verifier/plugin.schema.json
/packages/connection-manager/plugin.schema.json
/packages/bls-key-manager/plugin.schema.json
/packages/key-manager/plugin.schema.json
/packages/ms-request-api/plugin.schema.json
55 changes: 33 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,54 @@
<!--suppress HtmlDeprecatedAttribute -->
<h1 align="center">
<br>
<a href="https://www.sphereon.com"><img src="https://sphereon.com/content/themes/sphereon/assets/img/logo.svg" alt="Sphereon" width="400"></a>
<br>Veramo BBS+ signature support
<br>Sphereon SSI SDK Crypto Extensions
<br>
</h1>

---

__Warning: These packages still is in a very early development stage. Breaking changes without notice will happen at this
point!__
# BBS+, RSA, JWK, EBSI DID and key management support

---
This mono repository, contains packages that add different crypto keys and signature suites as well as different DID
methods to the [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk). The packages are also compatible
with [Veramo](https://veramo.io).

## Key Management

| Plugin | Description |
|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Key Manager](./packages/key-manager) | The Key Manager orchestrates the various implementations of Key Management Systems, using a KeyStore to remember the link between a key reference, its metadata, and the respective key management system that provides the actual cryptographic capabilities. The methods of this plugin are used automatically by other plugins, such as DIDManager, CredentialPlugin, or DIDComm to perform their required cryptographic operations using the managed keys. You will need this version if you want to use BLS/BBS+ keys |
| [Local Key Management System](./packages/kms-local) | [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk) and [Veramo](https://veramo.io/) compatible Key Management System that stores keys in a local key store. It has support for RSA, BLS/BBS+ signatures, next to ed25519, es256k1, es256r1 |
| [Key Utils](./packages/key-utils) | [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk) and [Veramo](https://veramo.io/) compatible Key Utility and generation functions |
| [DID Utils](./packages/did-utils) | [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk) and [Veramo](https://veramo.io/) compatible DID functions |

# Veramo BBS+ signature support
## DID Methods

This is mono repository, with packages that add BBS+ signature support to [Veramo](https://veramo.io) modules. The packages are drop in replacements for Veramo packages:
The below packages can be used both in our [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk)
and [Veramo](https://veramo.io/). The below packages extend did:key and support did:jwk.

- bls-did-provider-key:
- DID Key provider with support for BBS+
- bls-did-resolver-key:
- DID Key resolver with support for BBS+
- bls-key-manager:
- Veramo Key provider with support for BBS+
- bls-kms-local:
- Veramo local KMS with support for BBS+
| DID methods | Description |
|-------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DIF did:key resolver](./packages/did-resolver-key) | [DIF DID resolver](https://github.com/decentralized-identity/did-resolver) compatible [did:key](https://w3c-ccg.github.io/did-method-key/) resolver with support for BLS/BBS+, JWK (EBSI natural persons), ed25519, es256k1, es256r1, es384r1, es521r1. |
| [did:key provider](./packages/did-provider-key) | [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk) and [Veramo](https://veramo.io/) compatible [did:key](https://w3c-ccg.github.io/did-method-key/) provider, allows you to manage keys and DIDs with support for BLS/BBS+, JWK (EBSI natural persons), ed25519, es256k1, es256r1, es384r1, es521r1 |
| [DIF did:jwk resolver](./packages/did-resolver-key) | [DIF DID resolver](https://github.com/decentralized-identity/did-resolver) compatible [did:jwk](https://github.com/quartzjer/did-jwk/blob/main/spec.md) resolver with support for ed25519, es256k1, es256r1, RSA keys. |
| [did:jwk provider](./packages/did-provider-jwk) | [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk) and [Veramo](https://veramo.io/) compatible [did:jwk](https://w3c-ccg.github.io/did-method-key/) provider, allows you to manage JWK keys and DIDs |
| [DIF did:ebsi resolver](./packages/did-resolver-ebsi) | [DIF DID resolver](https://github.com/decentralized-identity/did-resolver) compatible [did:ebsi](https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/EBSI+DID+Method) v1 Legal Entity resolver |
| [did:ebsi provider](./packages/did-provider-ebsi) | [SSI-SDK](https://github.com/Sphereon-Opensource/ssi-sdk) and [Veramo](https://veramo.io/) compatible [did:ebsi](https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/EBSI+DID+Method) v1 Legal Entity provider, allows you to manage ebsi v1 keys and DIDs |

## Building and testing

### Lerna

This package makes use of Lerna for managing multiple packages. Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and npm / yarn.
This package makes use of Lerna for managing multiple packages. Lerna is a tool that optimizes the workflow around
managing multi-package repositories with git and npm / pnpm.

### Build

The below command builds all packages for you using lerna
The below command builds all packages for you

```shell
yarn build
pnpm build
```

### Test
Expand All @@ -47,17 +58,17 @@ The test command runs:
* `jest`
* `coverage`

You can also run only a single section of these tests, using for example `yarn test:watch`.
You can also run only a single section of these tests, using for example `pnpm test:watch`.

```shell
yarn test
pnpm test
```

### Utility scripts

There are other utility scripts that help with development.

* `yarn prettier` - runs `prettier` to fix code style.
* `pnpm prettier` - runs `prettier` to fix code style.

### Publish

Expand All @@ -68,5 +79,5 @@ There are scripts that can publish the following versions:
* `unstable`

```shell
yarn publish:[version]
pnpm publish:[version]
```
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
plugins: ['@babel/plugin-transform-modules-commonjs', [
'@babel/plugin-transform-runtime',
{
regenerator: true,
},
]],
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript'
]
}
6 changes: 5 additions & 1 deletion jest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
"tsconfig": "./packages/tsconfig-base.json"
}]
},
"transformIgnorePatterns": [
"node_modules/(?!(?:.pnpm/)?(nist-weierstrauss|multiformatsgggggg))"
],
"testMatch": [
"**/__tests__/**/*.test.*"
"**/__tests__/**/*.test.*",
"!**/__tests__/**/*.test.*.snap"
],
"testEnvironment": "node",
"automock": false,
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"packages": ["packages/*"],
"version": "0.10.2",
"npmClient": "yarn",
"npmClient": "pnpm",
"command": {
"publish": {
"allowBranch": ["main", "master"],
Expand Down
74 changes: 39 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
{
"name": "@sphereon/veramo-BBS-workspace",
"name": "@sphereon/ssi-sdk-ext.workspace",
"private": true,
"version": "0.10.0",
"description": "Sphereon Veramo BBS+ signature support (Workspace)",
"version": "0.10.2",
"description": "Sphereon Crypto Extensions (BBS+/EBSI) signature support (Workspace)",
"repository": "[email protected]:Sphereon-Opensource/veramo-BBS.git",
"author": "Sphereon <[email protected]>",
"license": "Apache-2.0",
"scripts": {
"build": "lerna run build && yarn build:copyfiles && yarn build:schema-api",
"build:schema-api": "lerna run extract-api && lerna run generate-plugin-schema",
"build:copyfiles": "lerna run build:copyfiles",
"preinstall": "npx only-allow pnpm",
"build": "pnpm build:js && pnpm build:copyfiles && pnpm build:api && pnpm build:schema",
"build:js": "pnpm -r --stream build",
"build:api": "pnpm --package=@veramo/cli -c dlx \"pnpm -r --stream extract-api\"",
"build:schema": "pnpm --package=@veramo/cli -c dlx \"pnpm -r --stream generate-plugin-schema\"",
"build:copyfiles": "pnpm -r --stream build:copyfiles",
"bootstrap": "lerna bootstrap",
"test:ci": "jest --config=jest.json",
"test": "jest --verbose --config=jest.json --coverage=true --detectOpenHandles",
"test:watch": "yarn test --watch --verbose",
"test:watch": "pnpm test --watch --verbose",
"test:lint": "eslint . --ext .ts",
"prettier": "prettier --write \"{packages,__tests__,!dist}/**/*.{ts,tsx,js,json,md,yml}\"",
"build-clean": "rimraf ./packages/*/dist ./packages/*/api ./packages/*/node_modules ./packages/*/tsconfig.tsbuildinfo && jest --clearCache",
"build-clean": "rimraf --glob ./packages/*/dist ./packages/*/api ./packages/*/node_modules ./packages/*/tsconfig.tsbuildinfo ./node_modules ./coverage && jest --clearCache",
"publish:latest": "lerna publish --conventional-commits --include-merged-tags --create-release github --yes --dist-tag latest --registry https://registry.npmjs.org",
"publish:next": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes --registry https://registry.npmjs.org",
"publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org",
"postinstall": "patch-package"
},
"workspaces": {
"nohoist": [
"**disabled-replace-by-package-names**"
],
"packages": [
"./packages/*"
]
"publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org"
},
"publishConfig": {
"access": "public"
Expand All @@ -43,35 +37,40 @@
]
},
"devDependencies": {
"@microsoft/api-documenter": "^7.21.5",
"@babel/cli": "^7.21.0",
"@babel/core": "^7.21.4",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/preset-typescript": "^7.21.4",
"@babel/runtime": "^7.21.0",
"@microsoft/api-documenter": "^7.21.7",
"@microsoft/api-extractor": "^7.34.4",
"@microsoft/api-extractor-model": "^7.26.4",
"@types/jest": "^29.4.0",
"@types/node": "^18.15.0",
"@types/debug": "^4.1.7",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@types/jest": "^29.4.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"codecov": "^3.8.3",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"jest": "^29.5.0",
"jest-fetch-mock": "^3.0.3",
"json-schema": "^0.4.0",
"lerna": "^6.5.1",
"lerna": "^6.6.1",
"lerna-changelog": "^2.2.0",
"oas-resolver": "^2.5.6",
"openapi-types": "^12.1.0",
"prettier": "^2.8.4",
"prettier": "^2.8.7",
"pretty-quick": "^3.1.3",
"rimraf": "^4.4.0",
"semantic-release": "^19.0.5",
"ts-jest": "^29.0.5",
"rimraf": "^5.0.0",
"semantic-release": "^21.0.1",
"ts-jest": "^29.1.0",
"ts-json-schema-generator": "^1.2.0",
"ts-node": "^10.9.1",
"typescript": "4.9.5",
"patch-package": "^6.5.1"
"typescript": "4.9.5"
},
"resolutions": {
"@veramo/core": "4.2.0",
Expand All @@ -95,9 +94,9 @@
"@veramo/remote-server": "4.2.0",
"@veramo/selective-disclosure": "4.2.0",
"@veramo/url-handler": "4.2.0",
"**/@digitalcredentials/ed25519-verification-key-2020": "3.2.2",
"**/jsonld" : "npm:@digitalcredentials/jsonld@^5.2.1",
"**/isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto"
"@digitalcredentials/ed25519-verification-key-2020": "3.2.2",
"jsonld": "npm:@digitalcredentials/jsonld@^5.2.1",
"isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto"
},
"engines": {
"node": ">= 16.0.0"
Expand All @@ -107,5 +106,10 @@
"semi": false,
"singleQuote": true,
"printWidth": 150
},
"pnpm": {
"patchedDependencies": {
"@veramo/[email protected]": "patches/@[email protected]"
}
}
}
Loading

0 comments on commit a09809c

Please sign in to comment.