diff --git a/README.md b/README.md index d52d85e..8b62b76 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,28 @@ -# waardepapieren +# Waardepapieren -project for consortium of municipalities digitizing PoE services +This project provides a full implementation example of how Discipl components can be used to issue and +verify claims. In particular, how municipalities can issue -the project aims at a W3C verifiable credential compatible (or alike) solution based on discipl core for proving all kinds of facts atested for by an issuer (with a focus on municipalities as issuer). -# Running +## Running + +Running the applications is easiest done using docker-compose. -Running the applications is easiest done using docker-compose. Simply run `docker-compose up`. This will start 3 applications: - clerk-frontend - waardepapieren-service, with embedded ephemeral-server -- nlx-mock, which mocks an NLX API, such that development can be done independently - -components: - -- client-frontend : frontend webapplication (js) embedded in the my-environment provided by the municipality, which connects to a discipl node to retrieve a needed proof. -- clerk-frontend : frontend webapplication (js) which connects to a discipl node to retrieve a needed proof of a selected person (by referring to a BSN). -- authorization-backend : simple serverside authorization script that enables access to the abundance service that delivers certain proofs to a given ssid (authenticated for the my-environment, or being a clerk) -- validator-frontend : frontend webapplication (js) that can validate a proof -- dashboard -- revoke-service -- waardepapieren-service - -these components might involve the following components from the discipl software stack: - -- discipl-abundance-service -- discipl-4sacan -- discipl-expo -- discipl-rshiny -- discipl-core -- discipl-core-restapi -- discipl-core-node -- discipl-core-paper -- discipl-core-nlx -- discipl-core-iota -- discipl-core-ipfs -- discipl-core-irma - -architectural primer : https://docs.google.com/presentation/d/1sw7xi2UbmxRN3NBwQTn9kWw6-RNhygdRL5kccnZWUyE +- nlx-mock, which is an nlx-outway that provides access to a mock BRP service + +Note that the nlx-mock and waardepapieren-service need a valid certificate for the demo NLX environment. + +1. Generate certificates as described [here](https://docs.nlx.io/get-started/create-certificates/) +2. Run `docker-compose up` + +Alternatively, you can use an offline mock, which replicates the NLX environment. + +1. Run `docker-compose -f docker-compose-travis.yml up` + + + + diff --git a/clerk-frontend/package-lock.json b/clerk-frontend/package-lock.json index 77c23a7..73a0491 100644 --- a/clerk-frontend/package-lock.json +++ b/clerk-frontend/package-lock.json @@ -1040,20 +1040,23 @@ } }, "@discipl/core-ephemeral": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@discipl/core-ephemeral/-/core-ephemeral-0.6.2.tgz", - "integrity": "sha512-4NRSzcB+86mdLEzAqajvynP+7g/DjktKdsuxZs2uGUIM2Zvxe9/1zT5vT23tK2NsgUzvVgPGtM3qebVd8lN7ow==", + "version": "file:../../../packages/discipl-core-ephemeral-0.7.0.tgz", + "integrity": "sha512-bYMSIlh8LMeMrtPDyKiHm0Fn2iBi+9fTaKa2NpYVyd5U4j4E4VBYFSGbRUeyldsJhJdnJMr5JnelL+F+zZFNTQ==", "requires": { "@discipl/core-baseconnector": "^0.2.1", "axios": "^0.18.0", "express": "^4.16.4", "json-stable-stringify": "^1.0.1", + "node-forge": "^0.8.2", "rxjs": "^6.4.0", - "tweetnacl": "^1.0.1", - "tweetnacl-util": "^0.15.0", "ws": "^6.1.4" }, "dependencies": { + "node-forge": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.2.tgz", + "integrity": "sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg==" + }, "ws": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", @@ -3104,6 +3107,7 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -6458,6 +6462,487 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz", + "integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==", + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "optional": true + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -14631,6 +15116,7 @@ "eslint-plugin-react": "7.12.4", "file-loader": "2.0.0", "fs-extra": "7.0.1", + "fsevents": "1.2.4", "html-webpack-plugin": "4.0.0-alpha.2", "identity-obj-proxy": "3.0.0", "jest": "23.6.0", @@ -14655,6 +15141,489 @@ "webpack-dev-server": "3.1.14", "webpack-manifest-plugin": "2.0.4", "workbox-webpack-plugin": "3.6.3" + }, + "dependencies": { + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "optional": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "optional": true + } + } + } } }, "read-pkg": { @@ -15378,6 +16347,7 @@ "capture-exit": "^1.2.0", "exec-sh": "^0.2.0", "fb-watchman": "^2.0.0", + "fsevents": "^1.2.3", "micromatch": "^3.1.4", "minimist": "^1.1.1", "walker": "~1.0.5", @@ -16852,16 +17822,6 @@ "safe-buffer": "^5.0.1" } }, - "tweetnacl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz", - "integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==" - }, - "tweetnacl-util": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.0.tgz", - "integrity": "sha1-RXbBzuXi1j0gf+5S8boCgZSAvHU=" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", diff --git a/clerk-frontend/package.json b/clerk-frontend/package.json index 14768ce..6d6f3e7 100644 --- a/clerk-frontend/package.json +++ b/clerk-frontend/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@discipl/abundance-service": "^0.4.1", - "@discipl/core-ephemeral": "^0.6.2", + "@discipl/core-ephemeral": "file:../../../packages/discipl-core-ephemeral-0.7.0.tgz", "@discipl/paper-wallet": "^0.5.0", "react": "^16.8.6", "react-dom": "^16.8.6", diff --git a/docker-compose.yml b/docker-compose.yml index 6a33b73..6c2a3a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ version: '3' services: waardepapieren-service: + volumes: + - ./waardepapieren-service/system-test/certs:/certs:ro build: waardepapieren-service/. links: - mock-nlx @@ -20,7 +22,7 @@ services: mock-nlx: image: nlxio/outway:latest volumes: - - ./waardepapieren-service/system-test/certs:/certs + - ./waardepapieren-service/system-test/certs:/certs:ro environment: - DIRECTORY_INSPECTION_ADDRESS=directory-inspection-api.demo.nlx.io:443 - TLS_NLX_ROOT_CERT=/certs/root.crt diff --git a/waardepapieren-service/configuration/wpsvc.json b/waardepapieren-service/configuration/wpsvc.json index 4a9d464..5b06f54 100644 --- a/waardepapieren-service/configuration/wpsvc.json +++ b/waardepapieren-service/configuration/wpsvc.json @@ -2,6 +2,8 @@ "EPHEMERAL_ENDPOINT" : "http://localhost:3232", "EPHEMERAL_WEBSOCKET_ENDPOINT" : "ws://localhost:3233", "NLX_OUTWAY_ENDPOINT" : "http://localhost:4080", + "NLX_CERT": "/certs/org.crt", + "NLX_KEY": "/certs/org.key", "PRODUCT_NEED" : "BRP_UITTREKSEL_NEED", "SOURCE_NLX_PATH" : "/brp/basisregistratie/natuurlijke_personen/bsn/{BSN}", "SOURCE_ARGUMENT" : "BSN", diff --git a/waardepapieren-service/package-lock.json b/waardepapieren-service/package-lock.json index 1f1fb66..38f5733 100644 --- a/waardepapieren-service/package-lock.json +++ b/waardepapieren-service/package-lock.json @@ -1036,17 +1036,15 @@ } }, "@discipl/core-ephemeral": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@discipl/core-ephemeral/-/core-ephemeral-0.6.2.tgz", - "integrity": "sha512-4NRSzcB+86mdLEzAqajvynP+7g/DjktKdsuxZs2uGUIM2Zvxe9/1zT5vT23tK2NsgUzvVgPGtM3qebVd8lN7ow==", + "version": "file:../../../packages/discipl-core-ephemeral-0.7.0.tgz", + "integrity": "sha512-bYMSIlh8LMeMrtPDyKiHm0Fn2iBi+9fTaKa2NpYVyd5U4j4E4VBYFSGbRUeyldsJhJdnJMr5JnelL+F+zZFNTQ==", "requires": { "@discipl/core-baseconnector": "^0.2.1", "axios": "^0.18.0", "express": "^4.16.4", "json-stable-stringify": "^1.0.1", + "node-forge": "^0.8.2", "rxjs": "^6.4.0", - "tweetnacl": "^1.0.1", - "tweetnacl-util": "^0.15.0", "ws": "^6.1.4" }, "dependencies": { @@ -2832,16 +2830,16 @@ "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.40.0" } }, "mimic-fn": { @@ -2993,6 +2991,11 @@ "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==", "dev": true }, + "node-forge": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.2.tgz", + "integrity": "sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg==" + }, "node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -5011,16 +5014,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, - "tweetnacl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz", - "integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==" - }, - "tweetnacl-util": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.0.tgz", - "integrity": "sha1-RXbBzuXi1j0gf+5S8boCgZSAvHU=" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", diff --git a/waardepapieren-service/package.json b/waardepapieren-service/package.json index 811a907..2d51e70 100644 --- a/waardepapieren-service/package.json +++ b/waardepapieren-service/package.json @@ -19,7 +19,7 @@ "@babel/preset-env": "^7.4.3", "@babel/register": "^7.4.0", "@discipl/abundance-service": "^0.4.1", - "@discipl/core-ephemeral": "^0.6.2", + "@discipl/core-ephemeral": "file:../../../packages/discipl-core-ephemeral-0.7.0.tgz", "@discipl/core-nlx": "~0.2.0", "babel-plugin-dynamic-import-node": "^2.2.0", "jsonpath": "^1.0.1", diff --git a/waardepapieren-service/src/waardepapieren-service.js b/waardepapieren-service/src/waardepapieren-service.js index e414d89..cb3acb9 100644 --- a/waardepapieren-service/src/waardepapieren-service.js +++ b/waardepapieren-service/src/waardepapieren-service.js @@ -4,6 +4,7 @@ import EphemeralServer from '@discipl/core-ephemeral/dist/EphemeralServer' import { take } from 'rxjs/operators' import { w3cwebsocket } from 'websocket' import jp from 'jsonpath' +import fs from 'fs' class WaardenpapierenService { async start (configuration) { @@ -16,13 +17,18 @@ class WaardenpapierenService { const ephemeralConnector = await core.getConnector('ephemeral') ephemeralConnector.configure(this.configuration.EPHEMERAL_ENDPOINT, this.configuration.EPHEMERAL_WEBSOCKET_ENDPOINT, w3cwebsocket) + let nlxCert = fs.readFileSync(this.configuration.NLX_CERT) + let nlxKey = fs.readFileSync(this.configuration.NLX_KEY) + + let nlxEphemeralIdentity = await ephemeralConnector.newIdentity({ 'cert': nlxCert, 'privkey': nlxKey }) + const nlxConnector = await core.getConnector('nlx') nlxConnector.configure(this.configuration.NLX_OUTWAY_ENDPOINT) let attendResult = await abundance.attendTo('ephemeral', this.configuration.PRODUCT_NEED, [this.configuration.SOURCE_ARGUMENT]) // TODO: Refactor to observableResult.subscribe when fix from core propagates await attendResult.observableResult._observable.subscribe(async (need) => { - await this.serveNeed(need) + await this.serveNeed(need, nlxEphemeralIdentity) }, (e) => { // If connection is dropped by remote peer, this is fine if (e.code !== 1006) { @@ -33,7 +39,7 @@ class WaardenpapierenService { await attendResult.observableResult._readyPromise } - async serveNeed (need) { + async serveNeed (need, nlxIdentity) { let core = abundance.getCoreAPI() let needDetails = await need @@ -47,7 +53,6 @@ class WaardenpapierenService { let result = await nlxConnector.get(identifier) - let privateSvcSsid = await core.newSsid('ephemeral') // needs signing with NLX key let resultArray = [{'Doel':this.configuration.PRODUCT_PURPOSE}] for (let field in this.configuration.SOURCE_DATA_SELECTION) { @@ -58,9 +63,9 @@ class WaardenpapierenService { resultArray.push({ [key]: value[0] }) } - let productClaim = await core.claim(privateSvcSsid, resultArray) + let productClaim = await core.claim(nlxIdentity, resultArray) - await core.allow(privateSvcSsid, productClaim, needDetails.theirPrivateDid) + await core.allow(nlxIdentity, productClaim, needDetails.theirPrivateDid) await abundance.offer(needDetails.myPrivateSsid, productClaim) } diff --git a/waardepapieren-service/system-test/index.spec.js b/waardepapieren-service/system-test/index.spec.js index 1551b53..e944676 100644 --- a/waardepapieren-service/system-test/index.spec.js +++ b/waardepapieren-service/system-test/index.spec.js @@ -21,6 +21,10 @@ describe('waardenpapieren-service', function () { // Set up server let waardenpapierenService = new WaardenpapierenService() await timeoutPromise(100) + + CONFIGURATION.NLX_CERT='./system-test/certs/org.crt' + CONFIGURATION.NLX_KEY='./system-test/certs/org.key' + let serviceSsid = await waardenpapierenService.start(CONFIGURATION) await timeoutPromise(100) let ephemeralConnector = await abundance.getCoreAPI().getConnector('ephemeral') diff --git a/waardepapieren-service/test/index.spec.js b/waardepapieren-service/test/index.spec.js index 6923917..f70a74a 100644 --- a/waardepapieren-service/test/index.spec.js +++ b/waardepapieren-service/test/index.spec.js @@ -28,6 +28,9 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi abundance.getCoreAPI().registerConnector('nlx', nlxConnector) + CONFIGURATION.NLX_CERT='./system-test/certs/org.crt' + CONFIGURATION.NLX_KEY='./system-test/certs/org.key' + // Set up server let waardenpapierenService = new WaardenpapierenService() await waardenpapierenService.start(CONFIGURATION)