From f866a36d0f3a67ecdd2e56176e16579dc644582b Mon Sep 17 00:00:00 2001 From: Tashi D Gyeltshen Date: Fri, 12 Jan 2024 09:18:44 -0500 Subject: [PATCH 1/3] Update tag to be configurable via env variable. --- tests/10-create.js | 5 +++-- tests/20-verify.js | 5 +++-- tests/30-interop.js | 4 ++-- tests/test-config.js | 6 ++++++ 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 tests/test-config.js diff --git a/tests/10-create.js b/tests/10-create.js index d42fa2b..7b0ce9a 100644 --- a/tests/10-create.js +++ b/tests/10-create.js @@ -9,9 +9,10 @@ import { import {endpoints} from 'vc-test-suite-implementations'; import {generateTestData} from './vc-generator/index.js'; import {klona} from 'klona'; +import {tag} from './test-config.js'; import {v4 as uuidv4} from 'uuid'; + // only use implementations with `Ed25519 2020` issuers. -const tag = 'Ed25519Signature2020'; const {match} = endpoints.filterByTag({tags: [tag], property: 'issuers'}); const should = chai.should(); @@ -43,7 +44,7 @@ describe('Ed25519Signature2020 (create)', function() { before(async function() { const [issuer] = endpoints; verifier = implementation.verifiers.find( - verifier => verifier.tags.has('Ed25519Signature2020')); + verifier => verifier.tags.has(tag)); const {settings: {id: issuerId, options}} = issuer; const body = {credential: klona(validVc), options}; body.credential.id = `urn:uuid:${uuidv4()}`; diff --git a/tests/20-verify.js b/tests/20-verify.js index 9bace61..f3ce1b2 100644 --- a/tests/20-verify.js +++ b/tests/20-verify.js @@ -9,10 +9,11 @@ import { import {endpoints} from 'vc-test-suite-implementations'; import {generateTestData} from './vc-generator/index.js'; import {klona} from 'klona'; +import {tag} from './test-config.js'; // only use implementations with `Ed25519 2020` verifiers. const {match} = endpoints.filterByTag({ - tags: ['Ed25519Signature2020'], + tags: [tag], property: 'verifiers' }); @@ -43,7 +44,7 @@ describe('Ed25519Signature2020 (verify)', function() { for(const [name, {implementation}] of match) { describe(name, function() { const verifier = implementation.verifiers.find( - verifier => verifier.tags.has('Ed25519Signature2020')); + verifier => verifier.tags.has(tag)); it('MUST verify a valid VC with an Ed25519Signature2020 proof', async function() { this.test.cell = { diff --git a/tests/30-interop.js b/tests/30-interop.js index 399aaeb..226ed92 100644 --- a/tests/30-interop.js +++ b/tests/30-interop.js @@ -5,10 +5,10 @@ import chai from 'chai'; import {filterByTag} from 'vc-test-suite-implementations'; import {generateTestData} from './vc-generator/index.js'; import {klona} from 'klona'; +import {tag} from './test-config.js'; import {v4 as uuidv4} from 'uuid'; const should = chai.should(); -const tag = 'Ed25519Signature2020'; // only use implementations with `Ed25519 2020` issuers. const { @@ -36,7 +36,7 @@ describe('Ed25519Signature2020 (interop)', function() { let issuerError; before(async function() { const issuer = issuers.find(issuer => - issuer.tags.has('Ed25519Signature2020')); + issuer.tags.has(tag)); const {settings: {id: issuerId, options}} = issuer; const body = {credential: klona(validVc), options}; body.credential.id = `urn:uuid:${uuidv4()}`; diff --git a/tests/test-config.js b/tests/test-config.js new file mode 100644 index 0000000..db5528b --- /dev/null +++ b/tests/test-config.js @@ -0,0 +1,6 @@ +/*! + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause + */ + +export const tag = process.env.TAG || 'Ed25519Signature2020'; From 8bfcb73b9eecc5b70b196a31b100725108ee97da Mon Sep 17 00:00:00 2001 From: Tashi D Gyeltshen Date: Fri, 12 Jan 2024 09:25:23 -0500 Subject: [PATCH 2/3] Update copyright headers. --- tests/10-create.js | 3 ++- tests/20-verify.js | 3 ++- tests/30-interop.js | 3 ++- tests/assertions.js | 3 ++- tests/helpers.js | 3 ++- tests/vc-generator/TestEd25519Signature2020.js | 3 ++- tests/vc-generator/TestLinkedDataSignature.js | 3 ++- tests/vc-generator/contexts.js | 3 ++- tests/vc-generator/documentLoader.js | 3 ++- tests/vc-generator/hashDigest.js | 3 ++- tests/vc-generator/helpers.js | 3 ++- tests/vc-generator/index.js | 3 ++- tests/vc-generator/util.js | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) diff --git a/tests/10-create.js b/tests/10-create.js index 7b0ce9a..fc22ced 100644 --- a/tests/10-create.js +++ b/tests/10-create.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import {bs58Decode, getPublicKeyBytes} from './helpers.js'; import chai from 'chai'; diff --git a/tests/20-verify.js b/tests/20-verify.js index f3ce1b2..0f5f5ca 100644 --- a/tests/20-verify.js +++ b/tests/20-verify.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import {bs58Decode, bs58Encode} from './helpers.js'; import {verificationFail, verificationSuccess} from './assertions.js'; diff --git a/tests/30-interop.js b/tests/30-interop.js index 226ed92..5a5c2e9 100644 --- a/tests/30-interop.js +++ b/tests/30-interop.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import chai from 'chai'; import {filterByTag} from 'vc-test-suite-implementations'; diff --git a/tests/assertions.js b/tests/assertions.js index 997e4e0..f5596d8 100644 --- a/tests/assertions.js +++ b/tests/assertions.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import chai from 'chai'; diff --git a/tests/helpers.js b/tests/helpers.js index 0440fb5..ba527a3 100644 --- a/tests/helpers.js +++ b/tests/helpers.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import * as didKey from '@digitalbazaar/did-method-key'; import {IdDecoder, IdEncoder} from 'bnid'; diff --git a/tests/vc-generator/TestEd25519Signature2020.js b/tests/vc-generator/TestEd25519Signature2020.js index 2ffe1c2..4810d71 100644 --- a/tests/vc-generator/TestEd25519Signature2020.js +++ b/tests/vc-generator/TestEd25519Signature2020.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import * as base58btc from 'base58-universal'; import { diff --git a/tests/vc-generator/TestLinkedDataSignature.js b/tests/vc-generator/TestLinkedDataSignature.js index cd315a4..cee718d 100644 --- a/tests/vc-generator/TestLinkedDataSignature.js +++ b/tests/vc-generator/TestLinkedDataSignature.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import {api} from './util.js'; import {createRequire} from 'node:module'; diff --git a/tests/vc-generator/contexts.js b/tests/vc-generator/contexts.js index 5bdbae6..8f25188 100644 --- a/tests/vc-generator/contexts.js +++ b/tests/vc-generator/contexts.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ // import {contexts} from '@digitalbazaar/vc'; import credentialsCtx from 'credentials-context'; diff --git a/tests/vc-generator/documentLoader.js b/tests/vc-generator/documentLoader.js index a6846cc..8888155 100644 --- a/tests/vc-generator/documentLoader.js +++ b/tests/vc-generator/documentLoader.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import {contextMap} from './contexts.js'; import {JsonLdDocumentLoader} from 'jsonld-document-loader'; diff --git a/tests/vc-generator/hashDigest.js b/tests/vc-generator/hashDigest.js index 133f909..b2bdcf5 100644 --- a/tests/vc-generator/hashDigest.js +++ b/tests/vc-generator/hashDigest.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import crypto from 'crypto'; diff --git a/tests/vc-generator/helpers.js b/tests/vc-generator/helpers.js index 4361082..b8c6776 100644 --- a/tests/vc-generator/helpers.js +++ b/tests/vc-generator/helpers.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import * as didKey from '@digitalbazaar/did-method-key'; import {decodeSecretKeySeed} from 'bnid'; diff --git a/tests/vc-generator/index.js b/tests/vc-generator/index.js index 635c4c5..3ff5145 100644 --- a/tests/vc-generator/index.js +++ b/tests/vc-generator/index.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ import * as base58btc from 'base58-universal'; import * as vc from '@digitalbazaar/vc'; diff --git a/tests/vc-generator/util.js b/tests/vc-generator/util.js index 7489998..984d0a0 100644 --- a/tests/vc-generator/util.js +++ b/tests/vc-generator/util.js @@ -1,5 +1,6 @@ /*! - * Copyright (c) 2022 Digital Bazaar, Inc. All rights reserved. + * Copyright (c) 2022-2024 Digital Bazaar, Inc. + * SPDX-License-Identifier: BSD-3-Clause */ export const api = {}; From 18d5b085724e3e07b34f5c6e12c87490e7cf469d Mon Sep 17 00:00:00 2001 From: Tashi D Gyeltshen Date: Fri, 12 Jan 2024 09:29:18 -0500 Subject: [PATCH 3/3] Add `LICENSE.md`. --- tests/LICENSE.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/LICENSE.md diff --git a/tests/LICENSE.md b/tests/LICENSE.md new file mode 100644 index 0000000..05f0069 --- /dev/null +++ b/tests/LICENSE.md @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2024, W3C, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.