From fd88630c0ac690f6ab49c5e0629226fc785488ce Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 5 Feb 2024 15:00:44 +0000 Subject: [PATCH 1/2] Use release of vc 2.0 context. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ecb6bed..204ac818 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lib/**/*.js" ], "dependencies": { - "@digitalbazaar/credentials-v2-context": "github:digitalbazaar/credentials-v2-context#initial", + "@digitalbazaar/credentials-v2-context": "github:digitalbazaar/credentials-v2-context", "credentials-context": "^2.0.0", "ed25519-signature-2018-context": "^1.1.0", "jsonld": "^8.3.1", From f1b675bb74d3c03f25a12dbce86ee0ec151443f0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 5 Feb 2024 15:25:36 +0000 Subject: [PATCH 2/2] Add V2 Examples Context. --- test/contexts/examples-v2.js | 11 +++++++++++ test/contexts/index.js | 9 +++++++++ test/mocks/credential.js | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/contexts/examples-v2.js diff --git a/test/contexts/examples-v2.js b/test/contexts/examples-v2.js new file mode 100644 index 00000000..d51fff87 --- /dev/null +++ b/test/contexts/examples-v2.js @@ -0,0 +1,11 @@ +/*! +* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved. +*/ +const contextUrl = 'https://www.w3.org/ns/credentials/examples/v2'; +const context = { + '@context': { + '@vocab': 'https://www.w3.org/ns/credentials/examples#' + } +}; +export const constants = {CREDENTIALS_V2_EXAMPLE_CONTEXT_URL: contextUrl}; +export const contexts = new Map([[contextUrl, context]]); diff --git a/test/contexts/index.js b/test/contexts/index.js index d936d931..c2efb969 100644 --- a/test/contexts/index.js +++ b/test/contexts/index.js @@ -29,6 +29,10 @@ import { CONTEXT_V1 as vcExamplesV1Ctx, CONTEXT_URL_V1 as vcExamplesV1CtxUrl } from '@digitalbazaar/credentials-examples-context'; +import { + constants as vcExamplesV2Constants, + contexts as vcExamplesV2Contexts +} from './examples-v2.js'; import {invalidId} from './invalid_id.js'; import {nullId} from './null_id.js'; import {nullType} from './null_type.js'; @@ -37,6 +41,7 @@ import {nullVersion} from './null_version.js'; const {CONTEXT_URL: ED25519_CONTEXT_URL} = ed25519Constants; const {CREDENTIALS_CONTEXT_V1_URL} = credentialsConstants; const {CONTEXT_URL: CREDENTIALS_CONTEXT_V2_URL} = credentialsV2Constants; +const {CREDENTIALS_V2_EXAMPLE_CONTEXT_URL} = vcExamplesV2Constants; const {DID_CONTEXT_URL} = didConstants; const {VERES_ONE_CONTEXT_V1_URL} = v1Constants; @@ -68,6 +73,10 @@ export const validContexts = { examplesContext: { url: vcExamplesV1CtxUrl, value: vcExamplesV1Ctx + }, + examplesV2Context: { + url: CREDENTIALS_V2_EXAMPLE_CONTEXT_URL, + value: vcExamplesV2Contexts.get(CREDENTIALS_V2_EXAMPLE_CONTEXT_URL) } }; diff --git a/test/mocks/credential.js b/test/mocks/credential.js index 0698faae..133cbd91 100644 --- a/test/mocks/credential.js +++ b/test/mocks/credential.js @@ -21,7 +21,7 @@ export const versionedCredentials = new Map([ [2.0, () => klona({ '@context': [ 'https://www.w3.org/ns/credentials/v2', - 'https://www.w3.org/2018/credentials/examples/v1' + 'https://www.w3.org/ns/credentials/examples/v2' ], id: 'http://example.edu/credentials/1872', type: ['VerifiableCredential', 'AlumniCredential'],