Skip to content

Commit

Permalink
Special-case Ed25519Signature2020 "created".
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Sep 23, 2024
1 parent 9ef86c9 commit 22edb6f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 12 additions & 6 deletions test/mocha/assertions/issueWithoutStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 () => {
Expand Down
9 changes: 6 additions & 3 deletions test/mocha/assertions/testBitstringStatusList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions test/mocha/assertions/testTerseBitstringStatusList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 22edb6f

Please sign in to comment.