Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/15-di-bbs-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as bbs2023Cryptosuite from '@digitalbazaar/bbs-2023-cryptosuite';
import {
checkDataIntegrityProofVerifyErrors
} from 'data-integrity-test-suite-assertion';
import {documentLoader} from './vc-generator/documentLoader.js';
import {endpoints} from 'vc-test-suite-implementations';
import {filterVerifiers} from './helpers.js';
import {getMultiKey} from './vc-generator/key-gen.js';
Expand All @@ -30,6 +31,7 @@ for(const vcVersion of vectors.vcTypes) {
authentication: true
},
testDataOptions: {
documentLoader,
suiteName: 'bbs-2023',
key,
cryptosuite: bbs2023Cryptosuite,
Expand Down
3 changes: 3 additions & 0 deletions tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import {
issueCredentials
} from './vc-generator/index.js';
import {generators} from 'data-integrity-test-suite-assertion';
import {inspect} from 'util';
import {writeFile} from 'node:fs/promises';

inspect.defaultOptions.depth = null;

export async function verifySetup({credentials, keyTypes, suite}) {
const disclosed = {
//disclosedCredentials
Expand Down
13 changes: 13 additions & 0 deletions tests/vc-generator/contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ const setContexts = contexts => {
contextMap.set(key, structuredClone(value));
}
};
const invalidPurpose = {
'@id': 'https://w3id.org/security#invalidPurpose',
'@type': '@id',
'@container': '@set'
};

const {context: vc2Context} = namedCredentialsContexts.get('v2');
const v2Ctx = vc2Context['@context'];
v2Ctx.UnknownProofType = structuredClone(v2Ctx.DataIntegrityProof);
v2Ctx.DataIntegrityProof['@context'].proofPurpose['@context'].invalidPurpose =
invalidPurpose;
v2Ctx.undefinedTerm = 'urn:example:undefinedTerm';

const _dataIntegrityCtx = structuredClone(dataIntegrityCtx.CONTEXT);
const diCtx = _dataIntegrityCtx['@context'];
diCtx.UnknownProofType = structuredClone(diCtx.DataIntegrityProof);
diCtx.DataIntegrityProof['@context'].proofPurpose['@context'].invalidPurpose =
invalidPurpose;
diCtx.undefinedTerm = 'urn:example:undefinedTerm';

contextMap.set(
dataIntegrityCtx.constants.CONTEXT_URL,
_dataIntegrityCtx
Expand Down