Skip to content

Commit f79bb5d

Browse files
committed
Add initial data model suite intended for issuers.
1 parent f7252f1 commit f79bb5d

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

tests/suites/data-model.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*!
2+
* Copyright 2024 Digital Bazaar, Inc.
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
import {
6+
assertions,
7+
} from 'data-integrity-test-suite-assertion';
8+
9+
export function dataModelSuite({
10+
issuers,
11+
suiteName,
12+
keyType,
13+
vcVersion,
14+
credential,
15+
mandatoryPointers,
16+
selectivePointers,
17+
}) {
18+
describe(`${suiteName} - Data Model - VC ${vcVersion}`, function() {
19+
this.matrix = true;
20+
this.report = true;
21+
this.implemented = [...issuers];
22+
this.rowLabel = 'Test Name';
23+
this.columnLabel = 'Implementation';
24+
for(const [name, {endpoints}] of issuers) {
25+
const [issuer] = endpoints;
26+
describe(`${name}: ${keyType}`, function() {
27+
let securedCredential = null;
28+
let issuerError = null;
29+
before(async function(){
30+
31+
});
32+
beforeEach(function() {
33+
this.currentTest.cell = {
34+
rowId: this.currentTest.title,
35+
columnId: this.currentTest.parent.title
36+
};
37+
});
38+
it('The publicKeyMultibase value of the verification method MUST ' +
39+
'start with the base-58-btc prefix (z), as defined in the ' +
40+
'Multibase section of Controller Documents 1.0. A ' +
41+
'Multibase-encoded Ed25519 256-bit public key value follows, as ' +
42+
'defined in the Multikey section of Controller Documents 1.0.',
43+
async function() {
44+
this.test.link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=in%20this%20specification.-,The%20publicKeyMultibase%20value%20of%20the%20verification%20method%20MUST%20start%20with%20the%20base%2D58%2Dbtc%20prefix,-(z)%2C%20as';
45+
});
46+
it('Any other encoding MUST NOT be allowed. (verificationMethod)',
47+
async function() {
48+
this.test.link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=of%20Controller%20Documents%201.0.-,Any%20other%20encoding%20MUST%20NOT%20be%20allowed.,-Developers%20are%20advised%20to%20not';
49+
});
50+
it('The type property MUST be DataIntegrityProof.', async function() {
51+
this.test.link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=The%20type%20property%20MUST%20be%20DataIntegrityProof.';
52+
});
53+
it('The cryptosuite property of the proof MUST be eddsa-rdfc-2022 or ' +
54+
'eddsa-jcs-2022.', async function() {
55+
this.test.link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=The%20cryptosuite%20property%20of%20the%20proof%20MUST%20be%20eddsa%2Drdfc%2D2022%20or%20eddsa%2Djcs%2D2022.';
56+
});
57+
it('The proofValue property of the proof MUST be a detached EdDSA ' +
58+
'signature produced according to [RFC8032], encoded using the ' +
59+
'base-58-btc header and alphabet as described in the Multibase ' +
60+
'section of Controller Documents 1.0.', async function() {
61+
this.test.link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=The%20proofValue%20property%20of%20the%20proof%20MUST%20be%20a%20detached%20EdDSA%20signature%20produced%20according%20to%20%5BRFC8032%5D%2C%20encoded%20using%20the%20base%2D58%2Dbtc%20header%20and%20alphabet%20as%20described%20in%20the%20Multibase%20section%20of%20Controller%20Documents%201.0.';
62+
63+
});
64+
});
65+
}
66+
});
67+
}

0 commit comments

Comments
 (0)