Skip to content

Commit 484e1ff

Browse files
RishabhS7semantic-release-botnghaninnMoiz47moiz-sgtradex
authored
chore: ecdsa w3c verify (#100)
* fix: add w3c credential status check (#72) * fix: add w3c credential status check * fix: update test * fix: update enum status codes * fix: remove console * chore(release): 1.5.4 [skip ci] ## [1.5.4](v1.5.3...v1.5.4) (2025-06-17) ### Bug Fixes * add w3c credential status check ([#72](#72)) ([0111cb3](0111cb3)) * fix: upgrade package (#73) * chore(release): 1.5.5 [skip ci] ## [1.5.5](v1.5.4...v1.5.5) (2025-06-18) ### Bug Fixes * upgrade package ([#73](#73)) ([3c6c9c7](3c6c9c7)) * feat: support passing titleEscrowAddress to fetchEndorsementChain (#80) Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> * chore(release): 1.6.0 [skip ci] ## [1.6.0](v1.5.5...v1.6.0) (2025-07-14) ### Features * support passing titleEscrowAddress to fetchEndorsementChain ([#80](#80)) ([aa7b4f0](aa7b4f0)) * feat: add astron v5 (#81) Co-authored-by: maxufeng <maxufeng@caict.ac.cn> * chore(release): 1.7.0 [skip ci] ## [1.7.0](v1.6.0...v1.7.0) (2025-07-15) ### Features * add astron v5 ([#81](#81)) ([0bebeae](0bebeae)) * fix: update tradetrust-tt/tradetrust package (#87) * fix: update tradetrust-tt/tradetrust package * fix: update version * fix: update imports * chore(release): 1.7.1 [skip ci] ## [1.7.1](v1.7.0...v1.7.1) (2025-07-25) ### Bug Fixes * update tradetrust-tt/tradetrust package ([#87](#87)) ([e4f75a4](e4f75a4)) * fix: upgrade packages (#88) * chore(release): 1.7.2 [skip ci] ## [1.7.2](v1.7.1...v1.7.2) (2025-07-28) ### Bug Fixes * upgrade packages ([#88](#88)) ([0cc314e](0cc314e)) * fix: error message types (#89) * chore(release): 1.7.3 [skip ci] ## [1.7.3](v1.7.2...v1.7.3) (2025-07-28) ### Bug Fixes * error message types ([#89](#89)) ([d83bada](d83bada)) * fix: upgrade packages (#90) * chore(release): 1.7.4 [skip ci] ## [1.7.4](v1.7.3...v1.7.4) (2025-07-29) ### Bug Fixes * upgrade packages ([#90](#90)) ([758651d](758651d)) * feat: token registry functions (#96) * chore(release): 1.8.0 [skip ci] ## [1.8.0](v1.7.4...v1.8.0) (2025-07-30) ### Features * token registry functions ([#96](#96)) ([6c379e9](6c379e9)) * fix: accept return function (#97) * chore(release): 1.8.1 [skip ci] ## [1.8.1](v1.8.0...v1.8.1) (2025-08-07) ### Bug Fixes * accept return function ([#97](#97)) ([6398017](6398017)) * fix: update edsa w3c verifier * fix: update vefiable doc v2.0 * feat: token registry functions (#74) * chore(release): 1.6.0-alpha.1 [skip ci] ## [1.6.0-alpha.1](v1.5.3...v1.6.0-alpha.1) (2025-06-30) ### Features * token registry functions ([#74](#74)) ([5690fcd](5690fcd)) ### Miscellaneous Chores * back merge ([#75](#75)) ([7cc1891](7cc1891)), closes [#72](#72) [#72](#72) [#73](#73) [#73](#73) * feat: mint function (#78) * fix: add w3c credential status check (#72) * fix: add w3c credential status check * fix: update test * fix: update enum status codes * fix: remove console * chore(release): 1.5.4 [skip ci] ## [1.5.4](v1.5.3...v1.5.4) (2025-06-17) ### Bug Fixes * add w3c credential status check ([#72](#72)) ([0111cb3](0111cb3)) * fix: upgrade package (#73) * chore(release): 1.5.5 [skip ci] ## [1.5.5](v1.5.4...v1.5.5) (2025-06-18) ### Bug Fixes * upgrade package ([#73](#73)) ([3c6c9c7](3c6c9c7)) * feat: add transfer holder function * feat: add transfer owners beneficiary * chore: tests cleanup * chore: tests cleanup * fix: remove console * fix: rever useendorement chain * fix: remove console * feat: add reject transfer functions * chore: trigger rebuild after rebase * chore(release): 1.5.4 [skip ci] * add w3c credential status check ([#72](#72)) ([0111cb3](0111cb3)) * feat: add transfer holder function * feat: add transfer owners beneficiary * chore: tests cleanup * fix: remove console * fix: rever useendorement chain * feat: add reject transfer functions * chore: trigger rebuild after rebase * chore: trigger rebuild after rebase * feat: token registry return functions * feat: add mint function * fix: update fixes * fix: update tests * revert: revert changes --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Ng Han Inn <43451336+nghaninn@users.noreply.github.com> * feat: owner of function (#79) * feat: add ownerOf function * feat: add test cases * fix: update test cases for ownerof function * fix: update imports * fix: update imports * chore(release): 1.6.0-alpha.2 [skip ci] ## [1.6.0-alpha.2](v1.6.0-alpha.1...v1.6.0-alpha.2) (2025-07-15) ### Features * mint function ([#78](#78)) ([2ea52ce](2ea52ce)), closes [#72](#72) [#72](#72) [#73](#73) [#73](#73) [#72](#72) * owner of function ([#79](#79)) ([81d0e36](81d0e36)) * chore: e2e transfers tests (#82) * feat: add ownerOf function * feat: add test cases * fix: update test cases for ownerof function * chore: add e2e test for transfer functions * chore: add e2e test for transfer functions * feat: add ownerOf function * feat: add test cases * fix: update test cases for ownerof function * chore: add e2e test for transfer functions * chore: add e2e test for transfer functions * fix: update mock tests * fix: update mock test fixtures * fix: update mock tests for mint and return * fix: update test script * fix: update imports * fix: update gitignore * fix: delete cache * fix: update imports * chore: e2e tests reject transfer (#83) * chore: e2e tests for reject functions * fix: reject function ethers v6 compatible * fix: update imports * fix: mock test cases * fix: import fixed * fix: e2e return token tests (#84) * chore: e2e tests for reject functions * fix: reject function ethers v6 compatible * fix: update imports * fix: mock test cases * fix: static call fixes * chore: add e2e test cases * fix: update imports * fix: update imports * fix: tests * fix: mock functions * fix: change name * fix: update imports * fix: update src imports * chore(release): 1.6.0-alpha.3 [skip ci] ## [1.6.0-alpha.3](v1.6.0-alpha.2...v1.6.0-alpha.3) (2025-07-18) ### Bug Fixes * e2e return token tests ([#84](#84)) ([703be01](703be01)) ### Miscellaneous Chores * e2e tests reject transfer ([#83](#83)) ([58a8da2](58a8da2)) * e2e transfers tests ([#82](#82)) ([145e763](145e763)) * chore: merge main into v1 (#85) * fix: add w3c credential status check (#72) * fix: add w3c credential status check * fix: update test * fix: update enum status codes * fix: remove console * chore(release): 1.5.4 [skip ci] ## [1.5.4](v1.5.3...v1.5.4) (2025-06-17) ### Bug Fixes * add w3c credential status check ([#72](#72)) ([0111cb3](0111cb3)) * fix: upgrade package (#73) * chore(release): 1.5.5 [skip ci] ## [1.5.5](v1.5.4...v1.5.5) (2025-06-18) ### Bug Fixes * upgrade package ([#73](#73)) ([3c6c9c7](3c6c9c7)) * feat: support passing titleEscrowAddress to fetchEndorsementChain (#80) Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> * chore(release): 1.6.0 [skip ci] ## [1.6.0](v1.5.5...v1.6.0) (2025-07-14) ### Features * support passing titleEscrowAddress to fetchEndorsementChain ([#80](#80)) ([aa7b4f0](aa7b4f0)) * feat: add astron v5 (#81) Co-authored-by: maxufeng <maxufeng@caict.ac.cn> * chore(release): 1.7.0 [skip ci] ## [1.7.0](v1.6.0...v1.7.0) (2025-07-15) ### Features * add astron v5 ([#81](#81)) ([0bebeae](0bebeae)) --------- Co-authored-by: RishabhS7 <59636880+RishabhS7@users.noreply.github.com> Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Ng Han Inn <43451336+nghaninn@users.noreply.github.com> Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> Co-authored-by: caict-develop-zhangbo <68949988+caict-develop-zhangbo@users.noreply.github.com> Co-authored-by: maxufeng <maxufeng@caict.ac.cn> * fix: trigger release (#86) Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> * chore(release): 1.6.0-alpha.4 [skip ci] ## [1.6.0-alpha.4](v1.6.0-alpha.3...v1.6.0-alpha.4) (2025-07-23) ### Bug Fixes * trigger release ([#86](#86)) ([d2fb6fb](d2fb6fb)) ### Miscellaneous Chores * merge main into v1 ([#85](#85)) ([b81b422](b81b422)), closes [#72](#72) [#72](#72) [#73](#73) [#73](#73) [#80](#80) [#80](#80) [#81](#81) [#81](#81) * chore: rebase v1 with main (#95) * fix: add w3c credential status check (#72) * fix: add w3c credential status check * fix: update test * fix: update enum status codes * fix: remove console * chore(release): 1.5.4 [skip ci] * add w3c credential status check ([#72](#72)) ([0111cb3](0111cb3)) * fix: upgrade package (#73) * chore(release): 1.5.5 [skip ci] * upgrade package ([#73](#73)) ([3c6c9c7](3c6c9c7)) * feat: support passing titleEscrowAddress to fetchEndorsementChain (#80) Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> * chore(release): 1.6.0 [skip ci] * support passing titleEscrowAddress to fetchEndorsementChain ([#80](#80)) ([aa7b4f0](aa7b4f0)) * feat: add astron v5 (#81) Co-authored-by: maxufeng <maxufeng@caict.ac.cn> * chore(release): 1.7.0 [skip ci] * add astron v5 ([#81](#81)) ([0bebeae](0bebeae)) * fix: update tradetrust-tt/tradetrust package (#87) * fix: update tradetrust-tt/tradetrust package * fix: update version * fix: update imports * chore(release): 1.7.1 [skip ci] * update tradetrust-tt/tradetrust package ([#87](#87)) ([e4f75a4](e4f75a4)) * fix: upgrade packages (#88) * chore(release): 1.7.2 [skip ci] * upgrade packages ([#88](#88)) ([0cc314e](0cc314e)) * fix: error message types (#89) * chore(release): 1.7.3 [skip ci] * error message types ([#89](#89)) ([d83bada](d83bada)) * fix: upgrade packages (#90) * chore(release): 1.7.4 [skip ci] * upgrade packages ([#90](#90)) ([758651d](758651d)) --------- Co-authored-by: RishabhS7 <59636880+RishabhS7@users.noreply.github.com> Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Ng Han Inn <43451336+nghaninn@users.noreply.github.com> Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> Co-authored-by: caict-develop-zhangbo <68949988+caict-develop-zhangbo@users.noreply.github.com> Co-authored-by: maxufeng <maxufeng@caict.ac.cn> * fix: add w3c credential status check (#72) * fix: add w3c credential status check * fix: update test * fix: update enum status codes * fix: remove console * chore(release): 1.5.4 [skip ci] * add w3c credential status check ([#72](#72)) ([0111cb3](0111cb3)) * fix: upgrade package (#73) * chore(release): 1.5.5 [skip ci] * upgrade package ([#73](#73)) ([3c6c9c7](3c6c9c7)) * fix: update edsa w3c verifier * fix: resolve conflicts * fix: rebase * fix: resolve conflicts * fix: update package lock * fix: resolve conflicts * fix: verify test * fix: cryptosuit types --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Ng Han Inn <43451336+nghaninn@users.noreply.github.com> Co-authored-by: Moiz Shaikh <58319530+Moiz47@users.noreply.github.com> Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com> Co-authored-by: caict-develop-zhangbo <68949988+caict-develop-zhangbo@users.noreply.github.com> Co-authored-by: maxufeng <maxufeng@caict.ac.cn> Co-authored-by: rongquan1 <rongquan.low@gmail.com>
1 parent b54b146 commit 484e1ff

12 files changed

Lines changed: 3877 additions & 5196 deletions

File tree

CHANGELOG.md

Lines changed: 111 additions & 105 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 3165 additions & 5041 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trustvc/trustvc",
3-
"version": "1.7.4",
3+
"version": "1.8.1",
44
"description": "TrustVC library",
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",
@@ -121,10 +121,11 @@
121121
"@tradetrust-tt/tradetrust": "^6.10.2",
122122
"@tradetrust-tt/tradetrust-utils": "^2.4.2",
123123
"@tradetrust-tt/tt-verify": "^9.5.1",
124-
"@trustvc/w3c-context": "^1.2.13",
125-
"@trustvc/w3c-credential-status": "^1.2.13",
126-
"@trustvc/w3c-issuer": "^1.2.4",
127-
"@trustvc/w3c-vc": "^1.2.17",
124+
"@trustvc/w3c": "^1.3.0-alpha.3",
125+
"@trustvc/w3c-context": "^1.3.0-alpha.3",
126+
"@trustvc/w3c-credential-status": "^1.3.0-alpha.3",
127+
"@trustvc/w3c-issuer": "^1.3.0-alpha.3",
128+
"@trustvc/w3c-vc": "^1.3.0-alpha.3",
128129
"ethers": "^5.8.0",
129130
"ethersV6": "npm:ethers@^6.14.4",
130131
"js-sha3": "^0.9.3",

src/__tests__/core/verify.test.ts

Lines changed: 226 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { verifyDocument } from '../..';
33
import * as transferableRecordsUtils from '../../verify/fragments/document-status/transferableRecords/utils';
44
import {
55
SIGNED_WRAPPED_DOCUMENT_DNS_DID_V3,
6+
ECDSA_W3C_VERIFIABLE_DOCUMENT_V1_1,
7+
ECDSA_W3C_VERIFIABLE_DOCUMENT_V2_0,
8+
ECDSA_W3C_DERIVED_DOCUMENT_V1_1,
9+
ECDSA_W3C_DERIVED_DOCUMENT_V2_0,
610
W3C_TRANSFERABLE_RECORD,
711
W3C_VERIFIABLE_DOCUMENT,
812
WRAPPED_DOCUMENT_DID_TOKEN_REGISTRY_V3,
@@ -23,6 +27,16 @@ describe.concurrent('W3C verify', () => {
2327
"status": "VALID",
2428
"type": "DOCUMENT_INTEGRITY",
2529
},
30+
{
31+
"name": "EcdsaW3CSignatureIntegrity",
32+
"reason": {
33+
"code": 0,
34+
"codeString": "SKIPPED",
35+
"message": "Document either has no proof or proof type is not 'DataIntegrityProof' or proof cryptosuite is not 'ecdsa-sd-2023'.",
36+
},
37+
"status": "SKIPPED",
38+
"type": "DOCUMENT_INTEGRITY",
39+
},
2640
{
2741
"data": [
2842
{
@@ -268,49 +282,59 @@ describe.concurrent('W3C verify', () => {
268282
expect(
269283
await verifyDocument(W3C_TRANSFERABLE_RECORD as any, { rpcProviderUrl: providerUrl }),
270284
).toMatchInlineSnapshot(`
271-
[
272-
{
273-
"data": true,
274-
"name": "W3CSignatureIntegrity",
275-
"status": "VALID",
276-
"type": "DOCUMENT_INTEGRITY",
277-
},
278-
{
279-
"name": "W3CCredentialStatus",
280-
"reason": {
281-
"code": 0,
282-
"codeString": "SKIPPED",
283-
"message": "Document does not have a valid credentialStatus or type.",
284-
},
285-
"status": "SKIPPED",
286-
"type": "DOCUMENT_STATUS",
285+
[
286+
{
287+
"data": true,
288+
"name": "W3CSignatureIntegrity",
289+
"status": "VALID",
290+
"type": "DOCUMENT_INTEGRITY",
291+
},
292+
{
293+
"name": "EcdsaW3CSignatureIntegrity",
294+
"reason": {
295+
"code": 0,
296+
"codeString": "SKIPPED",
297+
"message": "Document either has no proof or proof type is not 'DataIntegrityProof' or proof cryptosuite is not 'ecdsa-sd-2023'.",
287298
},
288-
{
289-
"data": {
290-
"tokenRegistry": "0x6c2a002A5833a100f38458c50F11E71Aa1A342c6",
291-
},
292-
"name": "TransferableRecords",
293-
"status": "VALID",
294-
"type": "DOCUMENT_STATUS",
299+
"status": "SKIPPED",
300+
"type": "DOCUMENT_INTEGRITY",
301+
},
302+
{
303+
"name": "W3CCredentialStatus",
304+
"reason": {
305+
"code": 0,
306+
"codeString": "SKIPPED",
307+
"message": "Document does not have a valid credentialStatus or type.",
295308
},
296-
{
297-
"name": "W3CEmptyCredentialStatus",
298-
"reason": {
299-
"code": 0,
300-
"codeString": "SKIPPED",
301-
"message": "Document contains a credentialStatus.",
302-
},
303-
"status": "SKIPPED",
304-
"type": "DOCUMENT_STATUS",
309+
"status": "SKIPPED",
310+
"type": "DOCUMENT_STATUS",
311+
},
312+
{
313+
"data": {
314+
"tokenRegistry": "0x6c2a002A5833a100f38458c50F11E71Aa1A342c6",
305315
},
306-
{
307-
"data": true,
308-
"name": "W3CIssuerIdentity",
309-
"status": "VALID",
310-
"type": "ISSUER_IDENTITY",
316+
"name": "TransferableRecords",
317+
"status": "VALID",
318+
"type": "DOCUMENT_STATUS",
319+
},
320+
{
321+
"name": "W3CEmptyCredentialStatus",
322+
"reason": {
323+
"code": 0,
324+
"codeString": "SKIPPED",
325+
"message": "Document contains a credentialStatus.",
311326
},
312-
]
313-
`);
327+
"status": "SKIPPED",
328+
"type": "DOCUMENT_STATUS",
329+
},
330+
{
331+
"data": true,
332+
"name": "W3CIssuerIdentity",
333+
"status": "VALID",
334+
"type": "ISSUER_IDENTITY",
335+
},
336+
]
337+
`);
314338
},
315339
);
316340

@@ -424,6 +448,169 @@ describe.concurrent('W3C verify', () => {
424448
});
425449
});
426450

451+
const ecdsaTestScenarios = [
452+
{
453+
version: 'v1.1',
454+
signedCredential: ECDSA_W3C_VERIFIABLE_DOCUMENT_V1_1,
455+
derivedCredential: ECDSA_W3C_DERIVED_DOCUMENT_V1_1,
456+
},
457+
{
458+
version: 'v2.0',
459+
signedCredential: ECDSA_W3C_VERIFIABLE_DOCUMENT_V2_0,
460+
derivedCredential: ECDSA_W3C_DERIVED_DOCUMENT_V2_0,
461+
},
462+
];
463+
464+
describe.each(ecdsaTestScenarios)(
465+
'W3C ECDSA $version Verify',
466+
({ version, signedCredential, derivedCredential }) => {
467+
it(`should verify a derived ECDSA ${version} W3C document and return all valid fragments`, async ({
468+
expect,
469+
}) => {
470+
expect(await verifyDocument(derivedCredential as any)).toEqual(
471+
expect.arrayContaining([
472+
expect.objectContaining({
473+
data: true,
474+
name: 'EcdsaW3CSignatureIntegrity',
475+
reason: {
476+
message: 'Document verified successfully',
477+
},
478+
status: 'VALID',
479+
type: 'DOCUMENT_INTEGRITY',
480+
}),
481+
expect.objectContaining({
482+
data: true,
483+
name: 'W3CIssuerIdentity',
484+
status: 'VALID',
485+
type: 'ISSUER_IDENTITY',
486+
}),
487+
]),
488+
);
489+
});
490+
491+
it('should handle ECDSA W3C non-derived document verification', async ({ expect }) => {
492+
const result = await verifyDocument(signedCredential as any);
493+
494+
// Check that our ECDSA verifier ran
495+
expect(result).toEqual(
496+
expect.arrayContaining([
497+
expect.objectContaining({
498+
data: true,
499+
name: 'EcdsaW3CSignatureIntegrity',
500+
reason: {
501+
message: 'Document verified after derivation',
502+
},
503+
status: 'VALID',
504+
type: 'DOCUMENT_INTEGRITY',
505+
}),
506+
expect.objectContaining({
507+
data: true,
508+
name: 'W3CIssuerIdentity',
509+
status: 'VALID',
510+
type: 'ISSUER_IDENTITY',
511+
}),
512+
]),
513+
);
514+
});
515+
516+
it('should return INVALID status for DOCUMENT_INTEGRITY when signature is tampered', async ({
517+
expect,
518+
}) => {
519+
const tampered: any = { ...derivedCredential, id: 'urn:uuid:tampered-id' };
520+
expect(await verifyDocument(tampered)).toEqual(
521+
expect.arrayContaining([
522+
expect.objectContaining({
523+
data: false,
524+
name: 'EcdsaW3CSignatureIntegrity',
525+
reason: {
526+
message: 'Invalid signature.',
527+
},
528+
status: 'INVALID',
529+
type: 'DOCUMENT_INTEGRITY',
530+
}),
531+
]),
532+
);
533+
});
534+
535+
it('should skip DOCUMENT_INTEGRITY verification for unsupported cryptosuite', async ({
536+
expect,
537+
}) => {
538+
const unsupportedCryptosuite: any = {
539+
...derivedCredential,
540+
proof: {
541+
...derivedCredential.proof,
542+
cryptosuite: 'eddsa-2022',
543+
},
544+
};
545+
546+
expect(await verifyDocument(unsupportedCryptosuite)).toEqual(
547+
expect.arrayContaining([
548+
expect.objectContaining({
549+
name: 'EcdsaW3CSignatureIntegrity',
550+
reason: {
551+
code: W3CCredentialStatusCode.SKIPPED,
552+
codeString: 'SKIPPED',
553+
message:
554+
"Document either has no proof or proof type is not 'DataIntegrityProof' or proof cryptosuite is not 'ecdsa-sd-2023'.",
555+
},
556+
status: 'SKIPPED',
557+
type: 'DOCUMENT_INTEGRITY',
558+
}),
559+
]),
560+
);
561+
});
562+
563+
it('should skip DOCUMENT_INTEGRITY verification for unsupported proof type', async ({
564+
expect,
565+
}) => {
566+
const unsupportedProofType: any = {
567+
...derivedCredential,
568+
proof: {
569+
...derivedCredential.proof,
570+
type: 'Ed25519Signature2020',
571+
},
572+
};
573+
574+
expect(await verifyDocument(unsupportedProofType)).toEqual(
575+
expect.arrayContaining([
576+
expect.objectContaining({
577+
name: 'EcdsaW3CSignatureIntegrity',
578+
reason: {
579+
code: W3CCredentialStatusCode.SKIPPED,
580+
codeString: 'SKIPPED',
581+
message:
582+
"Document either has no proof or proof type is not 'DataIntegrityProof' or proof cryptosuite is not 'ecdsa-sd-2023'.",
583+
},
584+
status: 'SKIPPED',
585+
type: 'DOCUMENT_INTEGRITY',
586+
}),
587+
]),
588+
);
589+
});
590+
591+
it('should skip DOCUMENT_INTEGRITY verification when proof is missing', async ({ expect }) => {
592+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
593+
const { proof, ...documentWithoutProof } = derivedCredential;
594+
595+
expect(await verifyDocument(documentWithoutProof as any)).toEqual(
596+
expect.arrayContaining([
597+
expect.objectContaining({
598+
name: 'EcdsaW3CSignatureIntegrity',
599+
reason: {
600+
code: W3CCredentialStatusCode.SKIPPED,
601+
codeString: 'SKIPPED',
602+
message:
603+
"Document either has no proof or proof type is not 'DataIntegrityProof' or proof cryptosuite is not 'ecdsa-sd-2023'.",
604+
},
605+
status: 'SKIPPED',
606+
type: 'DOCUMENT_INTEGRITY',
607+
}),
608+
]),
609+
);
610+
});
611+
},
612+
);
613+
427614
describe.concurrent('V3 verify', () => {
428615
it('should verify a DND_DID document and return fragments', async ({ expect }) => {
429616
expect(await verifyDocument(SIGNED_WRAPPED_DOCUMENT_DNS_DID_V3)).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)