From a10bb7c7c1afaccc5f6ae99e26d89250a555818e Mon Sep 17 00:00:00 2001 From: F-Node-Karlsruhe Date: Tue, 21 Nov 2023 13:10:01 +0100 Subject: [PATCH] allow multi status in UI Signed-off-by: F-Node-Karlsruhe --- CHANGELOG.md | 5 ++++ api/package-lock.json | 20 +++++++-------- api/package.json | 6 ++--- frontend/package.json | 2 +- frontend/src/components/Credential.vue | 1 + frontend/src/store/index.js | 2 +- frontend/src/views/Verify.vue | 35 +++++++++++++++++++++----- 7 files changed, 50 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 203b7c3..0ec7c56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ VC Verifier Changelog WIP --- + +1.7.7 (2023-11-21) +--- + - prevent caching of status credentials in document loader +- support mutli status list results in UI 1.7.6 (2023-11-15) diff --git a/api/package-lock.json b/api/package-lock.json index 8770890..c58cfdf 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -1,12 +1,12 @@ { "name": "vc-verifier", - "version": "1.7.5", + "version": "1.7.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vc-verifier", - "version": "1.7.5", + "version": "1.7.6", "license": "AGPL-3.0", "dependencies": { "@digitalbazaar/data-integrity": "^1.4.1", @@ -15,8 +15,8 @@ "@digitalbazaar/ed25519-signature-2018": "^4.0.0", "@digitalbazaar/ed25519-signature-2020": "^5.2.0", "@digitalbazaar/vc": "^6.2.0", - "@digitalbazaar/vc-revocation-list": "^5.0.0", - "@digitalbazaar/vc-status-list": "^7.0.0", + "@digitalbazaar/vc-revocation-list": "^5.0.1", + "@digitalbazaar/vc-status-list": "^7.1.0", "cors": "^2.8.5", "did-resolver": "^4.1.0", "dotenv": "^16.3.1", @@ -1000,9 +1000,9 @@ } }, "node_modules/@digitalbazaar/vc-status-list": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@digitalbazaar/vc-status-list/-/vc-status-list-7.0.0.tgz", - "integrity": "sha512-fFSZx5S/LG9PRxHkoVgH+jMib18zAVjWLbcsrdK2qE8jalX8Kg/IILFr37ifmL4CYXIwelM0cff0P/SIaz96zw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@digitalbazaar/vc-status-list/-/vc-status-list-7.1.0.tgz", + "integrity": "sha512-p5uxKJlX13N8TcTuv9qFDeej+6bndU+Rh1Cez2MT+bXQE6Jpn5t336FBSHmcECB4yUfZQpkmV/LOcYU4lW8Ojw==", "dependencies": { "@digitalbazaar/bitstring": "^3.0.0", "@digitalbazaar/vc": "^5.0.0", @@ -6657,9 +6657,9 @@ } }, "@digitalbazaar/vc-status-list": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@digitalbazaar/vc-status-list/-/vc-status-list-7.0.0.tgz", - "integrity": "sha512-fFSZx5S/LG9PRxHkoVgH+jMib18zAVjWLbcsrdK2qE8jalX8Kg/IILFr37ifmL4CYXIwelM0cff0P/SIaz96zw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@digitalbazaar/vc-status-list/-/vc-status-list-7.1.0.tgz", + "integrity": "sha512-p5uxKJlX13N8TcTuv9qFDeej+6bndU+Rh1Cez2MT+bXQE6Jpn5t336FBSHmcECB4yUfZQpkmV/LOcYU4lW8Ojw==", "requires": { "@digitalbazaar/bitstring": "^3.0.0", "@digitalbazaar/vc": "^5.0.0", diff --git a/api/package.json b/api/package.json index 5d26d87..fc28def 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "vc-verifier", - "version": "1.7.6", + "version": "1.7.7", "description": "The EECC verifier for verifiable credentials which provides an verification API as well as the corresponding UI.", "main": "index.js", "type": "module", @@ -32,8 +32,8 @@ "@digitalbazaar/ed25519-signature-2018": "^4.0.0", "@digitalbazaar/ed25519-signature-2020": "^5.2.0", "@digitalbazaar/vc": "^6.2.0", - "@digitalbazaar/vc-revocation-list": "^5.0.0", - "@digitalbazaar/vc-status-list": "^7.0.0", + "@digitalbazaar/vc-revocation-list": "^5.0.1", + "@digitalbazaar/vc-status-list": "^7.1.0", "cors": "^2.8.5", "did-resolver": "^4.1.0", "dotenv": "^16.3.1", diff --git a/frontend/package.json b/frontend/package.json index 4292152..9ea024f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "verifier_frontend", - "version": "1.7.6", + "version": "1.7.7", "description": "Vue frontend for the EECC vc verifier API", "scripts": { "build": "vue-cli-service build", diff --git a/frontend/src/components/Credential.vue b/frontend/src/components/Credential.vue index af9d136..a63ff07 100644 --- a/frontend/src/components/Credential.vue +++ b/frontend/src/components/Credential.vue @@ -239,6 +239,7 @@ export default { }); }, getStateColor(credential) { + if (credential.revoked) return 'danger'; if (credential.suspended) return 'warning'; if (credential.verified === false) return 'danger'; return 'success'; diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 0bdbe29..e1a4fec 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -5,7 +5,7 @@ import api from '../api' export default createStore({ state: { - version: '1.7.6', + version: '1.7.7', authentication: undefined, verifiables: [], disclosedCredentials: [], diff --git a/frontend/src/views/Verify.vue b/frontend/src/views/Verify.vue index d975be6..c5dc78d 100644 --- a/frontend/src/views/Verify.vue +++ b/frontend/src/views/Verify.vue @@ -176,18 +176,41 @@ export default { if (result.statusResult && !result.statusResult.verified) { - // TODO also make status arrays recognize suspension - if (credential.credentialStatus.statusPurpose && credential.credentialStatus.statusPurpose == 'suspension') { + if (result.statusResult.results) { - credentialResult.suspended = true; + const failedStatuses = result.statusResult.results.filter(r => !r.verified) - message = 'Credential suspended!'; + if (failedStatuses.filter(fs => fs.credentialStatus.statusPurpose === 'suspension').length > 0) { + + credentialResult.suspended = true; + + message = 'Credential suspended!'; + + } + + if (failedStatuses.filter(fs => fs.credentialStatus.statusPurpose === 'revocation').length > 0) { + + credentialResult.revoked = true; + + message = 'Credential revoked!'; + + } } else { - credentialResult.revoked = true; + if (credential.credentialStatus.statusPurpose && credential.credentialStatus.statusPurpose == 'suspension') { + + credentialResult.suspended = true; + + message = 'Credential suspended!'; + + } else { + + credentialResult.revoked = true; + + message = 'Credential revoked!'; - message = 'Credential revoked!'; + } }