Skip to content

Commit 12528b2

Browse files
committed
Fix skipMessage & initial vc creation.
1 parent 50e0c76 commit 12528b2

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

tests/suites/algorithms-sd.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ export function sd2023Algorithms({
3333
this.implemented = [];
3434
this.rowLabel = 'Test Name';
3535
this.columnLabel = 'Implementation';
36-
let fixtures = new Map();
36+
const fixtures = new Map();
3737
before(async function() {
38-
fixtures = await setup({
39-
suite: suiteName,
40-
keyTypes,
41-
credential,
42-
mandatoryPointers,
43-
selectivePointers
44-
});
38+
for(const keyType of keyTypes) {
39+
fixtures.set(keyType, await setup({
40+
suiteName,
41+
keyType,
42+
credential,
43+
mandatoryPointers,
44+
selectivePointers
45+
}));
46+
}
4547
});
4648
for(const [name, {endpoints}] of verifiers) {
4749
const [verifier] = endpoints;
@@ -56,7 +58,8 @@ export function sd2023Algorithms({
5658
if(issuer) {
5759
baseCredential = await createInitialVc({
5860
issuer,
59-
credential,
61+
vc: credential,
62+
vcVersion,
6063
mandatoryPointers
6164
});
6265
if(baseCredential) {
@@ -128,14 +131,14 @@ export function sd2023Algorithms({
128131
'selection, this includes any root document identifier.',
129132
async function() {
130133
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#jsonpointertopaths:~:text=If%20source%20has%20an%20id%20that%20is%20not%20a%20blank%20node%20identifier%2C%20set%20selection.id%20to%20its%20value.%20Note%3A%20All%20non%2Dblank%20node%20identifiers%20in%20the%20path%20of%20any%20JSON%20Pointer%20MUST%20be%20included%20in%20the%20selection%2C%20this%20includes%20any%20root%20document%20identifier.';
131-
this.cell.skipMessage = 'Not Implemented';
134+
this.test.cell.skipMessage = 'Not Implemented';
132135
this.skip();
133136
});
134137
it('If source.type is set, set selection.type to its value. ' +
135138
'Note: The selection MUST include all types in the path of any ' +
136139
'JSON Pointer, including any root document type.', async function() {
137140
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=If%20source.type%20is%20set%2C%20set%20selection.type%20to%20its%20value.%20Note%3A%20The%20selection%20MUST%20include%20all%20types%20in%20the%20path%20of%20any%20JSON%20Pointer%2C%20including%20any%20root%20document%20type.';
138-
this.cell.skipMessage = 'Not Implemented';
141+
this.test.cell.skipMessage = 'Not Implemented';
139142
this.skip();
140143
});
141144
it('Set value to parentValue.path. If value is now undefined, an ' +
@@ -158,15 +161,15 @@ export function sd2023Algorithms({
158161
'NOT be used on any of the components. Append the produced encoded ' +
159162
'value to proofValue.', async function() {
160163
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=and%20mandatoryPointers.-,CBOR%2Dencode%20components%20per%20%5BRFC8949%5D%20where%20CBOR%20tagging%20MUST,-NOT%20be%20used';
161-
this.cell.skipMessage = 'Not Implemented';
164+
this.test.cell.skipMessage = 'Not Implemented';
162165
this.skip();
163166
});
164167
it('If the proofValue string does not start with u, indicating ' +
165168
'that it is a multibase-base64url-no-pad-encoded value, an error ' +
166169
'MUST be raised and SHOULD convey an error type of ' +
167170
'PROOF_VERIFICATION_ERROR.', async function() {
168171
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=produced%20as%20output.-,If%20the%20proofValue%20string%20does%20not%20start%20with%20u%2C%20indicating%20that%20it%20is%20a%20multibase%2Dbase64url%2Dno%2Dpad%2Dencoded%20value%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR.,-Initialize%20decodedProofValue%20to';
169-
this.cell.skipMessage = 'Not Implemented';
172+
this.test.cell.skipMessage = 'Not Implemented';
170173
this.skip();
171174
/*
172175
await assertions.verificationFail({
@@ -181,7 +184,7 @@ export function sd2023Algorithms({
181184
'raised and SHOULD convey an error type of PROOF_VERIFICATION_ERROR.',
182185
async function() {
183186
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=If%20the%20decodedProofValue%20does%20not%20start%20with%20the%20ECDSA%2DSD%20base%20proof%20header%20bytes%200xd9%2C%200x5d%2C%20and%200x00%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR.';
184-
this.cell.skipMessage = 'Not Implemented';
187+
this.test.cell.skipMessage = 'Not Implemented';
185188
this.skip();
186189
/*
187190
await assertions.verificationFail({
@@ -196,7 +199,7 @@ export function sd2023Algorithms({
196199
'MUST be raised and SHOULD convey an error type of ' +
197200
'PROOF_VERIFICATION_ERROR.', async function() {
198201
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=If%20the%20decodedProofValue%20does%20not%20start%20with%20the%20ECDSA%2DSD%20disclosure%20proof%20header%20bytes%200xd9%2C%200x5d%2C%20and%200x01%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR.';
199-
this.cell.skipMessage = 'Not Implemented';
202+
this.test.cell.skipMessage = 'Not Implemented';
200203
this.skip();
201204
/*
202205
await assertions.verificationFail({
@@ -214,15 +217,15 @@ export function sd2023Algorithms({
214217
'MUST be raised and SHOULD convey an error type of ' +
215218
'PROOF_VERIFICATION_ERROR.', async function() {
216219
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=array%20of%20integers%20%E2%80%94-,an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR.,-Replace%20the%20fourth';
217-
this.cell.skipMessage = 'Not Implemented';
220+
this.test.cell.skipMessage = 'Not Implemented';
218221
this.skip();
219222
});
220223
it('The transformation options MUST contain a type identifier for ' +
221224
'the cryptographic suite (type), a cryptosuite identifier ' +
222225
'(cryptosuite), and a verification method (verificationMethod).',
223226
async function() {
224227
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=The%20transformation%20options%20MUST%20contain%20a%20type%20identifier%20for%20the%20cryptographic%20suite%20(type)%2C%20a%20cryptosuite%20identifier%20(cryptosuite)%2C%20and%20a%20verification%20method%20(verificationMethod).';
225-
this.cell.skipMessage = 'Not Implemented';
228+
this.test.cell.skipMessage = 'Not Implemented';
226229
this.skip();
227230
/*
228231
await assertions.verificationFail({
@@ -236,7 +239,7 @@ export function sd2023Algorithms({
236239
'JSON pointers (mandatoryPointers) and MAY contain additional ' +
237240
'options, such as a JSON-LD document loader.', async function() {
238241
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=The%20transformation%20options%20MUST%20contain%20an%20array%20of%20mandatory%20JSON%20pointers%20(mandatoryPointers)%20and%20MAY%20contain%20additional%20options%2C%20such%20as%20a%20JSON%2DLD%20document%20loader.';
239-
this.cell.skipMessage = 'Not Implemented';
242+
this.test.cell.skipMessage = 'Not Implemented';
240243
this.skip();
241244
/*
242245
await assertions.verificationFail({
@@ -249,21 +252,21 @@ export function sd2023Algorithms({
249252
it('Whenever this algorithm encodes strings, it MUST use UTF-8 ' +
250253
'encoding.', async function() {
251254
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=produced%20as%20output.-,Whenever%20this%20algorithm%20encodes%20strings%2C%20it%20MUST%20use%20UTF%2D8%20encoding.,-Initialize%20hmac%20to';
252-
this.cell.skipMessage = 'Not Implemented';
255+
this.test.cell.skipMessage = 'Not Implemented';
253256
this.skip();
254257
});
255258
it('Per the recommendations of [RFC2104], the HMAC key MUST be the ' +
256259
'same length as the digest size; for SHA-256, this is 256 bits or ' +
257260
'32 bytes.', async function() {
258261
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#selective-disclosure-functions:~:text=Per%20the%20recommendations%20of%20%5BRFC2104%5D%2C%20the%20HMAC%20key%20MUST%20be%20the%20same%20length%20as%20the%20digest%20size%3B%20for%20SHA%2D256%2C%20this%20is%20256%20bits%20or%2032%20bytes.';
259-
this.cell.skipMessage = 'Not Implemented';
262+
this.test.cell.skipMessage = 'Not Implemented';
260263
this.skip();
261264
});
262265
it('The proof options MUST contain a type identifier for the ' +
263266
'cryptographic suite (type) and MUST contain a cryptosuite ' +
264267
'identifier (cryptosuite).', async function() {
265268
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#base-proof-configuration-ecdsa-sd-2023';
266-
this.cell.skipMessage = 'Not Implemented';
269+
this.test.cell.skipMessage = 'Not Implemented';
267270
this.skip();
268271
/*
269272
await assertions.verificationFail({
@@ -278,7 +281,7 @@ export function sd2023Algorithms({
278281
'MUST be raised and SHOULD convey an error type of ' +
279282
'PROOF_GENERATION_ERROR.', async function() {
280283
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#base-proof-configuration-ecdsa-sd-2023:~:text=If%20proofConfig.type%20is%20not%20set%20to%20DataIntegrityProof%20and/or%20proofConfig.cryptosuite%20is%20not%20set%20to%20ecdsa%2Dsd%2D2023%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_GENERATION_ERROR.';
281-
this.cell.skipMessage = 'Not Implemented';
284+
this.test.cell.skipMessage = 'Not Implemented';
282285
this.skip();
283286
/*
284287
await assertions.verificationFail({
@@ -302,7 +305,7 @@ export function sd2023Algorithms({
302305
'cryptographic suite (type) and MAY contain a cryptosuite ' +
303306
'identifier (cryptosuite).', async function() {
304307
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#base-proof-serialization-ecdsa-sd-2023';
305-
this.cell.skipMessage = 'Not Implemented';
308+
this.test.cell.skipMessage = 'Not Implemented';
306309
this.skip();
307310
/*
308311
await assertions.verificationFail({
@@ -318,7 +321,7 @@ export function sd2023Algorithms({
318321
'signature count does not match the non-mandatory message count.',
319322
async function() {
320323
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#base-proof-serialization-ecdsa-sd-2023:~:text=If%20the%20length%20of%20signatures%20does%20not%20match%20the%20length%20of%20nonMandatory%2C%20an%20error%20MUST%20be%20raised%20and%20SHOULD%20convey%20an%20error%20type%20of%20PROOF_VERIFICATION_ERROR%2C%20indicating%20that%20the%20signature%20count%20does%20not%20match%20the%20non%2Dmandatory%20message%20count.';
321-
this.cell.skipMessage = 'Not Implemented';
324+
this.test.cell.skipMessage = 'Not Implemented';
322325
this.skip();
323326
});
324327
});

0 commit comments

Comments
 (0)