From 9501f11c6e95c61162d7784609ab2e451b9a786b Mon Sep 17 00:00:00 2001 From: Raymond Yeh Date: Wed, 27 Jan 2021 15:13:44 +0800 Subject: [PATCH 1/4] feat: verification for dns-did --- src/types/error.ts | 2 + .../did/didIdentityProof.test.ts | 2 +- .../issuerIdentity/dnsDid/dnsDidProof.test.ts | 226 ++++++++++++------ .../issuerIdentity/dnsDid/dnsDidProof.ts | 110 ++++++--- 4 files changed, 224 insertions(+), 116 deletions(-) diff --git a/src/types/error.ts b/src/types/error.ts index 6ccee5ad..6ce6491e 100644 --- a/src/types/error.ts +++ b/src/types/error.ts @@ -69,6 +69,8 @@ export enum OpenAttestationDnsDidCode { UNEXPECTED_ERROR = 1, MALFORMED_IDENTITY_PROOF = 2, INVALID_ISSUERS = 3, + UNSIGNED = 4, + } export enum OpenAttestationSignatureCode { UNEXPECTED_ERROR = 0, diff --git a/src/verifiers/issuerIdentity/did/didIdentityProof.test.ts b/src/verifiers/issuerIdentity/did/didIdentityProof.test.ts index 0b92530d..f4f32a6c 100644 --- a/src/verifiers/issuerIdentity/did/didIdentityProof.test.ts +++ b/src/verifiers/issuerIdentity/did/didIdentityProof.test.ts @@ -1,3 +1,4 @@ +import { v3 } from "@govtechsg/open-attestation"; import { openAttestationDidIdentityProof } from "./didIdentityProof"; import { documentRopstenValidWithDocumentStore } from "../../../../test/fixtures/v2/documentRopstenValidWithDocumentStore"; import { documentDidSigned } from "../../../../test/fixtures/v2/documentDidSigned"; @@ -10,7 +11,6 @@ import v3DidSignedRaw from "../../../../test/fixtures/v3/did-signed.json"; import v3DnsDidSignedRaw from "../../../../test/fixtures/v3/dnsdid-signed.json"; import v3DocumentStoreIssuedRaw from "../../../../test/fixtures/v3/documentStore-issued.json"; import v3TokenRegistryIssuedRaw from "../../../../test/fixtures/v3/tokenRegistry-issued.json"; -import { v3 } from "@govtechsg/open-attestation"; const v3DidSigned = v3DidSignedRaw as v3.SignedWrappedDocument; const v3DidWrapped = v3DidWrappedRaw as v3.WrappedDocument; diff --git a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts index 64025d5a..f18c8dda 100644 --- a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts +++ b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts @@ -1,3 +1,4 @@ +import { v3 } from "@govtechsg/open-attestation"; import { openAttestationDnsDidIdentityProof } from "./dnsDidProof"; import { documentRopstenValidWithDocumentStore } from "../../../../test/fixtures/v2/documentRopstenValidWithDocumentStore"; import { documentDidSigned } from "../../../../test/fixtures/v2/documentDidSigned"; @@ -9,6 +10,18 @@ import { } from "../../../../test/fixtures/v2/documentDnsDidMixedTokenRegistry"; import { getProvider } from "../../../common/utils"; +import v3DnsDidWrappedRaw from "../../../../test/fixtures/v3/dnsdid-wrapped.json"; +import v3DidSignedRaw from "../../../../test/fixtures/v3/did-signed.json"; +import v3DnsDidSignedRaw from "../../../../test/fixtures/v3/dnsdid-signed.json"; +import v3DocumentStoreIssuedRaw from "../../../../test/fixtures/v3/documentStore-issued.json"; +import v3TokenRegistryIssuedRaw from "../../../../test/fixtures/v3/tokenRegistry-issued.json"; + +const v3DidSigned = v3DidSignedRaw as v3.SignedWrappedDocument; +const v3DnsDidWrapped = v3DnsDidWrappedRaw as v3.WrappedDocument; +const v3DnsDidSigned = v3DnsDidSignedRaw as v3.SignedWrappedDocument; +const v3DocumentStoreIssued = v3DocumentStoreIssuedRaw as v3.WrappedDocument; +const v3TokenRegistryIssued = v3TokenRegistryIssuedRaw as v3.WrappedDocument; + const options = { provider: getProvider({ network: "ropsten" }), }; @@ -43,98 +56,153 @@ describe("test", () => { expect(openAttestationDnsDidIdentityProof.test(documentDnsDidSigned, options)).toBe(true); }); }); + describe("v3", () => { + it("should return true for document using `DNS-DID` top level identity proof", () => { + expect(openAttestationDnsDidIdentityProof.test(v3DnsDidSigned, options)).toBe(true); + expect(openAttestationDnsDidIdentityProof.test(v3DnsDidWrapped, options)).toBe(true); + }); + it("should return false for document using `DID` top level identity proof", () => { + expect(openAttestationDnsDidIdentityProof.test(v3DidSigned, options)).toBe(false); + }); + it("should return false for document using `DNS-TXT` top level identity proof", () => { + expect(openAttestationDnsDidIdentityProof.test(v3DocumentStoreIssued, options)).toBe(false); + expect(openAttestationDnsDidIdentityProof.test(v3TokenRegistryIssued, options)).toBe(false); + }); + }); }); describe("verify", () => { - it("should verify a document with dns binding to did", async () => { - const fragment = await openAttestationDnsDidIdentityProof.verify(documentDnsDidSigned, options); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Array [ - Object { - "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", - "location": "example.tradetrust.io", - "status": "VALID", - }, - ], - "name": "OpenAttestationDnsDidIdentityProof", - "status": "VALID", - "type": "ISSUER_IDENTITY", - } - `); - }); + describe("v2", () => { + it("should verify a document with dns binding to did", async () => { + const fragment = await openAttestationDnsDidIdentityProof.verify(documentDnsDidSigned, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Array [ + Object { + "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", + "location": "example.tradetrust.io", + "status": "VALID", + }, + ], + "name": "OpenAttestationDnsDidIdentityProof", + "status": "VALID", + "type": "ISSUER_IDENTITY", + } + `); + }); + it("should verify a document without dns binding to did", async () => { + const fragment = await openAttestationDnsDidIdentityProof.verify(documentDnsDidNoDnsTxt, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Array [ + Object { + "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", + "location": "example.com", + "status": "INVALID", + }, + ], + "name": "OpenAttestationDnsDidIdentityProof", + "status": "INVALID", + "type": "ISSUER_IDENTITY", + } + `); + }); + it("should fail if document has issuers not using DNS-DID", async () => { + const validFragment = await openAttestationDnsDidIdentityProof.verify( + documentDnsDidMixedTokenRegistryValid, + options + ); + expect(validFragment).toMatchInlineSnapshot(` + Object { + "data": Array [ + Object { + "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", + "location": "example.tradetrust.io", + "status": "VALID", + }, + Object { + "reason": Object { + "code": 3, + "codeString": "INVALID_ISSUERS", + "message": "Issuer is not using DID-DNS identityProof type", + }, + "status": "INVALID", + }, + ], + "name": "OpenAttestationDnsDidIdentityProof", + "status": "INVALID", + "type": "ISSUER_IDENTITY", + } + `); - it("should verify a document without dns binding to did", async () => { - const fragment = await openAttestationDnsDidIdentityProof.verify(documentDnsDidNoDnsTxt, options); - expect(fragment).toMatchInlineSnapshot(` - Object { - "data": Array [ - Object { - "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", - "location": "example.com", - "status": "INVALID", - }, - ], - "name": "OpenAttestationDnsDidIdentityProof", - "status": "INVALID", - "type": "ISSUER_IDENTITY", - } - `); + const invalidFragment = await openAttestationDnsDidIdentityProof.verify( + documentDnsDidMixedTokenRegistryInvalid, + options + ); + expect(invalidFragment).toMatchInlineSnapshot(` + Object { + "data": Array [ + Object { + "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", + "location": "example.com", + "status": "INVALID", + }, + Object { + "reason": Object { + "code": 3, + "codeString": "INVALID_ISSUERS", + "message": "Issuer is not using DID-DNS identityProof type", + }, + "status": "INVALID", + }, + ], + "name": "OpenAttestationDnsDidIdentityProof", + "status": "INVALID", + "type": "ISSUER_IDENTITY", + } + `); + }); }); - - it("should fail if document has issuers not using DNS-DID", async () => { - const validFragment = await openAttestationDnsDidIdentityProof.verify( - documentDnsDidMixedTokenRegistryValid, - options - ); - expect(validFragment).toMatchInlineSnapshot(` - Object { - "data": Array [ - Object { + describe("v3", () => { + it("should return valid fragment for document with dns binding to did", async () => { + const fragment = await openAttestationDnsDidIdentityProof.verify(v3DnsDidSigned, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", "location": "example.tradetrust.io", "status": "VALID", }, - Object { - "reason": Object { - "code": 3, - "codeString": "INVALID_ISSUERS", - "message": "Issuer is not using DID-DNS identityProof type", - }, - "status": "INVALID", + "name": "OpenAttestationDnsDidIdentityProof", + "status": "VALID", + "type": "ISSUER_IDENTITY", + } + `); + }); + it("should return invalid fragment for document without dns binding to did", async () => { + const documentWithoutDnsBinding = { + ...v3DnsDidSigned, + openAttestationMetadata: { + ...v3DnsDidSigned.openAttestationMetadata, + identityProof: { + type: v3.IdentityProofType.DNSDid, + identifier: "example.com", }, - ], - "name": "OpenAttestationDnsDidIdentityProof", - "status": "INVALID", - "type": "ISSUER_IDENTITY", - } - `); - - const invalidFragment = await openAttestationDnsDidIdentityProof.verify( - documentDnsDidMixedTokenRegistryInvalid, - options - ); - expect(invalidFragment).toMatchInlineSnapshot(` - Object { - "data": Array [ - Object { + }, + }; + const fragment = await openAttestationDnsDidIdentityProof.verify(documentWithoutDnsBinding, options); + expect(fragment).toMatchInlineSnapshot(` + Object { + "data": Object { "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", "location": "example.com", "status": "INVALID", }, - Object { - "reason": Object { - "code": 3, - "codeString": "INVALID_ISSUERS", - "message": "Issuer is not using DID-DNS identityProof type", - }, - "status": "INVALID", - }, - ], - "name": "OpenAttestationDnsDidIdentityProof", - "status": "INVALID", - "type": "ISSUER_IDENTITY", - } - `); + "name": "OpenAttestationDnsDidIdentityProof", + "status": "INVALID", + "type": "ISSUER_IDENTITY", + } + `); + }); }); }); diff --git a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts index 223097fa..c08f74ad 100644 --- a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts +++ b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts @@ -1,6 +1,11 @@ import { v2, v3, WrappedDocument, getData, utils } from "@govtechsg/open-attestation"; import { getDnsDidRecords } from "@govtechsg/dnsprove"; -import { VerificationFragmentType, Verifier } from "../../../types/core"; +import { + VerificationFragmentType, + Verifier, + VerificationFragment, + VerificationFragmentStatus, +} from "../../../types/core"; import { OpenAttestationDnsDidCode } from "../../../types/error"; import { withCodedErrorHandler } from "../../../common/errorHandler"; import { CodedError } from "../../../common/error"; @@ -23,9 +28,13 @@ const skip: VerifierType["skip"] = async () => { }; const test: VerifierType["test"] = (document) => { - if (!utils.isSignedWrappedV2Document(document)) return false; - const data = getData(document); - if (data?.issuers.some((issuer) => issuer.identityProof?.type === "DNS-DID")) return true; + if (utils.isWrappedV2Document(document)) { + const data = getData(document); + return !!data?.issuers.some((issuer) => issuer.identityProof?.type === "DNS-DID"); + } + if (utils.isWrappedV3Document(document)) { + return document.openAttestationMetadata.identityProof.type === v3.IdentityProofType.DNSDid; + } return false; }; @@ -35,7 +44,7 @@ interface IdentityProof { location?: string; } -interface VerificationFragment { +interface DnsVerificationFragment { status: "VALID" | "SKIPPED" | "INVALID"; location?: string; key?: string; @@ -44,12 +53,10 @@ interface VerificationFragment { const verifyIssuerDnsDid = async ({ key, location, - type: identityType, -}: IdentityProof): Promise => { - if (identityType !== "DNS-DID") - return { - status: "SKIPPED", - }; +}: { + key?: string; + location?: string; +}): Promise => { if (!location) throw new CodedError( "location is not present in identity proof", @@ -70,33 +77,64 @@ const verifyIssuerDnsDid = async ({ }; }; +const verifyV2 = async (document: v2.WrappedDocument): Promise => { + if (!utils.isSignedWrappedV2Document(document)) + throw new CodedError( + "document is not signed", + OpenAttestationDnsDidCode.UNSIGNED, + OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.UNSIGNED] + ); + const documentData = getData(document); + const deferredVerificationStatus: Promise[] = documentData.issuers.map((issuer) => { + if (issuer.identityProof?.type === "DNS-DID") + return verifyIssuerDnsDid({ key: issuer.identityProof.key, location: issuer.identityProof.location }); + return Promise.resolve({ + status: "INVALID", + reason: { + message: "Issuer is not using DID-DNS identityProof type", + code: OpenAttestationDnsDidCode.INVALID_ISSUERS, + codeString: OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.INVALID_ISSUERS], + }, + }); + }); + const verificationStatus = await Promise.all(deferredVerificationStatus); + const overallStatus = + verificationStatus.some((status) => status.status === "VALID") && + verificationStatus.every((status) => status.status === "VALID") + ? "VALID" + : "INVALID"; + return { + name, + type, + data: verificationStatus, + status: overallStatus, + }; +}; + +const verifyV3 = async (document: v3.WrappedDocument): Promise => { + if (!utils.isSignedWrappedV3Document(document)) + throw new CodedError( + "document is not signed", + OpenAttestationDnsDidCode.UNSIGNED, + OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.UNSIGNED] + ); + const location = document.openAttestationMetadata.identityProof.identifier; + const { key } = document.proof; + const verificationStatus = await verifyIssuerDnsDid({ key, location }); + + return { + name, + type, + data: verificationStatus, + status: verificationStatus.status, + }; +}; + const verify: VerifierType["verify"] = withCodedErrorHandler( async (document) => { - if (!utils.isSignedWrappedV2Document(document)) throw new Error("Only v2 is supported now"); - const documentData = getData(document); - const deferredVerificationStatus: Promise[] = documentData.issuers.map((issuer) => { - if (issuer.identityProof?.type === "DNS-DID") return verifyIssuerDnsDid(issuer.identityProof); - return Promise.resolve({ - status: "INVALID", - reason: { - message: "Issuer is not using DID-DNS identityProof type", - code: OpenAttestationDnsDidCode.INVALID_ISSUERS, - codeString: OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.INVALID_ISSUERS], - }, - }); - }); - const verificationStatus = await Promise.all(deferredVerificationStatus); - const overallStatus = - verificationStatus.some((status) => status.status === "VALID") && - verificationStatus.every((status) => status.status === "VALID") - ? "VALID" - : "INVALID"; - return { - name, - type, - data: verificationStatus, - status: overallStatus, - }; + if (utils.isWrappedV2Document(document)) return verifyV2(document); + if (utils.isWrappedV3Document(document)) return verifyV3(document); + throw new Error(""); }, { name, From 298f0aa55dac9f026d6e049059bba30bd41a9204 Mon Sep 17 00:00:00 2001 From: Raymond Yeh Date: Wed, 27 Jan 2021 15:27:54 +0800 Subject: [PATCH 2/4] chore: refactored constraint checks --- .../issuerIdentity/dnsDid/dnsDidProof.test.ts | 66 ++++--------------- .../issuerIdentity/dnsDid/dnsDidProof.ts | 62 +++++++++-------- 2 files changed, 42 insertions(+), 86 deletions(-) diff --git a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts index f18c8dda..6d43128e 100644 --- a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts +++ b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts @@ -4,10 +4,7 @@ import { documentRopstenValidWithDocumentStore } from "../../../../test/fixtures import { documentDidSigned } from "../../../../test/fixtures/v2/documentDidSigned"; import { documentDnsDidNoDnsTxt } from "../../../../test/fixtures/v2/documentDnsDidNoDnsTxt"; import { documentDnsDidSigned } from "../../../../test/fixtures/v2/documentDnsDidSigned"; -import { - documentDnsDidMixedTokenRegistryValid, - documentDnsDidMixedTokenRegistryInvalid, -} from "../../../../test/fixtures/v2/documentDnsDidMixedTokenRegistry"; +import { documentDnsDidMixedTokenRegistryValid } from "../../../../test/fixtures/v2/documentDnsDidMixedTokenRegistry"; import { getProvider } from "../../../common/utils"; import v3DnsDidWrappedRaw from "../../../../test/fixtures/v3/dnsdid-wrapped.json"; @@ -107,57 +104,18 @@ describe("verify", () => { } `); }); - it("should fail if document has issuers not using DNS-DID", async () => { - const validFragment = await openAttestationDnsDidIdentityProof.verify( - documentDnsDidMixedTokenRegistryValid, - options - ); - expect(validFragment).toMatchInlineSnapshot(` - Object { - "data": Array [ - Object { - "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", - "location": "example.tradetrust.io", - "status": "VALID", - }, - Object { - "reason": Object { - "code": 3, - "codeString": "INVALID_ISSUERS", - "message": "Issuer is not using DID-DNS identityProof type", - }, - "status": "INVALID", - }, - ], - "name": "OpenAttestationDnsDidIdentityProof", - "status": "INVALID", - "type": "ISSUER_IDENTITY", - } - `); - - const invalidFragment = await openAttestationDnsDidIdentityProof.verify( - documentDnsDidMixedTokenRegistryInvalid, - options - ); - expect(invalidFragment).toMatchInlineSnapshot(` + it("should error if document has issuers not using DNS-DID", async () => { + const fragment = await openAttestationDnsDidIdentityProof.verify(documentDnsDidMixedTokenRegistryValid, options); + expect(fragment).toMatchInlineSnapshot(` Object { - "data": Array [ - Object { - "key": "did:ethr:0xE712878f6E8d5d4F9e87E10DA604F9cB564C9a89#controller", - "location": "example.com", - "status": "INVALID", - }, - Object { - "reason": Object { - "code": 3, - "codeString": "INVALID_ISSUERS", - "message": "Issuer is not using DID-DNS identityProof type", - }, - "status": "INVALID", - }, - ], + "data": [Error: Issuer is not using DID-DNS identityProof type], "name": "OpenAttestationDnsDidIdentityProof", - "status": "INVALID", + "reason": Object { + "code": 3, + "codeString": "INVALID_ISSUERS", + "message": "Issuer is not using DID-DNS identityProof type", + }, + "status": "ERROR", "type": "ISSUER_IDENTITY", } `); @@ -179,7 +137,7 @@ describe("verify", () => { } `); }); - it("should return invalid fragment for document without dns binding to did", async () => { + it("should return valid fragment for document without dns binding to did", async () => { const documentWithoutDnsBinding = { ...v3DnsDidSigned, openAttestationMetadata: { diff --git a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts index c08f74ad..82a45ca4 100644 --- a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts +++ b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.ts @@ -37,15 +37,8 @@ const test: VerifierType["test"] = (document) => { } return false; }; - -interface IdentityProof { - type: string; - key?: string; - location?: string; -} - interface DnsVerificationFragment { - status: "VALID" | "SKIPPED" | "INVALID"; + status: VerificationFragmentStatus; location?: string; key?: string; } @@ -54,21 +47,9 @@ const verifyIssuerDnsDid = async ({ key, location, }: { - key?: string; - location?: string; + key: string; + location: string; }): Promise => { - if (!location) - throw new CodedError( - "location is not present in identity proof", - OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF, - "MALFORMED_IDENTITY_PROOF" - ); - if (!key) - throw new CodedError( - "key is not present in identity proof", - OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF, - "MALFORMED_IDENTITY_PROOF" - ); const records = await getDnsDidRecords(location); return { location, @@ -86,16 +67,33 @@ const verifyV2 = async (document: v2.WrappedDocument): Promise[] = documentData.issuers.map((issuer) => { - if (issuer.identityProof?.type === "DNS-DID") - return verifyIssuerDnsDid({ key: issuer.identityProof.key, location: issuer.identityProof.location }); - return Promise.resolve({ - status: "INVALID", - reason: { - message: "Issuer is not using DID-DNS identityProof type", - code: OpenAttestationDnsDidCode.INVALID_ISSUERS, - codeString: OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.INVALID_ISSUERS], - }, - }); + const { identityProof } = issuer; + if (!identityProof) + throw new CodedError( + "Identity proof missing", + OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF, + OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF] + ); + const { key, location, type } = identityProof; + if (type !== v2.IdentityProofType.DNSDid) + throw new CodedError( + "Issuer is not using DID-DNS identityProof type", + OpenAttestationDnsDidCode.INVALID_ISSUERS, + OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.INVALID_ISSUERS] + ); + if (!location) + throw new CodedError( + "location is not present in identity proof", + OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF, + OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF] + ); + if (!key) + throw new CodedError( + "key is not present in identity proof", + OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF, + OpenAttestationDnsDidCode[OpenAttestationDnsDidCode.MALFORMED_IDENTITY_PROOF] + ); + return verifyIssuerDnsDid({ key, location }); }); const verificationStatus = await Promise.all(deferredVerificationStatus); const overallStatus = From 4787ee9043aca064dc1cee022c32a9e939a5a1c3 Mon Sep 17 00:00:00 2001 From: Raymond Yeh Date: Wed, 27 Jan 2021 15:29:25 +0800 Subject: [PATCH 3/4] fix: lint --- src/types/error.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/types/error.ts b/src/types/error.ts index 6ce6491e..7d1a05d1 100644 --- a/src/types/error.ts +++ b/src/types/error.ts @@ -70,7 +70,6 @@ export enum OpenAttestationDnsDidCode { MALFORMED_IDENTITY_PROOF = 2, INVALID_ISSUERS = 3, UNSIGNED = 4, - } export enum OpenAttestationSignatureCode { UNEXPECTED_ERROR = 0, From d5fa799658d7ec6eb849371b8dcefac54f2918e3 Mon Sep 17 00:00:00 2001 From: yehjxraymond Date: Wed, 27 Jan 2021 16:10:19 +0800 Subject: [PATCH 4/4] fix: test description Co-authored-by: Nebulis --- src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts index 6d43128e..e3c53410 100644 --- a/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts +++ b/src/verifiers/issuerIdentity/dnsDid/dnsDidProof.test.ts @@ -137,7 +137,7 @@ describe("verify", () => { } `); }); - it("should return valid fragment for document without dns binding to did", async () => { + it("should return invalid fragment for document without dns binding to did", async () => { const documentWithoutDnsBinding = { ...v3DnsDidSigned, openAttestationMetadata: {