From 8f95262ad0338eeda37dcf615a73d101196ec341 Mon Sep 17 00:00:00 2001 From: Bram ten Cate Date: Mon, 8 Aug 2022 12:59:43 +0200 Subject: [PATCH] VDX-76 removed vc subject interface property --- lib/types/index.ts | 1 - lib/verifier/WellKnownDidVerifier.ts | 4 ---- test/verifier.spec.ts | 7 ------- 3 files changed, 12 deletions(-) diff --git a/lib/types/index.ts b/lib/types/index.ts index 6068870..97622e6 100644 --- a/lib/types/index.ts +++ b/lib/types/index.ts @@ -10,7 +10,6 @@ export interface IIssuerConfig { export interface IDomainLinkageCredential { '@context': string[] issuer: string - subject?: string credentialSubject: ICredentialSubject type?: string[] issuanceDate: string diff --git a/lib/verifier/WellKnownDidVerifier.ts b/lib/verifier/WellKnownDidVerifier.ts index 5b1e137..1594388 100644 --- a/lib/verifier/WellKnownDidVerifier.ts +++ b/lib/verifier/WellKnownDidVerifier.ts @@ -360,10 +360,6 @@ export class WellKnownDidVerifier { if (credential.issuer && credential.credentialSubject.id !== credential.issuer) return Promise.reject({ status: ValidationStatusEnum.INVALID, message: 'Property credentialSubject.id does not match issuer property' }) - // The credentialSubject.id value MUST be equal to the subject of the Domain Linkage Credential. - if (credential.subject && credential.credentialSubject.id !== credential.subject) - return Promise.reject({ status: ValidationStatusEnum.INVALID, message: 'Property credentialSubject.id does not match subject property' }) - // Property credentialSubject.origin MUST be present. if (!credential.credentialSubject.origin) return Promise.reject({ status: ValidationStatusEnum.INVALID, message: 'Property credentialSubject.origin is not present within the credential'}) diff --git a/test/verifier.spec.ts b/test/verifier.spec.ts index 6bf6aef..3aa4ea7 100644 --- a/test/verifier.spec.ts +++ b/test/verifier.spec.ts @@ -272,13 +272,6 @@ describe('Domain Linkage Verifier', () => { }); }); - it('should reject if credentialSubject.id does not match present subject value', async () => { - await expect(verifier.verifyDomainLinkageCredential({ credential: { ...CREDENTIAL, subject: 'did:key:other' } })).rejects.toEqual({ - status: ValidationStatusEnum.INVALID, - message: 'Property credentialSubject.id does not match subject property', - }); - }); - it('should reject if credentialSubject.origin is not valid domain value', async () => { await expect( verifier.verifyDomainLinkageCredential({