From a455983f211c64bc3860775848f4d0af0a5caa36 Mon Sep 17 00:00:00 2001 From: Pim Otte Date: Tue, 16 Apr 2019 11:08:19 +0200 Subject: [PATCH 1/5] Functional, but racey problem still present in test --- waardepapieren-service/package-lock.json | 73 +++++++++++------- waardepapieren-service/package.json | 4 +- .../src/waardepapieren-service.js | 62 +++++++-------- waardepapieren-service/test/index.spec.js | 76 +++++++------------ 4 files changed, 105 insertions(+), 110 deletions(-) diff --git a/waardepapieren-service/package-lock.json b/waardepapieren-service/package-lock.json index 846ab26..1eb7e7a 100644 --- a/waardepapieren-service/package-lock.json +++ b/waardepapieren-service/package-lock.json @@ -989,20 +989,41 @@ } }, "@discipl/abundance-service": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@discipl/abundance-service/-/abundance-service-0.3.0.tgz", - "integrity": "sha512-BhNa0HfGBRHB8xCvXpyaVE5LyTsJjn1yE/4vsnRSa7C2Tut7qlTbZoBLUtUoTVOcnbnmDQS7v0UC5Fc4asW4yA==", + "version": "file:../../../packages/discipl-abundance-service-0.4.0.tgz", + "integrity": "sha512-hm1QOS5UseP0RLpBs06woAKpJSTu3UbIJvtv4VYqGVK5Qeo4jer5dg2jsRA1q2ABx4Bmgzks7m9WeFEBezYiWg==", "requires": { - "@discipl/core": "~0.7.0", + "@discipl/core": "^0.11.1", + "@discipl/core-baseconnector": "^0.2.1", "rxjs": "^6.4.0" + }, + "dependencies": { + "@discipl/core-baseconnector": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discipl/core-baseconnector/-/core-baseconnector-0.2.1.tgz", + "integrity": "sha512-4E8kLE/p5FpGVfr1wCvaTeHLO2/aLyLYYb1ieHeg73CeSXVJIQJDhtyVISDfTR/tr9o4LiYVrtpK2BaXHYi8Xw==", + "requires": { + "json-stable-stringify": "^1.0.1" + } + } } }, "@discipl/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discipl/core/-/core-0.7.0.tgz", - "integrity": "sha512-CvJur9DHIzXD0QANr43EpLX/Waegi3d7q1wiKmKy2S8/56WzLycQoM3PZKnWqovANM1DiSSjyyV3rniTZBNhPA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@discipl/core/-/core-0.11.1.tgz", + "integrity": "sha512-hVCVz4K3RbDrJnfmTGUTJNmGG4pXVXi8hVszp7d6PqUW3fqNLlmbsEfa45SQcL3yopGtr6KS66E3zf6WUQJoyQ==", "requires": { + "@discipl/core-baseconnector": "^0.2.1", "rxjs": "^6.4.0" + }, + "dependencies": { + "@discipl/core-baseconnector": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discipl/core-baseconnector/-/core-baseconnector-0.2.1.tgz", + "integrity": "sha512-4E8kLE/p5FpGVfr1wCvaTeHLO2/aLyLYYb1ieHeg73CeSXVJIQJDhtyVISDfTR/tr9o4LiYVrtpK2BaXHYi8Xw==", + "requires": { + "json-stable-stringify": "^1.0.1" + } + } } }, "@discipl/core-baseconnector": { @@ -1014,11 +1035,10 @@ } }, "@discipl/core-ephemeral": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discipl/core-ephemeral/-/core-ephemeral-0.4.0.tgz", - "integrity": "sha512-8bX2zCiZXsYgY4/4lgMIGJLTcjtdpMhJLEK+q3lFBRWgs2ziuO72ITNv0MmAPkf1RAg5pXgRGApFGr8rqAj8RA==", + "version": "file:../../../packages/discipl-core-ephemeral-0.6.1.tgz", + "integrity": "sha512-SvGCKtXx9Ln7CbNHKSjLIOzSCH+pgK0ZgVVtuiwD5Fp9YzDj8Kfl8VYEe3AGP/wF0Bm45LZB3F+kwEPsDBGQOg==", "requires": { - "@discipl/core-baseconnector": "0.2.0", + "@discipl/core-baseconnector": "^0.2.1", "axios": "^0.18.0", "express": "^4.16.4", "json-stable-stringify": "^1.0.1", @@ -1028,12 +1048,12 @@ "ws": "^6.1.4" }, "dependencies": { - "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "@discipl/core-baseconnector": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discipl/core-baseconnector/-/core-baseconnector-0.2.1.tgz", + "integrity": "sha512-4E8kLE/p5FpGVfr1wCvaTeHLO2/aLyLYYb1ieHeg73CeSXVJIQJDhtyVISDfTR/tr9o4LiYVrtpK2BaXHYi8Xw==", "requires": { - "async-limiter": "~1.0.0" + "json-stable-stringify": "^1.0.1" } } } @@ -2810,16 +2830,16 @@ "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" }, "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", "requires": { - "mime-db": "~1.37.0" + "mime-db": "~1.38.0" } }, "mimic-fn": { @@ -4149,9 +4169,9 @@ } }, "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-exists": { "version": "3.0.0", @@ -5170,7 +5190,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, "requires": { "async-limiter": "~1.0.0" } diff --git a/waardepapieren-service/package.json b/waardepapieren-service/package.json index 6e65afd..893d41e 100644 --- a/waardepapieren-service/package.json +++ b/waardepapieren-service/package.json @@ -18,8 +18,8 @@ "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", "@babel/register": "^7.4.0", - "@discipl/abundance-service": "~0.3.0", - "@discipl/core-ephemeral": "^0.4.0", + "@discipl/abundance-service": "file:../../../packages/discipl-abundance-service-0.4.0.tgz", + "@discipl/core-ephemeral": "file:../../../packages/discipl-core-ephemeral-0.6.1.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 8104e14..d7410c6 100644 --- a/waardepapieren-service/src/waardepapieren-service.js +++ b/waardepapieren-service/src/waardepapieren-service.js @@ -18,10 +18,10 @@ class WaardenpapierenService { const nlxConnector = await core.getConnector('nlx') nlxConnector.configure(this.configuration.NLX_OUTWAY_ENDPOINT) - let ssid = await abundance.attendTo('ephemeral', this.configuration.PRODUCT_NEED) - let observer = await abundance.observe(ssid.did, 'ephemeral') - observer.subscribe(async (needClaim) => { - await this.serveNeed(ssid, needClaim) + let attendResult = await abundance.attendTo('ephemeral', this.configuration.PRODUCT_NEED, [this.configuration.SOURCE_ARGUMENT]) + + await attendResult.observableResult.subscribe(async (need) => { + await this.serveNeed(need) }, (e) => { // If connection is dropped by remote peer, this is fine if (e.code !== 1006) { @@ -29,47 +29,43 @@ class WaardenpapierenService { console.error(e) } }) - - return ssid } - async serveNeed (serviceSsid, need) { - const core = abundance.getCoreAPI() + async serveNeed (need) { + console.log("Serving need") + let core = abundance.getCoreAPI() - let did = need.did + let needDetails = await need + console.log("Got needDetails") + console.log(needDetails) + let argumentClaim = await needDetails.informationPromise - const observer = await core.observe(did, { [this.configuration.SOURCE_ARGUMENT]: null }) + console.log("Querying NLX") - await observer.pipe(take(1)).subscribe(async (argumentClaim) => { - const srcarg = argumentClaim['claim']['data'][this.configuration.SOURCE_ARGUMENT] - const nlxConnector = await core.getConnector('nlx') - let nlxpath = this.configuration.SOURCE_NLX_PATH.replace('{'+this.configuration.SOURCE_ARGUMENT+'}', srcarg) - let identifier = await nlxConnector.claim(null, { 'path': nlxpath, 'params': {[this.configuration.SOURCE_ARGUMENT]:srcarg} }) + let srcarg = argumentClaim['claim']['data'][this.configuration.SOURCE_ARGUMENT] - let result = await nlxConnector.get(identifier) + const nlxConnector = await core.getConnector('nlx') + let nlxpath = this.configuration.SOURCE_NLX_PATH.replace('{'+this.configuration.SOURCE_ARGUMENT+'}', srcarg) + let identifier = await nlxConnector.claim(null, { 'path': nlxpath, 'params': {[this.configuration.SOURCE_ARGUMENT]:srcarg} }) - let privateSvcSsid = await core.newSsid('ephemeral') // needs signing with NLX key - let resultArray = [{'Doel':this.configuration.PRODUCT_PURPOSE}] + let result = await nlxConnector.get(identifier) - for (let field in this.configuration.SOURCE_DATA_SELECTION) { - let key = Object.keys(this.configuration.SOURCE_DATA_SELECTION[field])[0] - let path = this.configuration.SOURCE_DATA_SELECTION[field][key] - let value = jp.query(result, path) + let privateSvcSsid = await core.newSsid('ephemeral') // needs signing with NLX key + let resultArray = [{'Doel':this.configuration.PRODUCT_PURPOSE}] - resultArray.push({ [key]: value[0] }) - } + for (let field in this.configuration.SOURCE_DATA_SELECTION) { + let key = Object.keys(this.configuration.SOURCE_DATA_SELECTION[field])[0] + let path = this.configuration.SOURCE_DATA_SELECTION[field][key] + let value = jp.query(result, path) - let productClaim = await core.claim(privateSvcSsid, resultArray) - await abundance.match(privateSvcSsid, did) + resultArray.push({ [key]: value[0] }) + } - const acceptObserver = await core.observe(did, { [this.configuration.PRODUCT_ACCEPT]: null }) + let productClaim = await core.claim(privateSvcSsid, resultArray) - acceptObserver.pipe(take(1)).subscribe(async (acceptClaim) => { - await core.attest(privateSvcSsid, this.configuration.PRODUCT_NAME, productClaim) - }) - }, (e) => { - console.error(e) - }) + await core.allow(privateSvcSsid, productClaim, needDetails.theirPrivateDid) + + await abundance.offer(needDetails.myPrivateSsid, productClaim) } async stop () { diff --git a/waardepapieren-service/test/index.spec.js b/waardepapieren-service/test/index.spec.js index d80bea6..dba4c7c 100644 --- a/waardepapieren-service/test/index.spec.js +++ b/waardepapieren-service/test/index.spec.js @@ -30,7 +30,6 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi // Set up server let waardenpapierenService = new WaardenpapierenService() - await timeoutPromise(100) await waardenpapierenService.start(CONFIGURATION) await timeoutPromise(100) @@ -40,64 +39,45 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi expect(nlxConfigureSpy.callCount).to.equal(1) expect(nlxConfigureSpy.args[0]).to.deep.equal([CONFIGURATION.NLX_OUTWAY_ENDPOINT]) - await timeoutPromise(100) - let needSsid = await abundance.need('ephemeral', CONFIGURATION.PRODUCT_NEED) - await timeoutPromise(100) - let matchPromise = (await abundance.observe(needSsid.did, 'ephemeral')).pipe(take(1)).toPromise() - await timeoutPromise(100) + // Set up need + let need = await abundance.need('ephemeral', CONFIGURATION.PRODUCT_NEED) - await abundance.getCoreAPI().claim(needSsid, { [CONFIGURATION.SOURCE_ARGUMENT]: '123123123' }) - await timeoutPromise(100) - let match = await matchPromise + let serviceInformation = await need.serviceInformationPromise - await timeoutPromise(100) - expect(Object.keys(match.claim.data)).to.include(abundance.ABUNDANCE_SERVICE_MATCH_PREDICATE) + console.log("SERV INFO") + console.log(serviceInformation) + console.log(need) - // Test observations - expect(nlxClaimStub.callCount).to.equal(1) - expect(nlxClaimStub.args[0]).to.deep.equal([null, { 'path': '/brp/basisregistratie/natuurlijke_personen/bsn/123123123', 'params': {'BSN':'123123123'} }]) - expect(nlxGetStub.callCount).to.equal(1) - expect(nlxGetStub.args[0]).to.deep.equal(['claimId']) + console.log("Observing offer") + let resultPromise = abundance.observeOffer(need.theirPrivateDid, need.myPrivateSsid) - let personalDid = match.did + await abundance.getCoreAPI().claim(need.myPrivateSsid, {[CONFIGURATION.SOURCE_ARGUMENT]: '123123123'}) - let brpPromise = (await abundance.getCoreAPI().observe(personalDid, {}, true)).pipe(take(1)).toPromise() - let brp = await brpPromise + let result = await resultPromise - expect(brp).to.deep.equal({ - 'claim': { - 'data': [ - {'Doel': 'Bewijs verblijfadres in woonplaats'}, - {'Burgerservicenummer (BSN)': '123123123'}, - {'Woonplaats verblijfadres': 'Haarlem'} - ], - 'previous': null - }, - 'did': personalDid + expect(result).to.deep.equal({ + "data": [ + { + "Doel": "Bewijs verblijfadres in woonplaats" + }, + { + "Burgerservicenummer (BSN)": "123123123" + }, + { + "Woonplaats verblijfadres": "Haarlem" + } + ], + "previous": null }) - let agreePromise = (await abundance.getCoreAPI().observe(personalDid, { [CONFIGURATION.PRODUCT_NAME]: null })).pipe(take(1)).toPromise() - - // Accept and follow references - await abundance.getCoreAPI().claim(needSsid, { [CONFIGURATION.PRODUCT_ACCEPT]: '' }) - - let agree = await agreePromise - - expect(agree.claim.data[CONFIGURATION.PRODUCT_NAME]).to.be.a('string') - - let brpClaimLink = agree.claim.data[CONFIGURATION.PRODUCT_NAME] - - //let attestation = await abundance.getCoreAPI().get(attestationLink) - - //expect(attestation.data[CONFIGURATION.PRODUCT_NAME]).to.be.a('string') - - //let brpClaimLink = attestation.data[CONFIGURATION.PRODUCT_NAME] - - let brpClaim = await abundance.getCoreAPI().get(brpClaimLink) + // Test observations + expect(nlxClaimStub.callCount).to.equal(1) + expect(nlxClaimStub.args[0]).to.deep.equal([null, { 'path': '/brp/basisregistratie/natuurlijke_personen/bsn/123123123', 'params': {'BSN':'123123123'} }]) + expect(nlxGetStub.callCount).to.equal(1) + expect(nlxGetStub.args[0]).to.deep.equal(['claimId']) - expect(brp.claim.data).to.deep.equal(brpClaim.data) await waardenpapierenService.stop() }) From fc00609cfe5d29903f8c569ce445717ed790bea2 Mon Sep 17 00:00:00 2001 From: Pim Otte Date: Tue, 16 Apr 2019 15:22:59 +0200 Subject: [PATCH 2/5] WIP: Fixing async bugs --- waardepapieren-service/package-lock.json | 6 +++--- waardepapieren-service/package.json | 2 +- waardepapieren-service/test/index.spec.js | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/waardepapieren-service/package-lock.json b/waardepapieren-service/package-lock.json index 1eb7e7a..949671c 100644 --- a/waardepapieren-service/package-lock.json +++ b/waardepapieren-service/package-lock.json @@ -989,10 +989,10 @@ } }, "@discipl/abundance-service": { - "version": "file:../../../packages/discipl-abundance-service-0.4.0.tgz", - "integrity": "sha512-hm1QOS5UseP0RLpBs06woAKpJSTu3UbIJvtv4VYqGVK5Qeo4jer5dg2jsRA1q2ABx4Bmgzks7m9WeFEBezYiWg==", + "version": "file:../../../packages/discipl-abundance-service-0.4.1.tgz", + "integrity": "sha512-yiqaedJbVBSgN2dZHzMtCoHLYBUpkyXYzg5lF93TIr+a0zZ82u4tVcfq8VqUoeDuC0DQdFCx4E999viK+Lc04A==", "requires": { - "@discipl/core": "^0.11.1", + "@discipl/core": "^0.11.0", "@discipl/core-baseconnector": "^0.2.1", "rxjs": "^6.4.0" }, diff --git a/waardepapieren-service/package.json b/waardepapieren-service/package.json index 893d41e..fe45df7 100644 --- a/waardepapieren-service/package.json +++ b/waardepapieren-service/package.json @@ -18,7 +18,7 @@ "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", "@babel/register": "^7.4.0", - "@discipl/abundance-service": "file:../../../packages/discipl-abundance-service-0.4.0.tgz", + "@discipl/abundance-service": "file:../../../packages/discipl-abundance-service-0.4.1.tgz", "@discipl/core-ephemeral": "file:../../../packages/discipl-core-ephemeral-0.6.1.tgz", "@discipl/core-nlx": "~0.2.0", "babel-plugin-dynamic-import-node": "^2.2.0", diff --git a/waardepapieren-service/test/index.spec.js b/waardepapieren-service/test/index.spec.js index dba4c7c..0dd98fb 100644 --- a/waardepapieren-service/test/index.spec.js +++ b/waardepapieren-service/test/index.spec.js @@ -43,19 +43,18 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi // Set up need let need = await abundance.need('ephemeral', CONFIGURATION.PRODUCT_NEED) - let serviceInformation = await need.serviceInformationPromise - console.log("SERV INFO") - console.log(serviceInformation) + console.log(need.serviceInformation) console.log(need) console.log("Observing offer") - let resultPromise = abundance.observeOffer(need.theirPrivateDid, need.myPrivateSsid) + let observeOffer = await abundance.observeOffer(need.theirPrivateDid, need.myPrivateSsid) + await observeOffer.readyPromise await abundance.getCoreAPI().claim(need.myPrivateSsid, {[CONFIGURATION.SOURCE_ARGUMENT]: '123123123'}) - let result = await resultPromise + let result = await observeOffer.resultPromise expect(result).to.deep.equal({ "data": [ From 9b534d38d4dca31c90e3289d191e6de7368e72c1 Mon Sep 17 00:00:00 2001 From: Pim Otte Date: Wed, 17 Apr 2019 09:42:57 +0200 Subject: [PATCH 3/5] Update to released ephemeral version --- waardepapieren-service/package-lock.json | 19 ++++++++++--------- waardepapieren-service/package.json | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/waardepapieren-service/package-lock.json b/waardepapieren-service/package-lock.json index 949671c..9986ef9 100644 --- a/waardepapieren-service/package-lock.json +++ b/waardepapieren-service/package-lock.json @@ -990,7 +990,7 @@ }, "@discipl/abundance-service": { "version": "file:../../../packages/discipl-abundance-service-0.4.1.tgz", - "integrity": "sha512-yiqaedJbVBSgN2dZHzMtCoHLYBUpkyXYzg5lF93TIr+a0zZ82u4tVcfq8VqUoeDuC0DQdFCx4E999viK+Lc04A==", + "integrity": "sha512-A6lTCXKKJ5LP+wD585dELYlyLiuh01sxZg/ws0I4Q006/ZkF86kWPT9NnDgOfac53Oh+/0ice2rlUlNsfensNg==", "requires": { "@discipl/core": "^0.11.0", "@discipl/core-baseconnector": "^0.2.1", @@ -1035,7 +1035,8 @@ } }, "@discipl/core-ephemeral": { - "version": "file:../../../packages/discipl-core-ephemeral-0.6.1.tgz", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@discipl/core-ephemeral/-/core-ephemeral-0.6.1.tgz", "integrity": "sha512-SvGCKtXx9Ln7CbNHKSjLIOzSCH+pgK0ZgVVtuiwD5Fp9YzDj8Kfl8VYEe3AGP/wF0Bm45LZB3F+kwEPsDBGQOg==", "requires": { "@discipl/core-baseconnector": "^0.2.1", @@ -2502,9 +2503,9 @@ } }, "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, "is-arrayish": { "version": "0.2.1", @@ -4418,12 +4419,12 @@ } }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" } }, "punycode": { diff --git a/waardepapieren-service/package.json b/waardepapieren-service/package.json index fe45df7..1c64ec4 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": "file:../../../packages/discipl-abundance-service-0.4.1.tgz", - "@discipl/core-ephemeral": "file:../../../packages/discipl-core-ephemeral-0.6.1.tgz", + "@discipl/core-ephemeral": "^0.6.1", "@discipl/core-nlx": "~0.2.0", "babel-plugin-dynamic-import-node": "^2.2.0", "jsonpath": "^1.0.1", From 4ebc57d705c6e02967943621b5468bd61cf85798 Mon Sep 17 00:00:00 2001 From: Pim Otte Date: Wed, 17 Apr 2019 14:19:25 +0200 Subject: [PATCH 4/5] Functional e2e --- clerk-frontend/package-lock.json | 1030 +---------------- clerk-frontend/package.json | 6 +- clerk-frontend/src/need-wizard/ConfirmStep.js | 27 +- .../src/need-wizard/DeliveryStep.js | 13 +- clerk-frontend/src/need-wizard/NeedWizard.js | 16 +- waardepapieren-service/package-lock.json | 11 +- waardepapieren-service/package.json | 4 +- waardepapieren-service/test/index.spec.js | 7 +- 8 files changed, 76 insertions(+), 1038 deletions(-) diff --git a/clerk-frontend/package-lock.json b/clerk-frontend/package-lock.json index 26253da..77c23a7 100644 --- a/clerk-frontend/package-lock.json +++ b/clerk-frontend/package-lock.json @@ -1013,36 +1013,38 @@ } }, "@discipl/abundance-service": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@discipl/abundance-service/-/abundance-service-0.3.0.tgz", - "integrity": "sha512-BhNa0HfGBRHB8xCvXpyaVE5LyTsJjn1yE/4vsnRSa7C2Tut7qlTbZoBLUtUoTVOcnbnmDQS7v0UC5Fc4asW4yA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@discipl/abundance-service/-/abundance-service-0.4.1.tgz", + "integrity": "sha512-yCGiYKvPIqQeHlXz4WdBCJyLsdbcFfJ80gsmK2gEtRt1Pt3QW1c+P9TE9oJ7g4bFjEFiWUzqE092PK2SXCqQiw==", "requires": { - "@discipl/core": "~0.7.0", + "@discipl/core": "^0.11.0", + "@discipl/core-baseconnector": "^0.2.1", "rxjs": "^6.4.0" } }, "@discipl/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discipl/core/-/core-0.7.0.tgz", - "integrity": "sha512-CvJur9DHIzXD0QANr43EpLX/Waegi3d7q1wiKmKy2S8/56WzLycQoM3PZKnWqovANM1DiSSjyyV3rniTZBNhPA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@discipl/core/-/core-0.11.1.tgz", + "integrity": "sha512-hVCVz4K3RbDrJnfmTGUTJNmGG4pXVXi8hVszp7d6PqUW3fqNLlmbsEfa45SQcL3yopGtr6KS66E3zf6WUQJoyQ==", "requires": { + "@discipl/core-baseconnector": "^0.2.1", "rxjs": "^6.4.0" } }, "@discipl/core-baseconnector": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@discipl/core-baseconnector/-/core-baseconnector-0.2.0.tgz", - "integrity": "sha512-zm0aR6jAVt7X0BtMiIxUEJbaTv82fSR2l1vFlgfLECtjQSyjxSHnJ5lnDmZE4Ea6cLmTFi/15gB4BMX9tdTvFw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discipl/core-baseconnector/-/core-baseconnector-0.2.1.tgz", + "integrity": "sha512-4E8kLE/p5FpGVfr1wCvaTeHLO2/aLyLYYb1ieHeg73CeSXVJIQJDhtyVISDfTR/tr9o4LiYVrtpK2BaXHYi8Xw==", "requires": { "json-stable-stringify": "^1.0.1" } }, "@discipl/core-ephemeral": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discipl/core-ephemeral/-/core-ephemeral-0.4.0.tgz", - "integrity": "sha512-8bX2zCiZXsYgY4/4lgMIGJLTcjtdpMhJLEK+q3lFBRWgs2ziuO72ITNv0MmAPkf1RAg5pXgRGApFGr8rqAj8RA==", + "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==", "requires": { - "@discipl/core-baseconnector": "0.2.0", + "@discipl/core-baseconnector": "^0.2.1", "axios": "^0.18.0", "express": "^4.16.4", "json-stable-stringify": "^1.0.1", @@ -1053,9 +1055,9 @@ }, "dependencies": { "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "requires": { "async-limiter": "~1.0.0" } @@ -1063,11 +1065,11 @@ } }, "@discipl/paper-wallet": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@discipl/paper-wallet/-/paper-wallet-0.4.0.tgz", - "integrity": "sha512-Ojs9CWDvX93jZcjrWaI2HMkFoOb0PaWYkauYoja54K3EXlZDCkvjcQlUjGfam6YFKbtE/9FEeCEih/gcp1ZNdQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@discipl/paper-wallet/-/paper-wallet-0.5.0.tgz", + "integrity": "sha512-BeyU6yX/Z0LC0eRBsW6859aAAt7KzhP4du3IZ/YBi5mn6GkjOTM3nzYexe1nACpJq3jk6ABu2tJOpbK7llJXVQ==", "requires": { - "@discipl/core": "^0.7.0", + "@discipl/core": "^0.11.1", "canvas": "^2.4.1", "json-stable-stringify": "^1.0.1", "jsqr": "^1.2.0", @@ -3102,7 +3104,6 @@ "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", @@ -3154,487 +3155,6 @@ "to-regex-range": "^2.1.0" } }, - "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", - "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.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": "2.6.9", - "bundled": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "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.0.0", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.2.4", - "bundled": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "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.5", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.2.0", - "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.6.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 - } - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -6938,487 +6458,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "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 - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -10848,22 +9887,27 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, @@ -15587,7 +14631,6 @@ "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", @@ -16335,7 +15378,6 @@ "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", diff --git a/clerk-frontend/package.json b/clerk-frontend/package.json index 45a96b9..14768ce 100644 --- a/clerk-frontend/package.json +++ b/clerk-frontend/package.json @@ -3,9 +3,9 @@ "version": "0.2.1", "private": true, "dependencies": { - "@discipl/abundance-service": "~0.3.0", - "@discipl/core-ephemeral": "^0.4.0", - "@discipl/paper-wallet": "^0.4.0", + "@discipl/abundance-service": "^0.4.1", + "@discipl/core-ephemeral": "^0.6.2", + "@discipl/paper-wallet": "^0.5.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^2.1.8", diff --git a/clerk-frontend/src/need-wizard/ConfirmStep.js b/clerk-frontend/src/need-wizard/ConfirmStep.js index d8660d9..9885269 100644 --- a/clerk-frontend/src/need-wizard/ConfirmStep.js +++ b/clerk-frontend/src/need-wizard/ConfirmStep.js @@ -1,6 +1,5 @@ import React, { Component } from 'react'; import * as abundance from '@discipl/abundance-service' -import { take } from 'rxjs/operators' import CONFIGURATION from '../configuration/wpsvc.json' @@ -20,29 +19,27 @@ class ConfirmStep extends Component { async componentDidMount() { await timeoutPromise(100) - let needSsid = await abundance.need('ephemeral', CONFIGURATION.PRODUCT_NEED) - await timeoutPromise(100) - let matchPromise = (await abundance.observe(needSsid.did, 'ephemeral')).pipe(take(1)).toPromise() - await timeoutPromise(100) + let need = await abundance.need('ephemeral', CONFIGURATION.PRODUCT_NEED) - await abundance.getCoreAPI().claim(needSsid, { [CONFIGURATION.SOURCE_ARGUMENT]: this.props.bsn }) - await timeoutPromise(100) - let match = await matchPromise + let observeOffer = await abundance.observeOffer(need.theirPrivateDid, need.myPrivateSsid) + await observeOffer.readyPromise - let personalDid = match.did + await abundance.getCoreAPI().claim(need.myPrivateSsid, { [CONFIGURATION.SOURCE_ARGUMENT]: this.props.bsn }) - if (this.props.ssidsChanged) { - this.props.ssidsChanged(personalDid, needSsid) - } + let result = await observeOffer.resultPromise - let brpPromise = (await abundance.getCoreAPI().observe(personalDid, null, true)).pipe(take(1)).toPromise() + if (this.props.ssidsChanged) { + this.props.ssidsChanged(need.theirPrivateDid, need.myPrivateSsid) + } - let brp = await brpPromise + if (this.props.resultLinkChanged) { + this.props.resultLinkChanged(result.link) + } this.setState({ ...this.state, - 'data': brp.claim.data + 'data': result.claim.data }) } diff --git a/clerk-frontend/src/need-wizard/DeliveryStep.js b/clerk-frontend/src/need-wizard/DeliveryStep.js index 020aeb4..52e4c58 100644 --- a/clerk-frontend/src/need-wizard/DeliveryStep.js +++ b/clerk-frontend/src/need-wizard/DeliveryStep.js @@ -1,8 +1,6 @@ import React, { Component } from 'react'; -import * as abundance from '@discipl/abundance-service' import * as paperWallet from '@discipl/paper-wallet' -import { take } from 'rxjs/operators' -import { createCanvas, loadImage } from 'canvas' +import { loadImage } from 'canvas' import CONFIGURATION from '../configuration/wpsvc.json' @@ -29,15 +27,10 @@ class ConfirmStep extends Component { async componentDidMount() { console.log(this.props) - let agreePromise = (await abundance.getCoreAPI().observe(this.props.personalDid, { [CONFIGURATION.PRODUCT_NAME]: null })).pipe(take(1)).toPromise() - // Express acceptance of document - await abundance.getCoreAPI().claim(this.props.needSsid, { [CONFIGURATION.PRODUCT_ACCEPT]: '' }) - - let agree = await agreePromise - - let vc = await paperWallet.issue(agree.claim.data[CONFIGURATION.PRODUCT_NAME]) + let vc = await paperWallet.issue(this.props.resultLink, this.props.myPrivateSsid) + console.log("Issued") this.canvasRef.current.width = template.canvasWidth this.canvasRef.current.height = template.canvasHeight diff --git a/clerk-frontend/src/need-wizard/NeedWizard.js b/clerk-frontend/src/need-wizard/NeedWizard.js index 7921916..fca2e10 100755 --- a/clerk-frontend/src/need-wizard/NeedWizard.js +++ b/clerk-frontend/src/need-wizard/NeedWizard.js @@ -20,6 +20,7 @@ class NeedWizard extends Component { this.bsnChanged = this.bsnChanged.bind(this); this.needChanged = this.needChanged.bind(this); this.ssidsChanged = this.ssidsChanged.bind(this); + this.resultLinkChanged = this.resultLinkChanged.bind(this); this.deliveryChanged = this.deliveryChanged.bind(this); } @@ -82,12 +83,19 @@ class NeedWizard extends Component { }) } - ssidsChanged(personalDid, needSsid) { + ssidsChanged(personalDid, myPrivateSsid) { this.setState({ ...this.state, 'personalDid': personalDid, - 'needSsid': needSsid + 'myPrivateSsid': myPrivateSsid + }) + } + + resultLinkChanged(resultLink) { + this.setState({ + ...this.state, + 'resultLink': resultLink }) } @@ -106,9 +114,9 @@ class NeedWizard extends Component { case 1: return case 2: - return + return case 3: - return + return default: console.log('Unsupported step') } diff --git a/waardepapieren-service/package-lock.json b/waardepapieren-service/package-lock.json index 9986ef9..1f1fb66 100644 --- a/waardepapieren-service/package-lock.json +++ b/waardepapieren-service/package-lock.json @@ -989,8 +989,9 @@ } }, "@discipl/abundance-service": { - "version": "file:../../../packages/discipl-abundance-service-0.4.1.tgz", - "integrity": "sha512-A6lTCXKKJ5LP+wD585dELYlyLiuh01sxZg/ws0I4Q006/ZkF86kWPT9NnDgOfac53Oh+/0ice2rlUlNsfensNg==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@discipl/abundance-service/-/abundance-service-0.4.1.tgz", + "integrity": "sha512-yCGiYKvPIqQeHlXz4WdBCJyLsdbcFfJ80gsmK2gEtRt1Pt3QW1c+P9TE9oJ7g4bFjEFiWUzqE092PK2SXCqQiw==", "requires": { "@discipl/core": "^0.11.0", "@discipl/core-baseconnector": "^0.2.1", @@ -1035,9 +1036,9 @@ } }, "@discipl/core-ephemeral": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@discipl/core-ephemeral/-/core-ephemeral-0.6.1.tgz", - "integrity": "sha512-SvGCKtXx9Ln7CbNHKSjLIOzSCH+pgK0ZgVVtuiwD5Fp9YzDj8Kfl8VYEe3AGP/wF0Bm45LZB3F+kwEPsDBGQOg==", + "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==", "requires": { "@discipl/core-baseconnector": "^0.2.1", "axios": "^0.18.0", diff --git a/waardepapieren-service/package.json b/waardepapieren-service/package.json index 1c64ec4..811a907 100644 --- a/waardepapieren-service/package.json +++ b/waardepapieren-service/package.json @@ -18,8 +18,8 @@ "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", "@babel/register": "^7.4.0", - "@discipl/abundance-service": "file:../../../packages/discipl-abundance-service-0.4.1.tgz", - "@discipl/core-ephemeral": "^0.6.1", + "@discipl/abundance-service": "^0.4.1", + "@discipl/core-ephemeral": "^0.6.2", "@discipl/core-nlx": "~0.2.0", "babel-plugin-dynamic-import-node": "^2.2.0", "jsonpath": "^1.0.1", diff --git a/waardepapieren-service/test/index.spec.js b/waardepapieren-service/test/index.spec.js index 0dd98fb..b052b26 100644 --- a/waardepapieren-service/test/index.spec.js +++ b/waardepapieren-service/test/index.spec.js @@ -56,8 +56,7 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi let result = await observeOffer.resultPromise - expect(result).to.deep.equal({ - "data": [ + expect(result.claim.data).to.deep.equal([ { "Doel": "Bewijs verblijfadres in woonplaats" }, @@ -67,9 +66,7 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi { "Woonplaats verblijfadres": "Haarlem" } - ], - "previous": null - }) + ]) // Test observations expect(nlxClaimStub.callCount).to.equal(1) From 962c56b5688ee744ed51efe308971ed653270bf2 Mon Sep 17 00:00:00 2001 From: Pim Otte Date: Wed, 17 Apr 2019 14:46:37 +0200 Subject: [PATCH 5/5] Actually catching errors --- waardepapieren-service/src/waardepapieren-service.js | 9 +++------ waardepapieren-service/test/index.spec.js | 4 ---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/waardepapieren-service/src/waardepapieren-service.js b/waardepapieren-service/src/waardepapieren-service.js index d7410c6..e414d89 100644 --- a/waardepapieren-service/src/waardepapieren-service.js +++ b/waardepapieren-service/src/waardepapieren-service.js @@ -20,7 +20,8 @@ class WaardenpapierenService { nlxConnector.configure(this.configuration.NLX_OUTWAY_ENDPOINT) let attendResult = await abundance.attendTo('ephemeral', this.configuration.PRODUCT_NEED, [this.configuration.SOURCE_ARGUMENT]) - await attendResult.observableResult.subscribe(async (need) => { + // TODO: Refactor to observableResult.subscribe when fix from core propagates + await attendResult.observableResult._observable.subscribe(async (need) => { await this.serveNeed(need) }, (e) => { // If connection is dropped by remote peer, this is fine @@ -29,19 +30,15 @@ class WaardenpapierenService { console.error(e) } }) + await attendResult.observableResult._readyPromise } async serveNeed (need) { - console.log("Serving need") let core = abundance.getCoreAPI() let needDetails = await need - console.log("Got needDetails") - console.log(needDetails) let argumentClaim = await needDetails.informationPromise - console.log("Querying NLX") - let srcarg = argumentClaim['claim']['data'][this.configuration.SOURCE_ARGUMENT] const nlxConnector = await core.getConnector('nlx') diff --git a/waardepapieren-service/test/index.spec.js b/waardepapieren-service/test/index.spec.js index b052b26..6923917 100644 --- a/waardepapieren-service/test/index.spec.js +++ b/waardepapieren-service/test/index.spec.js @@ -43,11 +43,7 @@ describe('waardenpapieren-service, integrated with mocked nlx connector', functi // Set up need let need = await abundance.need('ephemeral', CONFIGURATION.PRODUCT_NEED) - console.log("SERV INFO") - console.log(need.serviceInformation) - console.log(need) - console.log("Observing offer") let observeOffer = await abundance.observeOffer(need.theirPrivateDid, need.myPrivateSsid) await observeOffer.readyPromise