From 64126403892c0450478598be4b39da17852621fd Mon Sep 17 00:00:00 2001 From: lovesh Date: Sat, 21 Oct 2023 00:44:20 +0530 Subject: [PATCH 1/2] Hardcode context for status list Signed-off-by: lovesh --- src/utils/vc/contexts.js | 6 +++ src/utils/vc/contexts/status-list-21.js | 56 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/utils/vc/contexts/status-list-21.js diff --git a/src/utils/vc/contexts.js b/src/utils/vc/contexts.js index c8505b06b..51bb8a7c3 100644 --- a/src/utils/vc/contexts.js +++ b/src/utils/vc/contexts.js @@ -13,6 +13,7 @@ import dockBBS23V1Context from './contexts/dock-bbs23-v1.json'; import dockPSV1Context from './contexts/dock-ps-v1.json'; import dockPrettyVCContext from './contexts/prettyvc.json'; import jws2020V1Context from './contexts/jws-2020-v1.json'; +import statusList21Context from './contexts/status-list-21'; // Lookup of following URLs will lead to loading data from the context directory, this is done as the Sr25519 keys are not // supported in any W3C standard and vc-js has them stored locally. This is a temporary solution. @@ -89,4 +90,9 @@ export default new Map([ 'https://w3id.org/security/suites/jws-2020/v1', jws2020V1Context, ], + // This is overridden because the URL is 404 now, likely because domain name change. But the status-list library still uses the old domain name + [ + 'https://w3id.org/vc/status-list/2021/v1', + statusList21Context, + ], ]); diff --git a/src/utils/vc/contexts/status-list-21.js b/src/utils/vc/contexts/status-list-21.js new file mode 100644 index 000000000..5cea59ec5 --- /dev/null +++ b/src/utils/vc/contexts/status-list-21.js @@ -0,0 +1,56 @@ +// Taken from https://w3c.github.io/vc-bitstring-status-list/contexts/v1.jsonld +export default { + '@context': { + '@protected': true, + + StatusList2021Credential: { + '@id': + 'https://w3id.org/vc/status-list#StatusList2021Credential', + '@context': { + '@protected': true, + + id: '@id', + type: '@type', + + description: 'http://schema.org/description', + name: 'http://schema.org/name', + }, + }, + + StatusList2021: { + '@id': + 'https://w3id.org/vc/status-list#StatusList2021', + '@context': { + '@protected': true, + + id: '@id', + type: '@type', + + statusPurpose: + 'https://w3id.org/vc/status-list#statusPurpose', + encodedList: 'https://w3id.org/vc/status-list#encodedList', + }, + }, + + StatusList2021Entry: { + '@id': + 'https://w3id.org/vc/status-list#StatusList2021Entry', + '@context': { + '@protected': true, + + id: '@id', + type: '@type', + + statusPurpose: + 'https://w3id.org/vc/status-list#statusPurpose', + statusListIndex: + 'https://w3id.org/vc/status-list#statusListIndex', + statusListCredential: { + '@id': + 'https://w3id.org/vc/status-list#statusListCredential', + '@type': '@id', + }, + }, + }, + }, +}; From 2ec8dda0dd0fe0bf6a6ef2235d6d354958bec61b Mon Sep 17 00:00:00 2001 From: Sam Hellawell Date: Fri, 20 Oct 2023 20:30:57 +0100 Subject: [PATCH 2/2] version bump Signed-off-by: Sam Hellawell --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47799da2d..f943923a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/sdk", - "version": "6.6.0", + "version": "6.6.1", "main": "index.js", "license": "MIT", "repository": {