Skip to content

Commit

Permalink
Move created & expires into optionalTests and move optionalTests to b…
Browse files Browse the repository at this point in the history
…ottom of file.
  • Loading branch information
aljones15 committed Sep 6, 2024
1 parent 18b492a commit 619753c
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions suites/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ export function runDataIntegrityProofVerifyTests({
'after issuance.'
});
});
it('The value of the cryptosuite property MUST be a string that ' +
'identifies the cryptographic suite. If the processing environment ' +
'supports subtypes of string, the type of the cryptosuite value MUST ' +
'be the https://w3id.org/security#cryptosuiteString subtype of string.',
async function() {
this.test.link = 'https://w3c.github.io/vc-data-integrity/#introduction:~:text=The%20value%20of%20the%20cryptosuite%20property%20MUST%20be%20a%20string%20that%20identifies%20the%20cryptographic%20suite.%20If%20the%20processing%20environment%20supports%20subtypes%20of%20string%2C%20the%20type%20of%20the%20cryptosuite%20value%20MUST%20be%20the%20https%3A//w3id.org/security%23cryptosuiteString%20subtype%20of%20string.';
const credential = credentials.clone('invalidCryptosuite');
await verificationFail({credential, verifier});
});
if(optionalTests?.created) {
it('The date and time the proof was created is OPTIONAL and, if ' +
'included, MUST be specified as an [XMLSCHEMA11-2] dateTimeStamp ' +
Expand All @@ -159,16 +168,25 @@ export function runDataIntegrityProofVerifyTests({
const credential = credentials.clone('invalidCreated');
await verificationFail({credential, verifier});
});
// we can't tell if its interpreted correctly but we can ensure their
// verifier at least takes timestamps without Z or an offset.
it('(created) A conforming processor MAY chose to consume time values ' +
'that were incorrectly serialized without an offset.', async function() {
this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=be%20a%20string.-,created,-The%20date%20and';
await verificationSuccess({
credential: credentials.clone('noOffsetCreated'),
verifier
});
});
it('(expires) A conforming processor MAY chose to consume time values ' +
'that were incorrectly serialized without an offset.', async function() {
this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=interpreted%20as%20UTC.-,expires,-The%20expires%20property';
await verificationSuccess({
credential: credentials.clone('noOffsetExpires'),
verifier
});
});
}
it('The value of the cryptosuite property MUST be a string that ' +
'identifies the cryptographic suite. If the processing environment ' +
'supports subtypes of string, the type of the cryptosuite value MUST ' +
'be the https://w3id.org/security#cryptosuiteString subtype of string.',
async function() {
this.test.link = 'https://w3c.github.io/vc-data-integrity/#introduction:~:text=The%20value%20of%20the%20cryptosuite%20property%20MUST%20be%20a%20string%20that%20identifies%20the%20cryptographic%20suite.%20If%20the%20processing%20environment%20supports%20subtypes%20of%20string%2C%20the%20type%20of%20the%20cryptosuite%20value%20MUST%20be%20the%20https%3A//w3id.org/security%23cryptosuiteString%20subtype%20of%20string.';
const credential = credentials.clone('invalidCryptosuite');
await verificationFail({credential, verifier});
});
if(optionalTests.authentication) {
it('If options has a non-null domain item, it MUST be equal to ' +
'proof.domain or an error MUST be raised and SHOULD convey an ' +
Expand All @@ -193,24 +211,6 @@ export function runDataIntegrityProofVerifyTests({
}
});
});
// we can't tell if its interpreted correctly but we can ensure their
// verifier at least takes timestamps without Z or an offset.
it('(created) A conforming processor MAY chose to consume time values ' +
'that were incorrectly serialized without an offset.', async function() {
this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=be%20a%20string.-,created,-The%20date%20and';
await verificationSuccess({
credential: credentials.clone('noOffsetCreated'),
verifier
});
});
it('(expires) A conforming processor MAY chose to consume time values ' +
'that were incorrectly serialized without an offset.', async function() {
this.test.link = 'https://www.w3.org/TR/vc-data-integrity/#proofs:~:text=interpreted%20as%20UTC.-,expires,-The%20expires%20property';
await verificationSuccess({
credential: credentials.clone('noOffsetExpires'),
verifier
});
});
}
});
}
Expand Down

0 comments on commit 619753c

Please sign in to comment.