From 22edb6fafb929633345e40e6134085a8cb39ea0f Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Mon, 23 Sep 2024 01:21:18 -0400 Subject: [PATCH] Special-case `Ed25519Signature2020` "created". --- CHANGELOG.md | 3 ++- test/mocha/assertions/issueWithoutStatus.js | 18 ++++++++++++------ .../assertions/testBitstringStatusList.js | 9 ++++++--- .../assertions/testTerseBitstringStatusList.js | 6 ++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d436812..05d8cb80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ change to the new format is required to stop including `created` in legacy issuer instances. This approach ensures that deployments that only use legacy issuer instances in production can include this update without - any changes. + any changes. Note that for the legacy `Ed25519Signature2020` cryptosuite, + the `created` date will always be present regardless of these options. ## 27.1.0 - 2024-09-18 diff --git a/test/mocha/assertions/issueWithoutStatus.js b/test/mocha/assertions/issueWithoutStatus.js index 9b5bcfac..219f1241 100644 --- a/test/mocha/assertions/issueWithoutStatus.js +++ b/test/mocha/assertions/issueWithoutStatus.js @@ -60,9 +60,12 @@ export function testIssueWithoutStatus({ }); should.exist(verifiableCredential.id); should.not.exist(verifiableCredential.credentialStatus); - // `created` should not be set by default because new issue config - // mechanism was used w/o requesting it - should.not.exist(verifiableCredential.proof.created); + // not supported with old `Ed25519Signature2020` + if(suiteName !== 'Ed25519Signature2020') { + // `created` should not be set by default because new issue config + // mechanism was used w/o requesting it + should.not.exist(verifiableCredential.proof.created); + } }); it('issues a VC 2.0 credential w/no "credentialStatus"', async () => { const credential = klona(mockCredentialV2); @@ -76,9 +79,12 @@ export function testIssueWithoutStatus({ }); should.exist(verifiableCredential.id); should.not.exist(verifiableCredential.credentialStatus); - // `created` should not be set by default because new issue config - // mechanism was used w/o requesting it - should.not.exist(verifiableCredential.proof.created); + // not supported with old `Ed25519Signature2020` + if(suiteName !== 'Ed25519Signature2020') { + // `created` should not be set by default because new issue config + // mechanism was used w/o requesting it + should.not.exist(verifiableCredential.proof.created); + } }); it('fails to issue an empty credential', async () => { diff --git a/test/mocha/assertions/testBitstringStatusList.js b/test/mocha/assertions/testBitstringStatusList.js index 37f48fdc..8f04a18c 100644 --- a/test/mocha/assertions/testBitstringStatusList.js +++ b/test/mocha/assertions/testBitstringStatusList.js @@ -103,9 +103,12 @@ function testStatusPurpose({ should.exist(verifiableCredential.credentialStatus); should.exist(verifiableCredential.proof); verifiableCredential.proof.should.be.an('object'); - // `created` should not be set by default because new issue config - // mechanism was used w/o requesting it - should.not.exist(verifiableCredential.proof.created); + // not supported with old `Ed25519Signature2020` + if(suiteName !== 'Ed25519Signature2020') { + // `created` should not be set by default because new issue config + // mechanism was used w/o requesting it + should.not.exist(verifiableCredential.proof.created); + } await assertions.assertStoredCredential({ configId: bslInstance.issuerId, diff --git a/test/mocha/assertions/testTerseBitstringStatusList.js b/test/mocha/assertions/testTerseBitstringStatusList.js index 1617bee1..1a617a4d 100644 --- a/test/mocha/assertions/testTerseBitstringStatusList.js +++ b/test/mocha/assertions/testTerseBitstringStatusList.js @@ -105,6 +105,12 @@ export function testTerseBitstringStatusList({ .should.be.a('number'); should.exist(verifiableCredential.proof); verifiableCredential.proof.should.be.an('object'); + // not supported with old `Ed25519Signature2020` + if(suiteName !== 'Ed25519Signature2020') { + // `created` should not be set by default because new issue config + // mechanism was used w/o requesting it + should.not.exist(verifiableCredential.proof.created); + } }); it('updates multiple TerseBitstringStatusList statuses', async () => {