diff --git a/.gitignore b/.gitignore index 2d31b09..fe5a252 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules coverage /dist .idea +.launch* +.vscode* diff --git a/README.md b/README.md index e5ed86f..90f6965 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Utility Library to securely handle verifiable presentations. [![CircleCI](https://circleci.com/gh/identity-com/verifiable-presentations.svg?style=svg)](https://circleci.com/gh/identity-com/verifiable-presentations) -Verifiable-presentations provides methods to run operations over a collection of verifiable credentials and evidences, such as query for credential identifiers, search for claims, feth claim value, and non-cryptographically and cryptographically secure verify the data against the proofs. +Verifiable-presentations provides methods to run operations over a collection of verifiable credentials and evidences, such as query for credential identifiers, search for claims, fetch claim values, and non-cryptographically and cryptographically secure verify the data against the proofs. [Documentation](https://identity-com.github.io/verifiable-presentations/) @@ -46,4 +46,43 @@ claims = await presentationManager.findClaims(criteria); const claimValue = await presentationManager.getClaimValue(claims[0]); ``` +## PIIFactory + +A class to allow easy extraction of PII from a DSR Response based on a specific dsrRequest implementation, with a given mapping and formatters specific to that DSR. It also allows generating a new Scope Request based on unique URL generation. + +``` +const mapping = { + first_name: { identifier: 'claim-cvc:Name.givenNames-v1' }, + last_name: { identifier: 'claim-cvc:Name.familyNames-v1' }, + date_of_birth: { identifier: 'claim-cvc:Document.dateOfBirth-v1' }, + street: { identifier: 'claim-cvc:Identity.address-v1' }, +}; +const formatters = { + street: { format: claimValue => `${claimValue.street} ${claimValue.unit}` }, + date_of_birth: { format: claimValue => `${claimValue.year}-${claimValue.month}-${claimValue.day}` }, +}; + +const piiFactory = new PIIFactory(dsrRequest, mapping, formatters); + +const eventsURL = 'https://testEvents'; +const idvDid = 'did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a'; +const dsrResolver = { + id: '123', + // key pair generated purely for this test + signingKeys: { + xpub: '0414a08b13afa8d33c499ec828065775915ddf0301634d35e26c6cec4ad0f0f2b72c79e90357d47c7ba65a3c03bb22ac7e273c5d01494448a155df8a28da33b48d', + xprv: 'a4947aa34ce507e995a60a455582d97f3fd1163eba3dd990ea1541a8fa049828', + }, +}; +const urlGeneratorFn = evidenceName => `https:////${evidenceName}.json`; + + +// generate a DSR +const dsr = await piiFactory.generateDSR(eventsURL, idvDid, dsrResolver, urlGeneratorFn); + +// extract PII from a DSR response +const extractedPII = await piiFactory.extractPII(dsrResponse); + +``` + For more detailed working examples, please, refer to the tests in [`index.test.ts`](src/__tests__/index.test.ts). diff --git a/package-lock.json b/package-lock.json index b45af3c..19c172b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -263,6 +263,30 @@ "winston": "^3.2.1" } }, + "@identity.com/dsr": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@identity.com/dsr/-/dsr-1.0.14.tgz", + "integrity": "sha512-uWqT9lgKa/TdM4P1IilW78igFqJw0GfEmiMTAYvVC9h0QZs34x+OdRGSgGfGH+/PfDIjZJzZQI/mykeS8fCAiA==", + "requires": { + "@identity.com/credential-commons": "^1.0.32", + "@identity.com/uca": "^1.0.15", + "bottlejs": "^1.7.1", + "dotenv": "^6.0.0", + "json-stable-stringify": "^1.0.1", + "lodash": "^4.17.15", + "mkdirp": "^0.5.1", + "sift": "^6.0.0", + "sjcl": "github:civicteam/sjcl#v1.0.8-ecc", + "type-of-is": "^3.5.1", + "winston": "^3.2.0" + }, + "dependencies": { + "sjcl": { + "version": "github:civicteam/sjcl#74fcc71a486a41d39200767d9235f6eac9e51f26", + "from": "github:civicteam/sjcl#v1.0.8-ecc" + } + } + }, "@identity.com/uca": { "version": "1.0.15", "resolved": "https://registry.npmjs.org/@identity.com/uca/-/uca-1.0.15.tgz", @@ -518,11 +542,6 @@ "jest-diff": "^24.3.0" } }, - "@types/lodash": { - "version": "4.14.149", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz", - "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==" - }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -535,12 +554,22 @@ "integrity": "sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==", "dev": true }, + "@types/ramda": { + "version": "github:types/npm-ramda#9529aa3c8ff70ff84afcbc0be83443c00f30ea90", + "from": "github:types/npm-ramda#dist" + }, "@types/stack-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", "dev": true }, + "@types/uuid": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-7.0.2.tgz", + "integrity": "sha512-8Ly3zIPTnT0/8RCU6Kg/G3uTICf9sRwYOpUzSIM3503tLIKcnJPRuinHhXngJUy2MntrEf6dlpOHXJju90Qh5w==", + "dev": true + }, "@types/yargs": { "version": "13.0.2", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.2.tgz", @@ -3615,6 +3644,14 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "~0.0.0" + } + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -3646,6 +3683,11 @@ "graceful-fs": "^4.1.6" } }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -3915,8 +3957,7 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mixin-deep": { "version": "1.3.2", @@ -3943,7 +3984,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" } @@ -4420,6 +4460,11 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "ramda": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", + "integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==" + }, "randexp": { "version": "0.4.9", "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.9.tgz", diff --git a/package.json b/package.json index b27b895..501a12e 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "devDependencies": { "@types/jest": "^24.9.1", "@types/node": "^12.12.31", + "@types/uuid": "^7.0.2", "jest": "^24.9.0", "prettier": "^1.19.1", "ts-jest": "^24.3.0", @@ -53,7 +54,9 @@ }, "dependencies": { "@identity.com/credential-commons": "^1.0.32", - "@types/lodash": "^4.14.149", - "crypto": "^1.0.1" + "@identity.com/dsr": "^1.0.14", + "@types/ramda": "github:types/npm-ramda#dist", + "crypto": "^1.0.1", + "ramda": "^0.25.0" } } diff --git a/src/PIIFactory.ts b/src/PIIFactory.ts new file mode 100644 index 0000000..144b727 --- /dev/null +++ b/src/PIIFactory.ts @@ -0,0 +1,194 @@ +import R from 'ramda'; +import * as uuidv4 from 'uuid/v4'; +import { VerifiablePresentationManager, ClaimCriteriaMap, CredentialArtifacts, Evidence } from './VerifiablePresentationManager'; +import DsrResolver from '@identity.com/dsr'; +import { Interface } from 'readline'; +import { Credential } from './Credential'; + +const { ScopeRequest } = DsrResolver; +/** + * Get the names of the evidence documents promised by a DSR response + * + * EvidenceProofs in a DSR response look like this: + * "evidenceProofs": [{ + * "name": "credential-cvc:IdDocument-v2", + * "proofs": { + * "idDocumentFront": { + * "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + * } + * } + * }] + * For each entry in the list of evidence proofs, extract the actual document names + * @return {Array} + */ +const evidenceProofsToDSRDocumentNames = (evidenceProofs: any = []) => R.pipe( + R.pluck('proofs'), + R.map(Object.keys), + R.flatten, +)(evidenceProofs); + +interface RequestedDocument { + name?: string, + proofs?: object +} +/** returns the evidences document names from the provider DSR */ +const dsrRequestedDocuments = (dsrRequest: object) => Object.keys(R.pathOr([], ['payload', 'channels', 'evidences'], dsrRequest)); +/** + * Traverse the provided presentation credentials and creates a map of document proofs for each + * credential identifier + * @param {Array} presentations: an array of credentials + * @param {Array} requestedDocuments: documents that the DSR asks for + * @returns {Array}: e.g. { + * * name: 'credential-cvc:IdDocument-v2', + * * proofs: { + * * idDocumentFront: { data: '195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4' }, + * * } + * * } + */ +const evidenceProofsFromCredentials = (presentations: Credential[], requestedDocuments: any = []) => presentations + .map( + (credential: Credential) => { + const evidenceClaims = R.pathOr([], ['claim', 'document', 'evidences'], credential); + const filteredEvidenceClaims = R.pick(requestedDocuments, evidenceClaims); + return { name: credential.identifier, proofs: R.mergeAll(filteredEvidenceClaims) }; + } + ) + // only return evidence proofs for credentials that require evidence + .filter(evidenceProofsByCredential => R.not(R.isEmpty(evidenceProofsByCredential.proofs))); + +/** + * Return the list of evidence documents that the DSR response promises + * @param {Object} dsrResponse + * @param {Object} dsrRequest + */ +const expectedEvidenceProofs = (dsrResponse: DSRResponse, dsrRequest: object) => { + const presentations: Credential[] = dsrResponse.verifiableData.map(R.prop('credential')); + return evidenceProofsFromCredentials(presentations, dsrRequestedDocuments(dsrRequest)); +}; + + + +/** + * Add an upload url to an evidence channel, so the client knows where to send the evidence documents. + * The url will be generated by the client to be unique + * @param {Function} urlGeneratorFn: A function to generate a unique URL based on the evidence name provided + * @return {function(*, *): {url: *}} + */ +const addEvidenceUrl = (urlGeneratorFn: (evidenceName: string) => string) => (evidenceChannelConfiguration: object, evidenceName: string) => { + const url = urlGeneratorFn(evidenceName); + return { + ...evidenceChannelConfiguration, + url, + }; +}; + +export interface CredentialItemRequest { + requestIndex?: number, + identifier?: string, + constraints?: any, +} +export interface VerifiableDataItem { + credentialItemRequest?: CredentialItemRequest, + credential?: Credential, + requestStatus?: any[] | null, + userId?: string | null +} +export interface DSRResponse { + verifiableData?: VerifiableDataItem[], + requestStatus?: any[] | null, + userId?: string | null +} +export interface Formatters { + [key: string]: any; +} +/** + * A class for extracting PII from a DSR Response based on a specific dsrRequest implementation, with a given mapping and formatters, + * specific to that DSR + */ +export class PIIFactory { + dsrRequest: object; + mapping: ClaimCriteriaMap; + formatters: Formatters; + /** + * @param {Object} dsrRequest + * @param {ClaimCriteriaMap} mapping + * @param {Formatters} formatters + */ + constructor(dsrRequest: object, mapping: ClaimCriteriaMap, formatters: object) { + this.dsrRequest = dsrRequest; + this.mapping = mapping; + this.formatters = formatters; + }; + + /** + * The client is asked for a list of documents that the provider is interested in (requestedDocuments) + * It returns in the credential, a list of documents that it can provide. + * Return the intersection between these two, to identify which documents are expected. + * + * @param evidenceProofs + * @return {string[]} + */ + expectedDocumentsGivenEvidenceProofs(evidenceProofs?: any[]) { + const promisedDocuments = evidenceProofsToDSRDocumentNames(evidenceProofs); + return R.intersection(dsrRequestedDocuments(this.dsrRequest), promisedDocuments); + }; + + /** + * Validate the dsr response, extract the PII, and format it for the provider. + * @param dsrResponse + * @return {Promise<{evidenceProofs: *, formattedClaims: *}>} + */ + async extractPII(dsrResponse: DSRResponse) { + const presentations: Credential[] = dsrResponse.verifiableData.map(R.prop('credential')); + const evidenceProofs = expectedEvidenceProofs(dsrResponse, this.dsrRequest); + const artifacts: CredentialArtifacts = { + presentations, + evidences: [], + }; + try { + const verifiablePresentation = new VerifiablePresentationManager({ + skipAddVerify: true, skipGetVerify: true, allowGetUnverified: true, + }); + // this throws an error if the DSR response is invalid + await verifiablePresentation.addCredentialArtifacts(artifacts); + + // using the credential to provider mapping, get the credentials values + const mappedClaimValues = await verifiablePresentation.mapClaimValues(this.mapping); + + const formatIfFormatterExists = (value: any, key: string) => (value && this.formatters[key] ? this.formatters[key].format(value) : value); + const formattedClaims = R.mapObjIndexed(formatIfFormatterExists, mappedClaimValues); + + return { formattedClaims, evidenceProofs }; + } catch (error) { + throw new Error('The dsr response on the requirements is invalid'); + } + }; + /** + * Generate a DSR based on the template and evidence functions provided + * @param {String} eventsURL + * @param {String} idvDid + * @param {Object} dsrResolver + * @param {Function} urlGeneratorFn + */ + generateDSR(eventsURL: string, idvDid: string, dsrResolver: object, urlGeneratorFn: (evidenceName: string) => string) { + + if (!this.dsrRequest) { throw new Error('DSR not provided'); } + + const uuid = uuidv4.default(); + const requestedItems = R.pathOr([], ['payload', 'credentialItems'], this.dsrRequest); + // iterate over the requested items array, set the values on the path constraints.meta.issue.is.$eq for the idv value + const updatedRequestedItems = R.map(R.assocPath((['constraints', 'meta', 'issuer', 'is', '$eq']), idvDid))(requestedItems); + + // add a fresh S3 upload url to each evidence channel, tailored for this user + const evidenceChannelTemplate = R.pathOr([], ['payload', 'channels', 'evidences'], this.dsrRequest); + const evidences = R.mapObjIndexed(addEvidenceUrl(urlGeneratorFn), evidenceChannelTemplate); + + const channelsConfig = { + eventsURL, + evidences, + }; + const appConfig = R.pathOr([], ['payload', 'requesterInfo', 'app'], this.dsrRequest); + + return ScopeRequest.buildSignedRequestBody(new ScopeRequest.ScopeRequest(uuid, updatedRequestedItems, channelsConfig, appConfig, dsrResolver)); + }; +} \ No newline at end of file diff --git a/src/PresentationVerifier.ts b/src/PresentationVerifier.ts index b15ed12..35f00a6 100644 --- a/src/PresentationVerifier.ts +++ b/src/PresentationVerifier.ts @@ -1,4 +1,3 @@ -import _ from 'lodash'; import { VC } from '@identity.com/credential-commons/src'; import { Credential, CredentialProof } from './Credential'; diff --git a/src/VerifiablePresentationManager.ts b/src/VerifiablePresentationManager.ts index f9a9b70..7616018 100644 --- a/src/VerifiablePresentationManager.ts +++ b/src/VerifiablePresentationManager.ts @@ -1,5 +1,5 @@ import crypto from 'crypto'; -import _ from 'lodash'; +import R from 'ramda'; import { ClaimIdentifier, CredentialIdentifier, @@ -8,6 +8,46 @@ import { } from './Credential'; import { PresentationVerifier, VerifyFunction } from './PresentationVerifier'; +/** + * @param {Object} fields: a JSON properties fields object + * @param {Object} paths: already calculated paths to be appended to + * @param {String} pathPrepend: existing path for nested key in question + * @returns {Array}: an array of path objects of type + * { + * {String} path + * {String}: type + * {String}: description + * } + */ +const NESTED_PATH_DELIMITER = '.'; +/** + * for the given object, recursively return an array of all the paths inside the object, including nested paths + * @param { [prop: string]: any } objToMatch: + * @param {string} pathPrepend: a string that grows with recursion, i.e. 'credential', 'credential.email' + * @returns {string[]} an array of paths i.e. ['credential', 'credential.email'] + */ +const getFlattenedPaths = (objToMatch: { [prop: string]: any }, pathPrepend: string = '') => { + const localPathsObject = R.mapObjIndexed((value: any, key: string) => { + const currentPath = `${pathPrepend}${(pathPrepend ? NESTED_PATH_DELIMITER : '')}${key}`; + // recurse objects and arrays, otherwise just return the paths + if (['object', 'array'].includes(typeof value)) { + return getFlattenedPaths(value, currentPath); + } else { + return [currentPath] + } + }, objToMatch); + return Array.from(new Set(R.flatten(R.values(localPathsObject)))) as string[]; // use a set to remove duplicates +}; +/** + * takes an array of paths delimited with a '.' and checks that all the paths of the objToMatch and the objToCheck are equal + * @param {string[]} flattenedPaths paths in an object e.g. ['identifier', 'credential.id'...] + * @param { [prop: string]: any } objToMatch: object whose paths must all match objToCheck + * @param { [prop: string]: any } objToCheck: object whose paths must all match objToMatch + * @returns {Boolean}: whether all the paths match or not + */ +const matchAllObjectKeys = (flattenedPaths: string[], objToMatch: { [prop: string]: any }) => (objToCheck: { [prop: string]: any }) => { + return R.all(R.equals(true), flattenedPaths.map(R.split(NESTED_PATH_DELIMITER)).map(path => R.path(path, objToMatch) === R.path(path, objToCheck))); +} /** * Used to setup VerifiablePresentationManager global behavior */ @@ -75,14 +115,14 @@ export interface SearchClaimCriteria { * A mapping from key (an identifier) to a search claim criteria */ export interface ClaimCriteriaMap { - [key: string] : SearchClaimCriteria; + [key: string]: SearchClaimCriteria; } /** * A mapping from key (an identifier) to claim value (an object) */ export interface ClaimValueMap { - [key: string] : any; + [key: string]: any; } /** @@ -166,13 +206,13 @@ export class VerifiablePresentationManager { presentations: PresentationReference[]; claims: AvailableClaim[]; status: VerifiablePresentationManagerStatus; - verifier : PresentationVerifier; + verifier: PresentationVerifier; /** * @param options - Defines the global behavior and security of VerifiablePresentationManager * @param verifyAnchor - An async function that is able to verify the presentation anchor in a public Blockchain */ - constructor(options: VPMOptions, verifyAnchor? : VerifyFunction) { + constructor(options: VPMOptions, verifyAnchor?: VerifyFunction) { this.options = { skipAddVerify: false, skipGetVerify: false, @@ -236,7 +276,7 @@ export class VerifiablePresentationManager { * */ async listPresentations(): Promise { - let verifiedPresentationRefs : PresentationReference[] = []; + let verifiedPresentationRefs: PresentationReference[] = []; if (!this.options.skipGetVerify) { verifiedPresentationRefs = await this.getVerifiedPresentationRefs(); } @@ -251,12 +291,12 @@ export class VerifiablePresentationManager { * */ async listClaims(): Promise { - let claimsFromVerifiedPresentations : AvailableClaim[] = []; + let claimsFromVerifiedPresentations: AvailableClaim[] = []; if (!this.options.skipGetVerify) { const verifiedPresentationRefs = await this.getVerifiedPresentationRefs(); - claimsFromVerifiedPresentations = _.filter( - this.claims, - (claim : AvailableClaim) => verifiedPresentationRefs.includes(claim.credentialRef) + claimsFromVerifiedPresentations = R.filter( + (claim: AvailableClaim) => verifiedPresentationRefs.includes(claim.credentialRef), + this.claims ); } return (this.options.allowGetUnverified) ? this.claims : claimsFromVerifiedPresentations; @@ -274,7 +314,7 @@ export class VerifiablePresentationManager { if (!this.options.skipGetVerify) { verified = await this.verifyPresentation(presentationRef); } - const claims = _.filter(this.claims, { credentialRef: presentationRef }); + const claims = R.filter(R.propEq('credentialRef', presentationRef), this.claims); return (this.options.allowGetUnverified || verified) ? claims : []; }; @@ -284,11 +324,11 @@ export class VerifiablePresentationManager { * the search never includes known invalid claims */ async findClaims(criteria: SearchClaimCriteria): Promise { - const claims = _.filter(this.claims, criteria); - - const verifiedPresentations : PresentationReference[] = []; + const flattenedPaths: string[] = getFlattenedPaths(criteria); + const claims = R.filter(matchAllObjectKeys(flattenedPaths, criteria), this.claims); + const verifiedPresentations: PresentationReference[] = []; if (!this.options.skipGetVerify) { - const presentationRefs = claims.map((claim : AvailableClaim) => claim.credentialRef); + const presentationRefs = claims.map((claim: AvailableClaim) => claim.credentialRef); for (const presentationRef of presentationRefs) { const verified = await this.verifyPresentation(presentationRef); if (verified) { @@ -299,7 +339,7 @@ export class VerifiablePresentationManager { return (this.options.allowGetUnverified) ? claims - : _.filter(claims, (claim : AvailableClaim) => verifiedPresentations.includes(claim.credentialRef)); + : R.filter((claim: AvailableClaim) => verifiedPresentations.includes(claim.credentialRef), claims); } /** @@ -308,8 +348,8 @@ export class VerifiablePresentationManager { * if `allowGetUnverified` is true, then the search also includes claims not verified yet. * if no claim matches a claim criteria, the value for the relative key will be null. */ - async mapClaimValues(claimCriteriaMap: ClaimCriteriaMap, flatten? : boolean): Promise { - const claimMappedValues : ClaimValueMap = {}; + async mapClaimValues(claimCriteriaMap: ClaimCriteriaMap, flatten?: boolean): Promise { + const claimMappedValues: ClaimValueMap = {}; for (const key of Object.keys(claimCriteriaMap)) { const criteria = claimCriteriaMap[key]; const claims = await this.findClaims(criteria); @@ -317,7 +357,7 @@ export class VerifiablePresentationManager { } if (flatten) { - return _.keys(claimMappedValues).map(key => ( + return R.keys(claimMappedValues).map((key: string) => ( { name: key, value: claimMappedValues[key] } )); } @@ -338,21 +378,21 @@ export class VerifiablePresentationManager { let verified = false; if (!this.options.skipGetVerify) { - verified = await this.verifyPresentation(availableClaim.credentialRef); + verified = await this.verifyPresentation(availableClaim.credentialRef); }; if (!verified && !this.options.allowGetUnverified) { - return null; + return null; } - return _.get(presentation.claim, availableClaim.claimPath); + return R.path(availableClaim.claimPath.split('.'), presentation.claim); } /** * List managed evidences * if `allowGetUnverified` is true it return unverified values. */ - async listEvidences() : Promise { - let verifiedEvidences : Evidence[] = []; + async listEvidences(): Promise { + let verifiedEvidences: Evidence[] = []; if (!this.options.skipGetVerify) { const verifiedPresentations = await this.verifyPresentations(true); verifiedEvidences = this.verifyEvidences(verifiedPresentations); @@ -390,10 +430,10 @@ export class VerifiablePresentationManager { wasGrantedForDSR(presentationRef: PresentationReference, originalRequestDSR: DSRJSON) { // TODO verify that the DSR is valid and was not tampered const dsr = JSON.parse(originalRequestDSR); - const requesterId = _.get(dsr, 'payload.requesterInfo.requesterId'); - const requestId = _.get(dsr, 'payload.id'); + const requesterId = R.path('payload.requesterInfo.requesterId'.split('.'), dsr); + const requestId = R.path('payload.id'.split('.'), dsr); - if (_.isEmpty(requesterId) || _.isEmpty(requestId)) { + if (R.isEmpty(requesterId) || R.isEmpty(requestId)) { return false; } @@ -415,21 +455,21 @@ export class VerifiablePresentationManager { /** * Remove the invalid artifacts and return a status of the resultant artifacts */ - async purgeInvalidArtifacts() : Promise { + async purgeInvalidArtifacts(): Promise { const verifiedPresentations = await this.verifyPresentations(true); - const verifiedIds = _.map(verifiedPresentations, (presentation : Credential) => presentation.id); + const verifiedIds = R.map((presentation: Credential) => presentation.id, verifiedPresentations); const verifiedEvidences = this.verifyEvidences(verifiedPresentations, true); this.artifacts = { presentations: verifiedPresentations, - evidences: verifiedEvidences + evidences: verifiedEvidences } - _.remove( - this.presentations, - (presentationRef : PresentationReference) => !verifiedIds.includes(presentationRef.uid) + this.presentations = R.reject( + (presentationRef: PresentationReference) => !verifiedIds.includes(presentationRef.uid), + this.presentations ); - _.remove( - this.claims, - (claim : AvailableClaim) => !verifiedIds.includes(claim.credentialRef.uid) + this.claims = R.reject( + (claim: AvailableClaim) => !verifiedIds.includes(claim.credentialRef.uid), + this.claims ); this.status.totalPresentations = this.artifacts.presentations.length; this.status.totalEvidences = this.artifacts.evidences.length; @@ -440,27 +480,27 @@ export class VerifiablePresentationManager { * Private mthods */ - private getPresentation(presentationRef : PresentationReference) : Credential { - return _.find(this.artifacts.presentations, (presentation : Credential) => ( + private getPresentation(presentationRef: PresentationReference): Credential { + return R.find((presentation: Credential) => ( presentation.id === presentationRef.uid - && presentation.identifier === presentationRef.identifier - )); + && presentation.identifier === presentationRef.identifier + ), this.artifacts.presentations); } - private getClaimPresentation(availableClaim : AvailableClaim) : Credential | undefined { - return _.find(this.artifacts.presentations, (presentation : Credential) => ( + private getClaimPresentation(availableClaim: AvailableClaim): Credential | undefined { + return R.find((presentation: Credential) => ( presentation.id === availableClaim.credentialRef.uid - )); + ), this.artifacts.presentations); } - private findEvidencePresentation(evidence : Evidence) : Credential | undefined { - return _.find(this.artifacts.presentations, (presentation : Credential) => { + private findEvidencePresentation(evidence: Evidence): Credential | undefined { + return R.find((presentation: Credential) => { const presentationClaims = JSON.stringify(presentation.claim); return presentationClaims.includes(evidence.sha256); - }); + }, this.artifacts.presentations); } - private aggregateCredentialArtifacts(artifacts : CredentialArtifacts) { + private aggregateCredentialArtifacts(artifacts: CredentialArtifacts) { if (this.artifacts.presentations && artifacts.presentations) { this.artifacts.presentations = this.artifacts.presentations.concat(artifacts.presentations); } @@ -469,7 +509,7 @@ export class VerifiablePresentationManager { } } - private getPresentationReference(credential: Credential) : PresentationReference { + private getPresentationReference(credential: Credential): PresentationReference { return { identifier: credential.identifier, uid: credential.id @@ -484,7 +524,7 @@ export class VerifiablePresentationManager { })); } - private async verifyPresentation(presentationRef : PresentationReference) : Promise { + private async verifyPresentation(presentationRef: PresentationReference): Promise { const credential = this.getPresentation(presentationRef); const verified = await this.verifier.cryptographicallySecureVerify(credential); @@ -495,8 +535,8 @@ export class VerifiablePresentationManager { return verified; } - private async verifyPresentations(notThrow = this.options.notThrow) : Promise { - const verifiedPresentations : Credential[] = []; + private async verifyPresentations(notThrow = this.options.notThrow): Promise { + const verifiedPresentations: Credential[] = []; for (const presentation of this.artifacts.presentations) { const verified = await this.verifier.cryptographicallySecureVerify(presentation); if (verified) { @@ -504,39 +544,39 @@ export class VerifiablePresentationManager { } } if (!notThrow) { - const unverifiedPresentations = _.difference(this.artifacts.presentations, verifiedPresentations); - if (!_.isEmpty(unverifiedPresentations)) { - const unverifiedIds = _.map(unverifiedPresentations, (presentation : Credential) => presentation.id); - throw new Error(`Unverified Presentations: ${_.join(unverifiedIds)}`); + const unverifiedPresentations = R.difference(this.artifacts.presentations, verifiedPresentations); + if (!R.isEmpty(unverifiedPresentations)) { + const unverifiedIds = R.map((presentation: Credential) => presentation.id, unverifiedPresentations); + throw new Error(`Unverified Presentations: ${R.join(unverifiedIds)}`); } } return verifiedPresentations; } - private verifyEvidence(evidence : Evidence, verifiedPresentations : Credential[]) : boolean { + private verifyEvidence(evidence: Evidence, verifiedPresentations: Credential[]): boolean { // check if there is a valid presentation referencing the evidence const presentation = this.findEvidencePresentation(evidence); - if (!presentation || !_.find(verifiedPresentations, { id: presentation.id })) { + if (!presentation || !R.find(R.propEq('id', presentation.id), verifiedPresentations)) { return false; } // check if the base64 data hash matches the sha256 value const dataPrefix = /^data:.*;base64,/; - const base64Data = _.replace(evidence.base64Encoded, dataPrefix, ''); // remove prefix + const base64Data = R.replace(dataPrefix, '', evidence.base64Encoded); // remove prefix const decodedData = Buffer.from(base64Data, 'base64'); const calculatedSha256 = crypto.createHash('sha256').update(decodedData).digest('hex'); return (calculatedSha256 === evidence.sha256); } - private verifyEvidences(verifiedPresentations : Credential[], notThrow = this.options.notThrow) : Evidence[] { - const verifiedEvidences = _.filter(this.artifacts.evidences, (evidence : Evidence) => ( + private verifyEvidences(verifiedPresentations: Credential[], notThrow = this.options.notThrow): Evidence[] { + const verifiedEvidences = R.filter((evidence: Evidence) => ( this.verifyEvidence(evidence, verifiedPresentations) - )); + ), this.artifacts.evidences); if (!notThrow) { - const unverifiedEvidences = _.difference(this.artifacts.evidences, verifiedEvidences); - if (!_.isEmpty(unverifiedEvidences)) { - const unverifiedIds = _.map(unverifiedEvidences, (evidence : Evidence) => evidence.content); - throw new Error(`Unverified Evidences: ${_.join(unverifiedIds)}`); + const unverifiedEvidences = R.difference(this.artifacts.evidences, verifiedEvidences); + if (!R.isEmpty(unverifiedEvidences)) { + const unverifiedIds = R.map((evidence: Evidence) => evidence.content, unverifiedEvidences); + throw new Error(`Unverified Evidences: ${R.join(unverifiedIds)}`); } } return verifiedEvidences; @@ -544,10 +584,10 @@ export class VerifiablePresentationManager { private async getVerifiedPresentationRefs(): Promise { const verifiedPresentations = await this.verifyPresentations(); - const verifiedIds = _.map(verifiedPresentations, (presentation : Credential) => presentation.id); - return _.filter( - this.presentations, - (presentation : PresentationReference) => verifiedIds.includes(presentation.uid) + const verifiedIds = R.map((presentation: Credential) => presentation.id, verifiedPresentations); + return R.filter( + (presentation: PresentationReference) => verifiedIds.includes(presentation.uid), + this.presentations ); } } diff --git a/src/__tests__/PIIFactory.test.ts b/src/__tests__/PIIFactory.test.ts new file mode 100644 index 0000000..0aae1fc --- /dev/null +++ b/src/__tests__/PIIFactory.test.ts @@ -0,0 +1,135 @@ +import { ScopeRequest } from '@identity.com/dsr'; +import { PIIFactory, DSRResponse, Formatters } from '../PIIFactory'; +import * as dsrResponse from './fixtures/piiFactory/userPIIFromDsrResponseUsCountry.json'; +import * as dsrResponseWithTwoDocuments from './fixtures/piiFactory/userPIIFromDsrResponseUsCountryFrontAndBack.json'; +import * as brokenDsrResponse from './fixtures/piiFactory/brokenDsrResponse.json'; +import * as dsrRequest from './fixtures/piiFactory/dsrTemplate.json'; + +const { verifySignedRequestBody } = ScopeRequest; + +const mapping = { + first_name: { identifier: 'claim-cvc:Name.givenNames-v1' }, + last_name: { identifier: 'claim-cvc:Name.familyNames-v1' }, + date_of_birth: { identifier: 'claim-cvc:Document.dateOfBirth-v1' }, + street: { identifier: 'claim-cvc:Identity.address-v1' }, +}; + +interface StreetClaimFormatter { + street: string, + unit: string +} +interface DOBClaimFormatter { + year: string, + month: string, + day: string +} +const formatters: Formatters = { + street: { format: (claimValue: StreetClaimFormatter) => `${claimValue.street} ${claimValue.unit}` }, + date_of_birth: { format: (claimValue: DOBClaimFormatter) => `${claimValue.year}-${claimValue.month}-${claimValue.day}` }, +}; + +let piiFactory: PIIFactory; +describe('PIIFactory', () => { + beforeEach(() => { + piiFactory = new PIIFactory(dsrRequest, mapping, formatters); + }); + + describe('extractPII', () => { + it('should extract PII and evidenceProofs from a valid DSR Response', async () => { + const extractedPII = await piiFactory.extractPII(dsrResponse as DSRResponse); + + expect(extractedPII).toEqual({ + formattedClaims: { + first_name: 'Civic', + last_name: 'User', + date_of_birth: '1900-1-1', + street: '1 Market St Suite 402', + }, + evidenceProofs: [{ + name: 'credential-cvc:IdDocument-v2', + proofs: { + idDocumentFront: { + algorithm: 'sha256', + data: '195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4', + }, + }, + }], + }); + }); + + it('should throw an exception if the dsr response is invalid', async () => { + const shouldFail = piiFactory.extractPII(brokenDsrResponse as DSRResponse); + + return expect(shouldFail).rejects.toThrow('The dsr response on the requirements is invalid'); + }); + + it('should extract evidenceProofs for multiple documents if provided in the DSR response', async () => { + const extractedPII = await piiFactory.extractPII(dsrResponseWithTwoDocuments as DSRResponse); + expect(extractedPII).toEqual({ + formattedClaims: { + first_name: 'Civic', + last_name: 'User', + date_of_birth: '1900-1-1', + street: '1 Market St Suite 402' + }, + evidenceProofs: [ + { + name: 'credential-cvc:IdDocument-v2', + proofs: { + idDocumentFront: { + algorithm: 'sha256', + data: '195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4' + }, + idDocumentBack: { + algorithm: 'sha256', + data: '195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4' + } + } + } + ] + }); + }); + }); + + describe('generateDSR', () => { + const eventsURL = 'https://testEvents'; + const idvDid = 'did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a'; + const dsrResolver = { + id: '123', + // key pair generated purely for this test + signingKeys: { + xpub: '0414a08b13afa8d33c499ec828065775915ddf0301634d35e26c6cec4ad0f0f2b72c79e90357d47c7ba65a3c03bb22ac7e273c5d01494448a155df8a28da33b48d', + xprv: 'a4947aa34ce507e995a60a455582d97f3fd1163eba3dd990ea1541a8fa049828', + }, + }; + const urlGeneratorFn = (evidenceName: string) => `https:////${evidenceName}.json`; + + it('should return a generated DSR', async () => { + const dsr = await piiFactory.generateDSR(eventsURL, idvDid, dsrResolver, urlGeneratorFn); + const verificationResult = verifySignedRequestBody(dsr); + + expect(verificationResult).toBeTruthy(); + }); + + }); + const evidenceProofs = [ + { + "name": "credential-cvc:IdDocument-v2", + "proofs": { + "idDocumentFront": { + "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + } + } + } + ]; + describe('expectedDocumentsGivenEvidenceProofs', () => { + it('should return an array of documents', () => { + const evidenceProofsResponse = piiFactory.expectedDocumentsGivenEvidenceProofs(evidenceProofs); + expect(evidenceProofsResponse).toEqual(['idDocumentFront']); + }); + it('should return an empty array with no evidenceProofs', () => { + const evidenceProofsResponse = piiFactory.expectedDocumentsGivenEvidenceProofs(); + expect(evidenceProofsResponse).toEqual([]); + }); + }); +}); diff --git a/src/__tests__/PresentationVerifier.test.ts b/src/__tests__/PresentationVerifier.test.ts index 6c2feab..0f94ace 100644 --- a/src/__tests__/PresentationVerifier.test.ts +++ b/src/__tests__/PresentationVerifier.test.ts @@ -1,5 +1,5 @@ -import _ from 'lodash'; import { Credential } from '../Credential'; +import R from 'ramda'; import { PresentationVerifier, VerifyFunction } from '../PresentationVerifier'; import emailCredential from './fixtures/emailCredential.json'; import idDocumentCredential from './fixtures/idDocumentCredential.json'; @@ -28,7 +28,7 @@ describe('PresentationVerifier', () => { }); it('should return false if the credential claim does not match the leaves', () => { - const invalidEmailCredential = _.cloneDeep(emailCredential); + const invalidEmailCredential = R.clone(emailCredential); invalidEmailCredential.claim.contact.email.username = 'invalid'; const verified = verifier.nonCryptographicallySecureVerify(invalidEmailCredential as Credential); @@ -36,7 +36,7 @@ describe('PresentationVerifier', () => { }); it('should return false if a leave target hash does not match', () => { - const invalidEmailCredential = _.cloneDeep(emailCredential); + const invalidEmailCredential = R.clone(emailCredential); invalidEmailCredential.proof.leaves[0].targetHash += 'a'; const verified = verifier.nonCryptographicallySecureVerify(invalidEmailCredential as Credential); @@ -44,7 +44,7 @@ describe('PresentationVerifier', () => { }); it('should return false if a leave has an invalid value', () => { - const invalidEmailCredential = _.cloneDeep(emailCredential); + const invalidEmailCredential = R.clone(emailCredential); invalidEmailCredential.proof.leaves[0].value += 'a'; const verified = verifier.nonCryptographicallySecureVerify(invalidEmailCredential as Credential); @@ -53,38 +53,38 @@ describe('PresentationVerifier', () => { }); describe('Cryptographically secure verify', () => { - it('should return true if the credential is valid and the verify functions are not provided', async (done) => { + it('should return true if the credential is valid and the verify functions are not provided', async () => { const verifier = new PresentationVerifier(); const verified = await verifier.cryptographicallySecureVerify(emailCredential as Credential); expect(verified).toBeTruthy(); - done(); + }); - it('should return true if all validation passes', async (done) => { + it('should return true if all validation passes', async () => { const myVerifyAnchor : VerifyFunction = (proof) => true; const myVerifySignature : VerifyFunction = (proof) => true; const verifier = new PresentationVerifier(myVerifyAnchor, myVerifySignature); const verified = await verifier.cryptographicallySecureVerify(emailCredential as Credential); expect(verified).toBeTruthy(); - done(); + }); - it('should return false if anchor validation fails', async (done) => { + it('should return false if anchor validation fails', async () => { const myVerifyAnchor : VerifyFunction = (proof) => false; const myVerifySignature : VerifyFunction = (proof) => true; const verifier = new PresentationVerifier(myVerifyAnchor, myVerifySignature); const verified = await verifier.cryptographicallySecureVerify(emailCredential as Credential); expect(verified).toBeFalsy(); - done(); + }); - it('should return false if signature validation fails', async (done) => { + it('should return false if signature validation fails', async () => { const myVerifyAnchor : VerifyFunction = (proof) => true; const myVerifySignature : VerifyFunction = (proof) => false; const verifier = new PresentationVerifier(myVerifyAnchor, myVerifySignature); const verified = await verifier.cryptographicallySecureVerify(emailCredential as Credential); expect(verified).toBeFalsy(); - done(); + }); }); diff --git a/src/__tests__/VerifiablePresentationManager.test.ts b/src/__tests__/VerifiablePresentationManager.test.ts index df97997..4c1afd9 100644 --- a/src/__tests__/VerifiablePresentationManager.test.ts +++ b/src/__tests__/VerifiablePresentationManager.test.ts @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import R from 'ramda'; import { Credential } from '../Credential'; import { VerifiablePresentationManager, @@ -39,7 +39,7 @@ describe('VerifiablePresentationManager', () => { expect(presentationManager).toBeDefined(); }); - it('should add credential artifacts to a verifiable presentation manager and return a status', async (done) => { + it('should add credential artifacts to a verifiable presentation manager and return a status', async () => { const presentationManager = new VerifiablePresentationManager({}); const status = await presentationManager.addCredentialArtifacts(artifactsWithEvidences); expect(status).toBeDefined(); @@ -47,10 +47,10 @@ describe('VerifiablePresentationManager', () => { expect(status.verifiedPresentations).toEqual(1); expect(status.totalEvidences).toEqual(1); expect(status.verifiedEvidences).toEqual(1); - done(); + }); - it('should add and verify a partial credential, with a subset of claims', async (done) => { + it('should add and verify a partial credential, with a subset of claims', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts = { presentations: [ @@ -63,11 +63,11 @@ describe('VerifiablePresentationManager', () => { expect(status.verifiedPresentations).toEqual(1); const claims = await presentationManager.listClaims(); - expect(claims).toHaveLength(1); - done(); + expect(claims).toHaveLength(14); + }); - it('should skip validation on add presentions if skipAddVerify is true', async (done) => { + it('should skip validation on add presentions if skipAddVerify is true', async () => { const options = { skipAddVerify: true } @@ -77,10 +77,10 @@ describe('VerifiablePresentationManager', () => { expect(status).toBeDefined(); expect(status.totalPresentations).toEqual(2); expect(status.verifiedPresentations).toEqual(0); - done(); + }); - it('should get the list of presentations', async (done) => { + it('should get the list of presentations', async () => { const presentationManager = new VerifiablePresentationManager({}); let presentations = await presentationManager.listPresentations(); @@ -94,10 +94,10 @@ describe('VerifiablePresentationManager', () => { expect(presentations[0].uid).toEqual(phoneNumberCredential.id); expect(presentations[1].identifier).toEqual('credential-cvc:Email-v1'); expect(presentations[1].uid).toEqual(emailCredential.id); - done(); + }); - it('should get the list of presentations including the unverified if allowGetUnverified is true', async (done) => { + it('should get the list of presentations including the unverified if allowGetUnverified is true', async () => { const options = { allowGetUnverified: true, notThrow: true @@ -111,10 +111,10 @@ describe('VerifiablePresentationManager', () => { const presentations = await presentationManager.listPresentations(); expect(presentations).toHaveLength(1); - done(); + }); - it('should get the list of presentations excluding the unverified if allowGetUnverified is false', async (done) => { + it('should get the list of presentations excluding the unverified if allowGetUnverified is false', async () => { const options = { allowGetUnverified: false, notThrow: true @@ -128,19 +128,19 @@ describe('VerifiablePresentationManager', () => { const presentations = await presentationManager.listPresentations(); expect(presentations).toHaveLength(0); - done(); + }); - it('should get the list of evidences', async (done) => { + it('should get the list of evidences', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifactsWithEvidences); const evidences = await presentationManager.listEvidences(); expect(evidences).toEqual([idDocumentEvidence]); - done(); + }); - it('should get only the list of evidences including unverified if allowGetUnverified is true', async (done) => { + it('should get only the list of evidences including unverified if allowGetUnverified is true', async () => { const options = { allowGetUnverified: true, notThrow: true @@ -159,10 +159,10 @@ describe('VerifiablePresentationManager', () => { const evidences = await presentationManager.listEvidences(); expect(evidences).toEqual([idDocumentEvidence]); - done(); + }); - it('should get a list of evidences filtering by invalid if allowGetUnverified is false (default)', async (done) => { + it('should get a list of evidences filtering by invalid if allowGetUnverified is false (default)', async () => { const options = { notThrow: true }; @@ -180,10 +180,10 @@ describe('VerifiablePresentationManager', () => { const evidences = await presentationManager.listEvidences(); expect(evidences).toHaveLength(0); - done(); + }); - it('should get the list of all claims', async (done) => { + it('should get the list of all claims', async () => { const presentationManager = new VerifiablePresentationManager({}); let claims = await presentationManager.listClaims(); @@ -198,10 +198,10 @@ describe('VerifiablePresentationManager', () => { expect(claims[0].credentialRef.identifier).toEqual('credential-cvc:PhoneNumber-v1'); expect(claims[0].identifier).toEqual('claim-cvc:Contact.phoneNumber-v1'); expect(claims[0].claimPath).toEqual('contact.phoneNumber'); - done(); + }); - it('should get the list of claims from verified presentations only if allowGetUnverified is false', async (done) => { + it('should get the list of claims from verified presentations only if allowGetUnverified is false', async () => { const options = { allowGetUnverified: false, notThrow: true @@ -218,25 +218,25 @@ describe('VerifiablePresentationManager', () => { const claims = await presentationManager.listClaims(); expect(claims).toHaveLength(phoneNumberCredential.proof.leaves.length); - done(); + }); - it('should get the list of the claims of a presentation', async (done) => { + it('should get the list of the claims of a presentation', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifacts); const presentations = await presentationManager.listPresentations(); - const emailPresentation = _.find(presentations, { identifier: emailCredential.identifier }); + const emailPresentation = R.find(R.propEq('identifier', emailCredential.identifier), presentations); const claims = await presentationManager.listPresentationClaims(emailPresentation as PresentationReference); expect(claims).toHaveLength( emailCredential.proof.leaves.length ); expect(claims[0].credentialRef.identifier).toEqual(emailCredential.identifier); - done(); + }); - it('should get an empty list if the presentation is not verified and allowGetUnverified is false', async (done) => { + it('should get an empty list if the presentation is not verified and allowGetUnverified is false', async () => { const options = { allowGetUnverified: false, notThrow: true @@ -256,10 +256,10 @@ describe('VerifiablePresentationManager', () => { }; const claims = await presentationManager.listPresentationClaims(emailPresentation as PresentationReference); expect(claims).toHaveLength(0); - done(); + }); - it('should get a claim value', async (done) => { + it('should get a claim value', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifacts); @@ -270,10 +270,10 @@ describe('VerifiablePresentationManager', () => { expect(JSON.stringify(phoneNumberCredential.claim)).toEqual( expect.stringContaining(JSON.stringify(claimValue)) ); - done(); + }); - it('should get unverified values if allowGetUnverified is true', async (done) => { + it('should get unverified values if allowGetUnverified is true', async () => { const options = { allowGetUnverified: true, notThrow: true @@ -291,10 +291,10 @@ describe('VerifiablePresentationManager', () => { const claimValue = await presentationManager.getClaimValue(claims[0]); expect(claimValue).toBeDefined(); - done(); + }); - it('should get null if requesting a value of a not found claim', async (done) => { + it('should get null if requesting a value of a not found claim', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifacts); @@ -310,40 +310,56 @@ describe('VerifiablePresentationManager', () => { const claimValue = await presentationManager.getClaimValue(notFoundClaim as AvailableClaim); expect(claimValue).toBeNull(); - done(); + }); - it('should return the the available claims that matches the search', async (done) => { - const presentationManager = new VerifiablePresentationManager({}); - await presentationManager.addCredentialArtifacts(artifacts); + describe('with a single field to match', () => { + it('should return the the available claims that matches the search', async () => { + const presentationManager = new VerifiablePresentationManager({}); + await presentationManager.addCredentialArtifacts(artifacts); - const searchByIdentifierOnly = { - identifier: 'cvc:Meta:issuanceDate' - }; - let claims = await presentationManager.findClaims(searchByIdentifierOnly as SearchClaimCriteria); - expect(claims).toHaveLength(2); + const searchByIdentifierOnly = { + identifier: 'cvc:Meta:issuanceDate' + }; + const claims = await presentationManager.findClaims(searchByIdentifierOnly as SearchClaimCriteria); + expect(claims).toHaveLength(2); + }); - const searchByIdentifierAndClaimPath = { - identifier: 'claim-cvc:Email.domain-v1', - claimPath: 'contact.email.domain' - }; - claims = await presentationManager.findClaims(searchByIdentifierAndClaimPath as SearchClaimCriteria); - expect(claims).toHaveLength(1); + }); + describe('with a 2 fields to match', () => { + it('should return the the available claims that matches the search', async () => { + const presentationManager = new VerifiablePresentationManager({}); + await presentationManager.addCredentialArtifacts(artifacts); - const searchByAll = { - identifier: 'claim-cvc:Email.domain-v1', - claimPath: 'contact.email.domain', - credentialRef: { - identifier: emailCredential.identifier, - uid: emailCredential.id - }, - }; - claims = await presentationManager.findClaims(searchByAll as SearchClaimCriteria); - expect(claims).toHaveLength(1); - done(); + const searchByIdentifierAndClaimPath = { + identifier: 'claim-cvc:Email.domain-v1', + claimPath: 'contact.email.domain' + }; + const claims = await presentationManager.findClaims(searchByIdentifierAndClaimPath as SearchClaimCriteria); + expect(claims).toHaveLength(1); + + }); + + }); + describe('with nested claims to match', () => { + it('should return the the available claims that matches the search', async () => { + const presentationManager = new VerifiablePresentationManager({}); + await presentationManager.addCredentialArtifacts(artifacts); + const searchByAll = { + identifier: 'claim-cvc:Email.domain-v1', + claimPath: 'contact.email.domain', + credentialRef: { + identifier: emailCredential.identifier, + uid: emailCredential.id + }, + }; + const claims = await presentationManager.findClaims(searchByAll as SearchClaimCriteria); + expect(claims).toHaveLength(1); + + }); }); - it('should return an empty array when there is no matches in claim search', async (done) => { + it('should return an empty array when there is no matches in claim search', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifacts); @@ -358,10 +374,10 @@ describe('VerifiablePresentationManager', () => { const claims = await presentationManager.findClaims(criteria as SearchClaimCriteria); expect(claims).toHaveLength(0); - done(); + }); - it('should only return the searched claims of invalid credential if allowGetUnverified is false', async (done) => { + it('should only return the searched claims of invalid credential if allowGetUnverified is false', async () => { const options = { allowGetUnverified: false, notThrow: true @@ -382,10 +398,10 @@ describe('VerifiablePresentationManager', () => { const claims = await presentationManager.findClaims(criteria as SearchClaimCriteria); expect(claims).toHaveLength(1); // only the claim from phone number - done(); + }); - it('should resolve the key to claim search map by returning a map from key to claim value', async (done) => { + it('should resolve the key to claim search map by returning a map from key to claim value', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts = { presentations: [ @@ -413,14 +429,14 @@ describe('VerifiablePresentationManager', () => { const mappedClaimValues = await presentationManager.mapClaimValues(mapping); expect(mappedClaimValues).toEqual({ - contact: '31988889999', + contact: '69276577', docNumber: '9999999999', name: 'Civic' }); - done(); + }); - it('should return a flat object with claim values if mapClaimValues is called with flatten true', async (done) => { + it('should return a flat object with claim values if mapClaimValues is called with flatten true', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts = { presentations: [ @@ -450,7 +466,7 @@ describe('VerifiablePresentationManager', () => { expect(mappedClaimValues).toEqual([ { name: 'contact', - value: '31988889999' + value: '69276577' }, { name: 'docNumber', @@ -461,10 +477,10 @@ describe('VerifiablePresentationManager', () => { value: 'Civic' } ]); - done(); + }); - it('should resolve the key to null if the criteria in the claim map is not matched', async (done) => { + it('should resolve the key to null if the criteria in the claim map is not matched', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifacts); @@ -478,10 +494,10 @@ describe('VerifiablePresentationManager', () => { expect(mappedClaimValues).toEqual({ docNumber: null, }); - done(); + }); - it('should resolve the key to the first value if the criteria in the claim map matches multiple claims', async (done) => { + it('should resolve the key to the first value if the criteria in the claim map matches multiple claims', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts = { @@ -500,12 +516,12 @@ describe('VerifiablePresentationManager', () => { const mappedClaimValues = await presentationManager.mapClaimValues(mapping); expect(mappedClaimValues).toEqual({ - contact: '31988889999' + contact: '69276577' }); - done(); + }); - it('should verify all artifacts and return the total of verified items', async (done) => { + it('should verify all artifacts and return the total of verified items', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifactsWithEvidences); const status = await presentationManager.verifyAllArtifacts(); @@ -513,29 +529,29 @@ describe('VerifiablePresentationManager', () => { expect(status.verifiedPresentations).toBe(1); expect(status.totalEvidences).toBe(1); expect(status.verifiedEvidences).toBe(1); - done(); + }); - it('should throw exception when adding an invalid credential if notThrow is false (default)', async (done) => { + it('should throw exception when adding an invalid credential if notThrow is false (default)', async () => { const artifacts : CredentialArtifacts = { presentations: [invalidEmailCredential as Credential], }; const presentationManager = new VerifiablePresentationManager({}); expect(presentationManager.addCredentialArtifacts(artifacts)).rejects.toThrow(); - done(); + }); - it('should throw exception when adding an unverified evidence if notThrow is false (default)', async (done) => { + it('should throw exception when adding an unverified evidence if notThrow is false (default)', async () => { const artifacts : CredentialArtifacts = { presentations: [], evidences: [ idDocumentEvidence as Evidence ] }; const presentationManager = new VerifiablePresentationManager({}); expect(presentationManager.addCredentialArtifacts(artifacts)).rejects.toThrow(); - done(); + }); - it('should not verify an invalid credential and return a status when notThrow is true', async (done) => { + it('should not verify an invalid credential and return a status when notThrow is true', async () => { const options = { notThrow: true } @@ -548,10 +564,10 @@ describe('VerifiablePresentationManager', () => { expect(status.totalPresentations).toBe(1); expect(status.verifiedPresentations).toBe(0); - done(); + }); - it('should consider an evidence invalid when there is not a valid credential referencing it', async (done) => { + it('should consider an evidence invalid when there is not a valid credential referencing it', async () => { const options = { notThrow: true } @@ -565,17 +581,17 @@ describe('VerifiablePresentationManager', () => { const status = await presentationManager.verifyAllArtifacts(); expect(status.totalEvidences).toBe(1); expect(status.verifiedEvidences).toBe(0); - done(); + }); - it('should consider an evidence invalid if the base64Encoded hash does not match the sha256 value', async (done) => { + it('should consider an evidence invalid if the base64Encoded hash does not match the sha256 value', async () => { const options = { notThrow: true } const presentationManager = new VerifiablePresentationManager(options); - const invalidEvidence = _.cloneDeep(idDocumentEvidence); - invalidEvidence.base64Encoded = _.replace(invalidEvidence.base64Encoded, /=$/, 'extra-str='); + const invalidEvidence = R.clone(idDocumentEvidence); + invalidEvidence.base64Encoded = R.replace(/=$/, 'extra-str=', invalidEvidence.base64Encoded); const artifacts : CredentialArtifacts = { presentations: [ idDocumentCredential as Credential ], @@ -586,19 +602,19 @@ describe('VerifiablePresentationManager', () => { const status = await presentationManager.verifyAllArtifacts(); expect(status.totalEvidences).toBe(1); expect(status.verifiedEvidences).toBe(0); - done(); + }); - it('should return true if all artifacts is verified', async (done) => { + it('should return true if all artifacts is verified', async () => { const presentationManager = new VerifiablePresentationManager({}); await presentationManager.addCredentialArtifacts(artifactsWithEvidences); const isAllVerified = await presentationManager.isAllArtifactsVerified(); expect(isAllVerified).toBeTruthy(); - done(); + }); - it('should return false if not all artifacts is verified', async (done) => { + it('should return false if not all artifacts is verified', async () => { const options = { notThrow: true } @@ -611,10 +627,10 @@ describe('VerifiablePresentationManager', () => { const isAllVerified = await presentationManager.isAllArtifactsVerified(); expect(isAllVerified).toBeFalsy(); - done(); + }); - it('should purge the invalid artifacts', async (done) => { + it('should purge the invalid artifacts', async () => { const options = { notThrow: true } @@ -643,10 +659,10 @@ describe('VerifiablePresentationManager', () => { const claims = await presentationManager.listClaims(); expect(claims).toHaveLength(phoneNumberCredential.proof.leaves.length); - done(); + }); - it('should verifiy if a presentation was granted for a specific dsr', async (done) => { + it('should verifiy if a presentation was granted for a specific dsr', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts : CredentialArtifacts = { presentations: [idDocumentCredential as Credential] @@ -656,10 +672,10 @@ describe('VerifiablePresentationManager', () => { const wasGranted = presentationManager.wasGrantedForDSR(presentations[0], JSON.stringify(idDocumentDSR)); expect(wasGranted).toBeTruthy(); - done(); + }); - it('should fail grant verification if a credential is tested with a dsr not used to request it', async (done) => { + it('should fail grant verification if a credential is tested with a dsr not used to request it', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts : CredentialArtifacts = { presentations: [phoneNumberCredential as Credential] @@ -671,10 +687,10 @@ describe('VerifiablePresentationManager', () => { const wasGranted = presentationManager.wasGrantedForDSR(phoneCredential, JSON.stringify(idDocumentDSR)); expect(wasGranted).toBeFalsy(); - done(); + }); - it('should fail grant verification if a credential is tested with an invalid dsr string', async (done) => { + it('should fail grant verification if a credential is tested with an invalid dsr string', async () => { const presentationManager = new VerifiablePresentationManager({}); const artifacts : CredentialArtifacts = { presentations: [phoneNumberCredential as Credential] @@ -685,6 +701,6 @@ describe('VerifiablePresentationManager', () => { const invalidDsr = '{}'; const wasGranted = presentationManager.wasGrantedForDSR(presentations[0], invalidDsr); expect(wasGranted).toBeFalsy(); - done(); + }); }); diff --git a/src/__tests__/fixtures/emailCredential.json b/src/__tests__/fixtures/emailCredential.json index 981cea3..3bc4047 100644 --- a/src/__tests__/fixtures/emailCredential.json +++ b/src/__tests__/fixtures/emailCredential.json @@ -1,8 +1,7 @@ { - "_id": "5d55cc213f132d004ecc54d6", - "id": "81eed612-0bce-4eb5-a88f-d96c34cc5431", - "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", - "issuanceDate": "2019-08-15T21:18:25.058Z", + "id": "ad26d197-133b-4aa7-a14b-e6364892c17c", + "issuer": "", + "issuanceDate": "2020-03-31T07:43:22.786Z", "identifier": "credential-cvc:Email-v1", "expirationDate": null, "version": "1", @@ -10,6 +9,7 @@ "Credential", "credential-cvc:Email-v1" ], + "transient": false, "claim": { "contact": { "email": { @@ -17,161 +17,131 @@ "name": "civic", "tld": "com" }, - "username": "lucas" + "username": "test" } } }, "proof": { "type": "CvcMerkleProof2018", - "merkleRoot": "bf5c9c0ca7ecc6ff9b95f7ee9d0fc641ca735ceccb8c7a949fcaae23734db2a8", - "anchor": { - "_id": "5d55cc2b047f07004e95cf40", - "subject": { - "pub": "xpub6ZfrHWxuNKiAvctVdyyhq92xRq9oXV546EpSRJUArH2jqZpWHFbEPfWQ9yNTwcrgPZzZv2ayYBkeNLmB2mh4PNytZnQfVvnVZyJ7qWb4kUr", - "label": "credential-cvc:Email-v1", - "data": "bf5c9c0ca7ecc6ff9b95f7ee9d0fc641ca735ceccb8c7a949fcaae23734db2a8", - "signature": "3045022100949e5e2eb45a9908e427235da46994171291bf8c4fe218a39c44724a387cda740220521a0060c1855aacbc5b85d16361f2559f2976a7506809d4c7ee29cd4000cd31" - }, - "cosigners": [ - { - "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" - }, - { - "pub": "xpub661MyMwAqRbcFHnyf1o6Q6dTNTuqfL5qLZqAFnnaDjbhqPvHJyJ1XaCGbuokdRC6SAv1NB1GU3FnBP9yw7F5cxJiqerZXGkRWvJdRrqGYZ8" - } - ], - "authority": { - "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", - "path": "/1/0/0/0" - }, - "tx": "01000000011539906515adfb3e4b3127527268b74a701fa268b001f43cf91680edcb5fc65b00000000fc00473044022064eae65f425779bd2c9fc1deaaf97ba3b040788f3dce7d061409d5837ce5332202202669fc56ebb2e0d9814ae0178751c37576bc410f15afee592de62ee3a3016fb8014730440220519684f041c96859184d9364c7e63a991b4a62fcf75f902f980be4aaf3997ab502206ee68c7a8c32675dc4c3f950d50c2a7dbdcebabcbaf5ee9ecec6c0a1fa88d679014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d821028ff94b0224911a4d1efa9f236e315fd394fd19393c8b62d5807da4c30f90f929210222fd97636daac00985045072cdd13b8feb5b08384d2fb9df3c8f882a1e4a692a53aeffffffff01551500000000000017a914cee83ff767d0417767d6d035e0ece8b0859f9df98700000000", - "type": "temporary", - "network": "bitcoincashTestnet", - "schema": "tbch-20180201", - "requestId": "5d55cc2a047f07004e95cf3f", - "deletedAt": -1 - }, + "merkleRoot": "e18c461ed5bf219bc6e0f2c1135e30e2e83421def4dfb81314e4ca2b390cad31", + "anchor": "TBD (Civic Blockchain Attestation)", "leaves": [ { "identifier": "claim-cvc:Contact.email-v1", - "value": "urn:email.domain.name:ccbadf46768f874a143cee3cd84e5256221ffc6118a34eb75fcbef1e9b4be7ef:civic|urn:email.domain.tld:df3c5d1d8298b341e48f17b12dc74cad129c2b337b9653516ed9b04e36d3d01b:com|urn:email.username:820487c5d3a32806aa71887c0f6fe479ffff9e0eae30f20144c4b64935116a34:lucas|", + "value": "urn:email.domain.name:ed35e3fb163b58ec3191ac5c580f6e2c3b6c57169042cd39da26fa2d0998766e:civic|urn:email.domain.tld:42d58fc5403c8df17e5b69ec4e54661e0075646a346ae471f0c60f73109241db:com|urn:email.username:331832c50f8d6c6e8a74979b0bf2996ef094cac2839cb6e5884e02a221130a15:test|", "claimPath": "contact.email", - "targetHash": "68b90b962c5aabfdf97b9f0149441e196f0b849fa908af88dd6c1abb74e4a517", + "targetHash": "72f3e619c2f0992127c9a6574456695fbbd9552cd1a7ec05d959b49bba0a9b97", "node": [ { - "right": "16c0dd39f9a3da5a791010d3bb7a6e893de936586465c53d1b2d157f3ea15e7b" + "right": "674a2ac91d265ebb5bc174eb0dc5e7135a48fefa60d89209d537caf9cc1d609e" }, { - "right": "49b250f44b2bf2d204490ea686e34570f25d9612291981e6fde84f139a1e692e" + "right": "832fd981e10f9b1c48bf8d202278eaa6b5731f990abb591da6460d028962c6ea" }, { - "right": "dacdb82bac682cd4e7a15462cd0e3f2fc003e5bb88b00ce7610e5f4fa4dbbcb4" + "right": "5a536c50c4457bbc446e20c616689e19ba9a7e0c94b89c46f0dcfd50a91c5f56" }, { - "right": "062cdef9d0440ae5fc8537175922017b56fff0acf23209a2270222470c1c5420" + "right": "599a6e38e44fa5cc1aaec4b636d04d141cc197d5db19acb403277bd1242a7e9e" }, { - "right": "c12996ffd5e6f394f401dece6bb90d9576b22e6dedca11d734a80b7eb35698bd" + "right": "137ca32098157ea04f4ce6ddcd55e3b3a37b09bc139795fa322d063b56bd9f46" } ] }, { "identifier": "claim-cvc:Email.domain-v1", - "value": "urn:domain.name:ccbadf46768f874a143cee3cd84e5256221ffc6118a34eb75fcbef1e9b4be7ef:civic|urn:domain.tld:df3c5d1d8298b341e48f17b12dc74cad129c2b337b9653516ed9b04e36d3d01b:com|", + "value": "urn:domain.name:ed35e3fb163b58ec3191ac5c580f6e2c3b6c57169042cd39da26fa2d0998766e:civic|urn:domain.tld:42d58fc5403c8df17e5b69ec4e54661e0075646a346ae471f0c60f73109241db:com|", "claimPath": "contact.email.domain", - "targetHash": "16c0dd39f9a3da5a791010d3bb7a6e893de936586465c53d1b2d157f3ea15e7b", + "targetHash": "674a2ac91d265ebb5bc174eb0dc5e7135a48fefa60d89209d537caf9cc1d609e", "node": [ { - "left": "68b90b962c5aabfdf97b9f0149441e196f0b849fa908af88dd6c1abb74e4a517" + "left": "72f3e619c2f0992127c9a6574456695fbbd9552cd1a7ec05d959b49bba0a9b97" }, { - "right": "49b250f44b2bf2d204490ea686e34570f25d9612291981e6fde84f139a1e692e" + "right": "832fd981e10f9b1c48bf8d202278eaa6b5731f990abb591da6460d028962c6ea" }, { - "right": "dacdb82bac682cd4e7a15462cd0e3f2fc003e5bb88b00ce7610e5f4fa4dbbcb4" + "right": "5a536c50c4457bbc446e20c616689e19ba9a7e0c94b89c46f0dcfd50a91c5f56" }, { - "right": "062cdef9d0440ae5fc8537175922017b56fff0acf23209a2270222470c1c5420" + "right": "599a6e38e44fa5cc1aaec4b636d04d141cc197d5db19acb403277bd1242a7e9e" }, { - "right": "c12996ffd5e6f394f401dece6bb90d9576b22e6dedca11d734a80b7eb35698bd" + "right": "137ca32098157ea04f4ce6ddcd55e3b3a37b09bc139795fa322d063b56bd9f46" } ] }, { "identifier": "cvc:Meta:issuer", - "value": "urn:issuer:4a7fae9e883f1902ab24c0acb2a35ae0c02cf129aa2d53b3c4eba1c2d522ee3c:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "value": "urn:issuer:cc2cd039b5ca568233372e5dc39611918ae54c404ac58b6b050f225596a28e57:|", "claimPath": "meta.issuer", - "targetHash": "84676aff46e82e2ffd7b4863f1ea715dee3fc67783375bcc4cbfe0f1da02dcf2", + "targetHash": "a9218250bdc1473769787e9cadc72f8472d18a839136615e9b2b6fc515ab317e", "node": [ { - "right": "5188fbf5359a890af182b29df1aeb53aad598cd592f6e082a622f44a734bc4da" + "right": "80a9f7a0216195880748d9fedbf3bc5ac50cea242abd985daaed4c13f4d25eb0" }, { - "left": "ddf3d00dfd62881820130196cd0ccdfb1306f7b44c1c9b60ee262aff98bc4309" + "left": "42991f3e8c21d8c7f47c0dd4f85cdb61f08cf3c0b546d18f08fb56d805eba1df" }, { - "right": "dacdb82bac682cd4e7a15462cd0e3f2fc003e5bb88b00ce7610e5f4fa4dbbcb4" + "right": "5a536c50c4457bbc446e20c616689e19ba9a7e0c94b89c46f0dcfd50a91c5f56" }, { - "right": "062cdef9d0440ae5fc8537175922017b56fff0acf23209a2270222470c1c5420" + "right": "599a6e38e44fa5cc1aaec4b636d04d141cc197d5db19acb403277bd1242a7e9e" }, { - "right": "c12996ffd5e6f394f401dece6bb90d9576b22e6dedca11d734a80b7eb35698bd" + "right": "137ca32098157ea04f4ce6ddcd55e3b3a37b09bc139795fa322d063b56bd9f46" } ] }, { "identifier": "cvc:Meta:issuanceDate", - "value": "urn:issuanceDate:50d0c175a845941df3e9120728080bd6ae8f1a6a1be59d28b09cd81467de8aa7:2019-08-15T21:18:25.058Z|", + "value": "urn:issuanceDate:8f91857d56d92a6d6128182c49dcd944d1471af94f0821da0d5ecccb96b4dbfe:2020-03-31T07:43:22.786Z|", "claimPath": "meta.issuanceDate", - "targetHash": "5188fbf5359a890af182b29df1aeb53aad598cd592f6e082a622f44a734bc4da", + "targetHash": "80a9f7a0216195880748d9fedbf3bc5ac50cea242abd985daaed4c13f4d25eb0", "node": [ { - "left": "84676aff46e82e2ffd7b4863f1ea715dee3fc67783375bcc4cbfe0f1da02dcf2" + "left": "a9218250bdc1473769787e9cadc72f8472d18a839136615e9b2b6fc515ab317e" }, { - "left": "ddf3d00dfd62881820130196cd0ccdfb1306f7b44c1c9b60ee262aff98bc4309" + "left": "42991f3e8c21d8c7f47c0dd4f85cdb61f08cf3c0b546d18f08fb56d805eba1df" }, { - "right": "dacdb82bac682cd4e7a15462cd0e3f2fc003e5bb88b00ce7610e5f4fa4dbbcb4" + "right": "5a536c50c4457bbc446e20c616689e19ba9a7e0c94b89c46f0dcfd50a91c5f56" }, { - "right": "062cdef9d0440ae5fc8537175922017b56fff0acf23209a2270222470c1c5420" + "right": "599a6e38e44fa5cc1aaec4b636d04d141cc197d5db19acb403277bd1242a7e9e" }, { - "right": "c12996ffd5e6f394f401dece6bb90d9576b22e6dedca11d734a80b7eb35698bd" + "right": "137ca32098157ea04f4ce6ddcd55e3b3a37b09bc139795fa322d063b56bd9f46" } ] }, { "identifier": "cvc:Meta:expirationDate", - "value": "urn:expirationDate:21f6f6515962c5c4a8826640a6cbbcc3957f6f23a53b601395fc420e240b4f78:null|", + "value": "urn:expirationDate:2df40e865c8b4b76b6dcabc583b370c6bc256f3f16ef36fb6b08bb7b97e4c01e:null|", "claimPath": "meta.expirationDate", - "targetHash": "4a6b43d606855c5c9cce702199ad89adc6792fde439522c3fb83c0acea7b7622", + "targetHash": "6223e3ad747964c8d499bf00166a76da33afe8dc174efbfab702753a65a07ecc", "node": [ { - "right": "43d54e401c3325b8945be4d897ceffcb36075669a5c6c7ed7e22d6b283562a8d" + "right": "ded16e4e1de0ee519ba9d2091df4582d7a4d42d5a5f1a45bae197bd0a57bdb9c" }, { - "right": "15aa5aa36659b55c297ed031a1d76df17bc3e6af3e49df4f6cfb36787c0569ac" + "right": "f6c73aed530bbc25b90d675b985a5d06b760b830a2e0f76e82bf6a536ab4bb11" }, { - "left": "bf5ac61c45ede224c6fa20b9bd0803fe3d77f5284f4a76bbe7fdff75a9123c4d" + "left": "6ac4b22c1a05f6ff2201e21e4131f33a5340a22af6cdb5af5d0d98a3bc605e24" }, { - "right": "062cdef9d0440ae5fc8537175922017b56fff0acf23209a2270222470c1c5420" + "right": "599a6e38e44fa5cc1aaec4b636d04d141cc197d5db19acb403277bd1242a7e9e" }, { - "right": "c12996ffd5e6f394f401dece6bb90d9576b22e6dedca11d734a80b7eb35698bd" + "right": "137ca32098157ea04f4ce6ddcd55e3b3a37b09bc139795fa322d063b56bd9f46" } ] } ] }, - "granted": null, - "user_id": "03bf176a6a4e4841ec348a8007e655e2e746806576048fc1fe4ff2e8bc6351ecc2", - "createdAt": "2019-08-15T21:18:01.774Z", - "updatedAt": "2019-08-15T21:18:34.148Z", - "deletedAt": -1 -} + "granted": null +} \ No newline at end of file diff --git a/src/__tests__/fixtures/idDocumentPartialCredential.json b/src/__tests__/fixtures/idDocumentPartialCredential.json index 5ed3d02..658967f 100644 --- a/src/__tests__/fixtures/idDocumentPartialCredential.json +++ b/src/__tests__/fixtures/idDocumentPartialCredential.json @@ -1,77 +1,400 @@ { - "id":"705a1e55-65b9-472c-8bfb-9d5f3eb5e5d3", - "issuer":"did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", - "issuanceDate":"2019-08-09T15:32:52.115Z", - "identifier":"credential-cvc:IdDocument-v1", - "expirationDate":null, - "version":"1", - "type":[ + "_id": "5d92d2df4b0fcc004f2534ba", + "id": "ea421021-8d45-456c-9244-f54b978cf67f", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-10-01T04:15:27.532Z", + "identifier": "credential-cvc:IdDocument-v2", + "expirationDate": null, + "version": "1", + "type": [ "Credential", - "credential-cvc:IdDocument-v1" + "credential-cvc:IdDocument-v2" ], - "claim":{ - "document":{ - "name":{ - "familyNames":"CUNHA DE OLIVEIRA MIRANDA", - "givenNames":"LUCAS" + "claim": { + "document": { + "evidences": { + "idDocumentFront": { + "algorithm": "sha256", + "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + }, + "selfie": { + "algorithm": "sha256", + "data": "0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f" + } + }, + "name": { + "familyNames": "User", + "givenNames": "Civic" + }, + "dateOfBirth": { + "day": 1, + "month": 1, + "year": 1900 + }, + "type": "passport", + "number": "9999999999", + "issueCountry": "GBR", + "dateOfExpiry": { + "day": 1, + "month": 1, + "year": 1900 } } }, - "proof":{ - "type":"CvcMerkleProof2018", - "merkleRoot":"682f70f4f979ecabddbf8f65a044f48e43e94f9c9fcc028886982d925f5834b1", - "anchor":{ - "_id":"5d4d922cb044bb004fb86c15", - "subject":{ - "pub":"xpub6a71VMfnd6kFED8oeVeaviSAaq62dfMcAmpnQfZ1VFhB1vjmStcxTsmUzmmbwtCgZgmaTSzUiP2iP9Hamvc4ay6b1Fx2TGAZe16fZkykUWW", - "label":"credential-cvc:IdDocument-v1", - "data":"682f70f4f979ecabddbf8f65a044f48e43e94f9c9fcc028886982d925f5834b1", - "signature":"304402205dfd0e2f5df5e9aa6e4fd78ecacbb5ce0740fa51690436b3c49e09a383d2675402200860294eb84c1f91f04a35a0e092ee9e505700ad7d50b4b6acc57ba77ead5edb" - }, - "cosigners":[ + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "a2d4b472e68f814175159e79ed44b15e7156af68c9fb00f1359f4e9c8f0f6c0f", + "anchor": { + "_id": "5d92d2e808c60a004f1a2643", + "subject": { + "pub": "xpub6YxgjXgADzwxHBfjviSAvByQS7m2gWnnYYGhN6pTvhTJgX8vKA1srXqFMczTnkRq3SN7yd28t4cwDruGiVBGR4cYMEtNEUWAiBZ6tSCxqkv", + "label": "credential-cvc:IdDocument-v2", + "data": "a2d4b472e68f814175159e79ed44b15e7156af68c9fb00f1359f4e9c8f0f6c0f", + "signature": "304402200da8524ec9d55eb85edc619e0f0b96b3cff67b18e45f5080da03cf8e61a733aa0220439fc29e3689a1e7847dcde77c7c98a88cdef3837aed10a49a30e0f7d532745f" + }, + "cosigners": [ { - "pub":"xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" }, { - "pub":"xpub661MyMwAqRbcEiue1yHxghPfwQfP3rYTyLFmRrTK7cRJkjKxim8EFv1KUi2WQ7BGoBmvMY1AFx7G15QbtyBD8gsuepqnDszEEzGM7rQsMoi" + "pub": "xpub661MyMwAqRbcF8gyCQYAe6ucNQUd5GaadSKre6JycrTngqamTUyfzRfFZJZ6wNus48a4KiF1cYXeG9ANTrBqmScNMboQDEgdbh1r8w5Tibf" } ], - "authority":{ - "pub":"xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", - "path":"/1/0/0/0" - }, - "tx":"01000000018047366515e4a4e557b8584ed4e6d37765d1468d4a938e03d310725760fdff6900000000fdfd0000473044022075168273532b978a56d2350560d9c2e0e5f069ba7c872f773877775770aa63b5022017c62edd8aee4d3bc8d613ffe835657cb1fe4a693f82bd3a7a808f531e60399501483045022100990f03bf2d97ad39e4b0db43e1251832c2b1f8e369861a5e7359f585d43d3b0a02204ab0fc7f4ed409d00484cfd56f2ce3289f7e5c7d71e222b2b6ce9eee6fd5e374014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d821032c083e152cbb5dd77b9c6b5931c2115f076d4e2695e060058f6249d7d1fdaffe21035a8cf8a83ba4d717da1fb3faf11a6a07729046e104c26924c96043d04e135fd553aeffffffff01551500000000000017a914d1be6517ed18020bbfd37b4fa76f1ab4051530a28700000000", - "type":"temporary", - "network":"bitcoincashTestnet", - "schema":"tbch-20180201", - "requestId":"5d4d922ab044bb004fb86c14", - "deletedAt":-1 + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "01000000013633906915c4da8522ffca4feaaa18e1e15e03b20b05f479a2da1cf9f4ba83ee00000000fdfd0000483045022100d471e2646e6e98e9f04003b14a8dea93acf1612da24f337cca8dc11378c1ff0e022069cede5976230476b59cb7bd792b8311b8d7df494f378b283ddd3a4c1e83a5fe0147304402205ba8b0e5d0ebe4f9204373b01609c1dee24cf77a992113d7babdc1603abe64d90220469912ffadb31612c30e02ad2db664d9ab4d1ff724979067538c33a097fe99c9014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82102ec498c3fac8a75ae6789b2438897d5088da709f22a553eab886417aea5f4806a2103ced54e5eef99c04f7cc8cb66b02d4906c5a0db9e7950b32a7eb7d7de24eb121853aeffffffff01551500000000000017a9145fc5c4450268b1c8ee92be450a1e8e3ed70ce7f68700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d92d2e608c60a004f1a2642", + "deletedAt": -1 }, - "leaves":[ + "leaves": [ + { + "identifier": "claim-cvc:Document.evidences-v1", + "value": "urn:evidences.idDocumentFront.algorithm:18ea54e705b68a457d141cbd21eb0333296f994fb4367940949053380f2700f0:sha256|urn:evidences.idDocumentFront.data:fdceaa4a09f75e85bd693d170b75a015c8edb37bb22d984f5430adcf49207431:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|urn:evidences.selfie.algorithm:3ac61825e224560b55998bde17476c74e3137d9a97687a4d8a31a7518644469d:sha256|urn:evidences.selfie.data:a8cc732da8215f0520079d72600e8e58cd27c1aaf6e4942bdf3adf4a8811a7fc:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "document.evidences", + "targetHash": "5e4ac489bfb79cf392a586194a5ae24d19ed1cc4d8d8e62ffe22c516e8b0deda", + "node": [ + { + "right": "1b29d015bf31a385a2478c957619663fc659011fef16819f9c06aa13838b4e8a" + }, + { + "right": "b8806718c5c78e69019ef4a9de5e65dd11996c328e69697b7ca176e7aefb073c" + }, + { + "right": "18820e857afdb14362351da2c182aec2ed0e0ef4792595a0468b6ed95a69ae8b" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.idDocumentFront-v1", + "value": "urn:idDocumentFront.algorithm:18ea54e705b68a457d141cbd21eb0333296f994fb4367940949053380f2700f0:sha256|urn:idDocumentFront.data:fdceaa4a09f75e85bd693d170b75a015c8edb37bb22d984f5430adcf49207431:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|", + "claimPath": "validationEvidences.idDocumentFront", + "targetHash": "1b29d015bf31a385a2478c957619663fc659011fef16819f9c06aa13838b4e8a", + "node": [ + { + "left": "5e4ac489bfb79cf392a586194a5ae24d19ed1cc4d8d8e62ffe22c516e8b0deda" + }, + { + "right": "b8806718c5c78e69019ef4a9de5e65dd11996c328e69697b7ca176e7aefb073c" + }, + { + "right": "18820e857afdb14362351da2c182aec2ed0e0ef4792595a0468b6ed95a69ae8b" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.selfie-v1", + "value": "urn:selfie.algorithm:3ac61825e224560b55998bde17476c74e3137d9a97687a4d8a31a7518644469d:sha256|urn:selfie.data:a8cc732da8215f0520079d72600e8e58cd27c1aaf6e4942bdf3adf4a8811a7fc:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "validationEvidences.selfie", + "targetHash": "8e6c67e997ac54f4ffa36ed26c8a03c4fc13103f68859d9cbf0ce69c20bca184", + "node": [ + { + "right": "98e697014546f39e6d1a7af63e86fce259da38faac871c30bce623d0a81ec826" + }, + { + "left": "15c5c88abb0d41c299942efd5c1040923aedf3607b1660f53eefbaa5ea7d4259" + }, + { + "right": "18820e857afdb14362351da2c182aec2ed0e0ef4792595a0468b6ed95a69ae8b" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Document.name-v1", + "value": "urn:name.familyNames:2bb72a605556eedbc39f64bcfd2e5c64fd8b3e7200621160546f90d1b726908e:User|urn:name.givenNames:c4217046153f727557a3c6d24b9a110d90ef72aa4b3ad6daa9cff759866f9cce:Civic|", + "claimPath": "document.name", + "targetHash": "98e697014546f39e6d1a7af63e86fce259da38faac871c30bce623d0a81ec826", + "node": [ + { + "left": "8e6c67e997ac54f4ffa36ed26c8a03c4fc13103f68859d9cbf0ce69c20bca184" + }, + { + "left": "15c5c88abb0d41c299942efd5c1040923aedf3607b1660f53eefbaa5ea7d4259" + }, + { + "right": "18820e857afdb14362351da2c182aec2ed0e0ef4792595a0468b6ed95a69ae8b" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Name.familyNames-v1", + "value": "urn:familyNames:2bb72a605556eedbc39f64bcfd2e5c64fd8b3e7200621160546f90d1b726908e:User|", + "claimPath": "document.name.familyNames", + "targetHash": "2419cb36562ae58e0f5b281c3a8a74824e663e1300a0da3c5c48eaa8cbbb0583", + "node": [ + { + "right": "93e1ace3bcd1c8ce403bc376990eff2651cbe6054a10e8ec3cd14f45246859bb" + }, + { + "right": "8b341d9eeb65173852dd4b98578960a9a662c06ddb7d633a94e30fc05fce466b" + }, + { + "left": "7aa752e60ead717cc17428a6921f77680f4f3c3a83b85c280aa2538bc3cabb81" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Name.givenNames-v1", + "value": "urn:givenNames:c4217046153f727557a3c6d24b9a110d90ef72aa4b3ad6daa9cff759866f9cce:Civic|", + "claimPath": "document.name.givenNames", + "targetHash": "93e1ace3bcd1c8ce403bc376990eff2651cbe6054a10e8ec3cd14f45246859bb", + "node": [ + { + "left": "2419cb36562ae58e0f5b281c3a8a74824e663e1300a0da3c5c48eaa8cbbb0583" + }, + { + "right": "8b341d9eeb65173852dd4b98578960a9a662c06ddb7d633a94e30fc05fce466b" + }, + { + "left": "7aa752e60ead717cc17428a6921f77680f4f3c3a83b85c280aa2538bc3cabb81" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfBirth-v1", + "value": "urn:dateOfBirth.day:4e95f08375fad83a65b876480b3a02c35147f9cd61894667fbb6f27d42c9fa19:1|urn:dateOfBirth.month:6ac87e1982fc0b31c3652aa6a13574d43b438ecc94087247870a91c899286dee:1|urn:dateOfBirth.year:85a7a11f60d9c31bd72e98e2c0c9e64ecda7caaec5c6db2a91ecd04371365588:1900|", + "claimPath": "document.dateOfBirth", + "targetHash": "0551ae0d48478d6d8ea9cd4cdb9b6896409772fbf4800d3a6d767d92475d9ff9", + "node": [ + { + "right": "616355fd1f97849dbc28f571bfb90f2a3076e333c3674387473de005817e3741" + }, + { + "left": "a5503bce4c610cef20a4846f15384bc97bf45d85847994edd18154ac08590f05" + }, + { + "left": "7aa752e60ead717cc17428a6921f77680f4f3c3a83b85c280aa2538bc3cabb81" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Document.type-v1", + "value": "urn:type:cadb451158f4ffc514a1c52d28768887382ae8ee3e5de6c15d7c1aa630e1483b:passport|", + "claimPath": "document.type", + "targetHash": "616355fd1f97849dbc28f571bfb90f2a3076e333c3674387473de005817e3741", + "node": [ + { + "left": "0551ae0d48478d6d8ea9cd4cdb9b6896409772fbf4800d3a6d767d92475d9ff9" + }, + { + "left": "a5503bce4c610cef20a4846f15384bc97bf45d85847994edd18154ac08590f05" + }, + { + "left": "7aa752e60ead717cc17428a6921f77680f4f3c3a83b85c280aa2538bc3cabb81" + }, + { + "right": "88b940bdc059a6d7d2b2cdbf64a4af8efaf169e9a8adc8f67570d7fd1c709e4e" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Document.number-v1", + "value": "urn:number:412273e0a03ff4cf2e42feb9294198ec183fc885881f48205590078b83d8c525:9999999999|", + "claimPath": "document.number", + "targetHash": "0e78e27c2d176320b832159746fa572ae9fdaf6a6b7e42d937b7fb9b0b85da71", + "node": [ + { + "right": "e6609ae11147727e8455060933c4c12d0742fb25c13f2ab3a63a0d137d093078" + }, + { + "right": "cfad0edaae9aad2deda76c32f75f47d96bd44b1b5f72872f7a4329449d247215" + }, + { + "right": "1fa7a1150163858e12b724ac49b2e955bda7dc8eee93c1b513d7a8c1a5f2109f" + }, + { + "left": "8b931f46462dd687a691d98571e234024ce232b3ea12e7c491d2aff532751a6d" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Document.issueCountry-v1", + "value": "urn:issueCountry:1ed3f423d7a0e5de69f390934827fbee7e5654c070719e6a5ebbc0734a3d13cc:GBR|", + "claimPath": "document.issueCountry", + "targetHash": "e6609ae11147727e8455060933c4c12d0742fb25c13f2ab3a63a0d137d093078", + "node": [ + { + "left": "0e78e27c2d176320b832159746fa572ae9fdaf6a6b7e42d937b7fb9b0b85da71" + }, + { + "right": "cfad0edaae9aad2deda76c32f75f47d96bd44b1b5f72872f7a4329449d247215" + }, + { + "right": "1fa7a1150163858e12b724ac49b2e955bda7dc8eee93c1b513d7a8c1a5f2109f" + }, + { + "left": "8b931f46462dd687a691d98571e234024ce232b3ea12e7c491d2aff532751a6d" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfExpiry-v1", + "value": "urn:dateOfExpiry.day:35423e9b6d22d581c038d969ec14b633f98229c5a81282f00b671cdbaac5f41d:1|urn:dateOfExpiry.month:358968a0405603d6e9fc0dba7cc6632065484fca09f6915be39d0972e4a52ddc:1|urn:dateOfExpiry.year:bebeb2dc0d96b580d7a75c2a04a843a9299af13c9b13abdb98bb0d34d50fe44f:1900|", + "claimPath": "document.dateOfExpiry", + "targetHash": "d2114d5ad43703302b914240272b7f0576184d7710c63254ace65e85a58a5902", + "node": [ + { + "right": "347f35a60b6fd7d0808318a4c9f7b066167b93eb6e7ed54bc9b929c2c69ecdd5" + }, + { + "left": "c22e02127ee1b8f2559e5869b018c69c280e19a925c0295f25375ff742b6a3bf" + }, + { + "right": "1fa7a1150163858e12b724ac49b2e955bda7dc8eee93c1b513d7a8c1a5f2109f" + }, + { + "left": "8b931f46462dd687a691d98571e234024ce232b3ea12e7c491d2aff532751a6d" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:65ae0c4dac5f5f1feebc38b799ae91a994bb66b81d244c3659c19b3e1c02de87:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "347f35a60b6fd7d0808318a4c9f7b066167b93eb6e7ed54bc9b929c2c69ecdd5", + "node": [ + { + "left": "d2114d5ad43703302b914240272b7f0576184d7710c63254ace65e85a58a5902" + }, + { + "left": "c22e02127ee1b8f2559e5869b018c69c280e19a925c0295f25375ff742b6a3bf" + }, + { + "right": "1fa7a1150163858e12b724ac49b2e955bda7dc8eee93c1b513d7a8c1a5f2109f" + }, + { + "left": "8b931f46462dd687a691d98571e234024ce232b3ea12e7c491d2aff532751a6d" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:6f953bdef8e334954443f10bece5118825efb6103c424a9c6d3276cd8c3cbb8f:2019-10-01T04:15:27.532Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "85cb8a4743fe0fbf89bba536a6e08e52f8b9bcb2886a68477c7b2b9c9c9b935b", + "node": [ + { + "right": "888518fc205d472572768d739c453310f54af9daf36002cdab208842686c5657" + }, + { + "right": "f2d58339177dcb882694f8b82b8b10a28d5875ddbd5a3cb08bcc72c5917c5cfa" + }, + { + "left": "adef7fd7d0ab649b5801de2eea075c14bfd8c6791e819e1eb68a978df122d286" + }, + { + "left": "8b931f46462dd687a691d98571e234024ce232b3ea12e7c491d2aff532751a6d" + }, + { + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" + } + ] + }, { - "identifier":"claim-cvc:Document.name-v1", - "value":"urn:name.familyNames:e0361c115e896be937fa522e803713c8d87828b7375eb57451ff9a5da07e4d54:CUNHA DE OLIVEIRA MIRANDA|urn:name.givenNames:f3991c4a55548650713d27d2ad3c85e97cd46f3979faea53ce22889036f68219:LUCAS|", - "claimPath":"document.name", - "targetHash":"3875c41908621a32bb85f1a82693b1c2c94be8403756c52ec53d3c30fe12a54e", - "node":[ + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:9931f5cc3942ea9094e7c63cfc63f61bdbb80146f4ca77b32261e66557d5a32b:null|", + "claimPath": "meta.expirationDate", + "targetHash": "888518fc205d472572768d739c453310f54af9daf36002cdab208842686c5657", + "node": [ { - "left":"4742651a09f95312f825b722d63242e6f5c2b05f850f74c6bd2480ac223014f0" + "left": "85cb8a4743fe0fbf89bba536a6e08e52f8b9bcb2886a68477c7b2b9c9c9b935b" }, { - "left":"a8e1e7958048bfd862f8f5bad89daa877bbc56a95b60577accc72ac7f7fbfc57" + "right": "f2d58339177dcb882694f8b82b8b10a28d5875ddbd5a3cb08bcc72c5917c5cfa" }, { - "right":"90a96f465a9477262e90d0e904efebed4072037784ecb59f29654340432ab633" + "left": "adef7fd7d0ab649b5801de2eea075c14bfd8c6791e819e1eb68a978df122d286" }, { - "right":"3af65cdabb072581813998b50948ddb7ea2551a9390c6fe8d98240dc10bc214e" + "left": "8b931f46462dd687a691d98571e234024ce232b3ea12e7c491d2aff532751a6d" }, { - "right":"4d7d8764e4dcaf3e12aaf3a4927c2e73ec486a68c4d6191ca54502607b246a7c" + "right": "d5c2bee3096bc5c71fc0d413d95e0d8c627a1636d8aba9af6cb72922421a2175" } ] } ] }, - "granted":null -} + "granted": null +} \ No newline at end of file diff --git a/src/__tests__/fixtures/invalidEmailCredential.json b/src/__tests__/fixtures/invalidEmailCredential.json index e8b0f9a..236431b 100644 --- a/src/__tests__/fixtures/invalidEmailCredential.json +++ b/src/__tests__/fixtures/invalidEmailCredential.json @@ -54,7 +54,7 @@ "leaves": [ { "identifier": "claim-cvc:Contact.email-v1", - "value": "urn:email.domain.name:ccbadf46768f874a143cee3cd84e5256221ffc6118a34eb75fcbef1e9b4be7ef:civic|urn:email.domain.tld:df3c5d1d8298b341e48f17b12dc74cad129c2b337b9653516ed9b04e36d3d01b:com|urn:email.username:820487c5d3a32806aa71887c0f6fe479ffff9e0eae30f20144c4b64935116a34:lucas|", + "value": "urn:email.domain.name:ccbadf46768f874a143cee3cd84e5256221ffc6118a34eb75fcbef1e9b4be7ef:civic|urn:email.domain.tld:df3c5d1d8298b341e48f17b12dc74cad129c2b337b9653516ed9b04e36d3d01b:com|urn:email.username:820487c5d3a32806aa71887c0f6fe479ffff9e0eae30f20144c4b64935116a34:testUsername|", "claimPath": "contact.email", "targetHash": "68b90b962c5aabfdf97b9f0149441e196f0b849fa908af88dd6c1abb74e4a517", "node": [ diff --git a/src/__tests__/fixtures/phoneNumberCredential.json b/src/__tests__/fixtures/phoneNumberCredential.json index 76773ae..175630c 100644 --- a/src/__tests__/fixtures/phoneNumberCredential.json +++ b/src/__tests__/fixtures/phoneNumberCredential.json @@ -1,8 +1,7 @@ { - "_id": "5c4b78e5950a9c003e2bc76d", - "id": "8adbe4bc-6451-4bed-a27c-a583c920b8f8", - "issuer": "did:ethr:000000", - "issuanceDate": "2019-01-25T21:00:21.897Z", + "id": "0ff85341-61bc-4336-b84d-c56e68449680", + "issuer": "", + "issuanceDate": "2020-03-30T11:58:28.182Z", "identifier": "credential-cvc:PhoneNumber-v1", "expirationDate": null, "version": "1", @@ -10,234 +9,231 @@ "Credential", "credential-cvc:PhoneNumber-v1" ], + "transient": false, "claim": { "contact": { "phoneNumber": { - "country": "BR", - "countryCode": "55", + "country": "LUX", + "countryCode": "35", + "extension": "276", "lineType": "mobile", - "number": "31988889999" + "number": "69276577" } } }, "proof": { "type": "CvcMerkleProof2018", - "merkleRoot": "56a12a38397de70cdf2672ba5bf307f8ba0c15893b809ff15a28166628b5fe79", - "anchor": { - "_id": "5c4cf490ea44bb003eb98d54", - "subject": { - "pub": "xpub6ZMk7qiaUPD77otKk6d8uzQpsiajQEMDV8FU76GVM96K52dLotjU6rwJuDa7S3ohh3tkG4dVzvvueV2PWtUobJVmFDhmuKSF6DesRhqFXer", - "label": "credential-cvc:PhoneNumber-v1", - "data": "56a12a38397de70cdf2672ba5bf307f8ba0c15893b809ff15a28166628b5fe79", - "signature": "3045022100e756b593827284787bcd4f33d70e99d289f1c59ee549ff95c5bac117af529fea02202a24b1e8fd5a2b663f03d8aac401120e28fe3985d6962ad02b3740827cf34188" - }, - "cosigners": [ - { - "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" - }, - { - "pub": "xpub661MyMwAqRbcFRTsjjPwCiR5r5gaKFxALXsCZP8PG2VLfnvYZJ9TpQ8Y9hPH61rcsurJXd9jnHmPidA3Vdm9uGJ3mRareggavntQamGTsJn" - } - ], - "authority": { - "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", - "path": "/1/0/0/0" - }, - "tx": "010000000116725448150406e3e22d39a5409616d2077c5ec1111fca4d2da086794462f82200000000fdfd00004730440220151af6fbef8378ecde0e66e964548d3a14d721d78ff1cef6af318909c797c130022045b297689327394d915d3270b4b3f7ee2abac60b1a5be117d07e9223ca584bd00148304502210088dda868912140a2d389f453af5bb61cc17b95c66a8a1237c6c2a464454aa9cd02201ec3d06788d0c3283134b649e534a45447b6a93b424b8c9c001d67f7c7f31366014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d821031b9373dbd99e75521fcde76d26c2e269a4c5530637a837dccb6c8c88cbb286fe2103da3271b35b5b0c689389dbc562fcc3bf7530d4a490c4622735c12f993867718253aeffffffff01551500000000000017a91426fa4962b4d410126ea44d16a75b8eac4d56100a8700000000", - "type": "temporary", - "network": "bitcoincashTestnet", - "schema": "tbch-20180201", - "requestId": "5c4cf48fea44bb003eb98d53", - "deletedAt": -1 - }, + "merkleRoot": "d703b6074d5cc083a992564736722fff1aac8a5e4c500ace9cd0ad6a612cc5f8", + "anchor": "TBD (Civic Blockchain Attestation)", "leaves": [ { "identifier": "claim-cvc:Contact.phoneNumber-v1", - "value": "urn:phoneNumber.country:bc756ea29c643bafc900fceb59bc1638fbc4df3e7267a270970d54af47506cb0:BR|urn:phoneNumber.countryCode:60b8e8eef8aea03719afdb45d3efa5e41cf5efd937873c4e953c8967c4bcd4b7:55|urn:phoneNumber.lineType:72c73d814f49f52da9489b2f54382abd3a95bafb1ec411afa3c97efaa5f4853c:mobile|urn:phoneNumber.number:b0c5987dc4eb90b4e09ace78687e2970d1cbd9285c32b0fca52f9c3a761423de:31988889999|", + "value": "urn:phoneNumber.country:0a77cce7e0d83996e1ab6ef02db409ff73d227fb13b22a764d0c7595dfb31cf0:LUX|urn:phoneNumber.countryCode:d27bfea74bb5e4f0b621cd941c3d405912d49560e7803c5562416c8ab333be91:35|urn:phoneNumber.extension:e952a2fea827cdd7e7f951557ff95f84ee5c70edcfc11fa05d73fa627626267a:276|urn:phoneNumber.lineType:00f83d5a225d83c03aa6b131cf5fe68d66a048c42c1d64c6d67a34de015f0369:mobile|urn:phoneNumber.number:a4d67780b54772ac9c268ab08acc6f93437299239b7ba029daa5a6f070b1444e:69276577|", "claimPath": "contact.phoneNumber", - "targetHash": "fa783377d158983e3f647c07da3f73bf80d67e28242737bdf546296c28814fe2", + "targetHash": "c5a2b6970f1befe2f6f0883ff10bd812dafdf4714067b01f5e1360d10ba686b4", "node": [ { - "right": "ba507f351a2f2c05bc5668a4330ec667c89e261c9126b5f4642015d1e27c6b56" + "right": "416a728aeb7fe41bf9b2aa8bffb7cfa7283016451d94168f3d59c025343550cf" }, { - "right": "fcbaceeada779c9d8fb92fe2198a92c000607c0355a927acc83661d142c06445" + "right": "288e7ee308c1a9aa8d452482a4c9c4cdbf9ebf90f6434534bfa4759203f7abfa" }, { - "right": "23ee41e18d3dc82adb99f4f6f19bb57503ebf3a0d5234bdd64f07589b0706758" + "right": "014921c9eae4cdbf382f8f87ebcaf77e9513ef29fee1264896cd1fcbdc096331" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "claim-cvc:PhoneNumber.country-v1", - "value": "urn:country:bc756ea29c643bafc900fceb59bc1638fbc4df3e7267a270970d54af47506cb0:BR|", + "value": "urn:country:0a77cce7e0d83996e1ab6ef02db409ff73d227fb13b22a764d0c7595dfb31cf0:LUX|", "claimPath": "contact.phoneNumber.country", - "targetHash": "ba507f351a2f2c05bc5668a4330ec667c89e261c9126b5f4642015d1e27c6b56", + "targetHash": "416a728aeb7fe41bf9b2aa8bffb7cfa7283016451d94168f3d59c025343550cf", "node": [ { - "left": "fa783377d158983e3f647c07da3f73bf80d67e28242737bdf546296c28814fe2" + "left": "c5a2b6970f1befe2f6f0883ff10bd812dafdf4714067b01f5e1360d10ba686b4" }, { - "right": "fcbaceeada779c9d8fb92fe2198a92c000607c0355a927acc83661d142c06445" + "right": "288e7ee308c1a9aa8d452482a4c9c4cdbf9ebf90f6434534bfa4759203f7abfa" }, { - "right": "23ee41e18d3dc82adb99f4f6f19bb57503ebf3a0d5234bdd64f07589b0706758" + "right": "014921c9eae4cdbf382f8f87ebcaf77e9513ef29fee1264896cd1fcbdc096331" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "claim-cvc:PhoneNumber.countryCode-v1", - "value": "urn:countryCode:60b8e8eef8aea03719afdb45d3efa5e41cf5efd937873c4e953c8967c4bcd4b7:55|", + "value": "urn:countryCode:d27bfea74bb5e4f0b621cd941c3d405912d49560e7803c5562416c8ab333be91:35|", "claimPath": "contact.phoneNumber.countryCode", - "targetHash": "2691c6f5c6613611dcf850966f810e5e58224eea7f69d335ff21c814f78b32fb", + "targetHash": "24f733bcef224ef99ff6ff879885c7411609e2174f6076cbbe4cba0846989000", + "node": [ + { + "right": "ff0a43d2661f8edbad8054704b4246ceab1b6734b2ac73f61e5c7a124098ec79" + }, + { + "left": "94c2b5f4f9a27b69ffe22c3be825d0fb22468e18e0da969be484870e6869499c" + }, + { + "right": "014921c9eae4cdbf382f8f87ebcaf77e9513ef29fee1264896cd1fcbdc096331" + }, + { + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" + }, + { + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.extension-v1", + "value": "urn:extension:e952a2fea827cdd7e7f951557ff95f84ee5c70edcfc11fa05d73fa627626267a:276|", + "claimPath": "contact.phoneNumber.extension", + "targetHash": "ff0a43d2661f8edbad8054704b4246ceab1b6734b2ac73f61e5c7a124098ec79", "node": [ { - "right": "4d82f8df2840ac986f9d23c0ba707887c461bdfb6f71b3b2a0c5b8ce8eff2001" + "left": "24f733bcef224ef99ff6ff879885c7411609e2174f6076cbbe4cba0846989000" }, { - "left": "969bd9d8d07598b50dad48c1f9894fc68552eab37ba6b7e37f489e089e79d977" + "left": "94c2b5f4f9a27b69ffe22c3be825d0fb22468e18e0da969be484870e6869499c" }, { - "right": "23ee41e18d3dc82adb99f4f6f19bb57503ebf3a0d5234bdd64f07589b0706758" + "right": "014921c9eae4cdbf382f8f87ebcaf77e9513ef29fee1264896cd1fcbdc096331" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "claim-cvc:PhoneNumber.number-v1", - "value": "urn:number:b0c5987dc4eb90b4e09ace78687e2970d1cbd9285c32b0fca52f9c3a761423de:31988889999|", + "value": "urn:number:a4d67780b54772ac9c268ab08acc6f93437299239b7ba029daa5a6f070b1444e:69276577|", "claimPath": "contact.phoneNumber.number", - "targetHash": "4d82f8df2840ac986f9d23c0ba707887c461bdfb6f71b3b2a0c5b8ce8eff2001", + "targetHash": "e47c3ec31d0a447e83682d2775540fff441078eb758385ac5129f62964e94d61", "node": [ { - "left": "2691c6f5c6613611dcf850966f810e5e58224eea7f69d335ff21c814f78b32fb" + "right": "a3e8dce79c769109113a8653dc5a52263c80bace1d8470b2b487b257e3cbfdfa" }, { - "left": "969bd9d8d07598b50dad48c1f9894fc68552eab37ba6b7e37f489e089e79d977" + "right": "5d5f630711227a7319e0d8d0d46e0fd39bb50799018604e0514ac0954a18dfa3" }, { - "right": "23ee41e18d3dc82adb99f4f6f19bb57503ebf3a0d5234bdd64f07589b0706758" + "left": "21158276209d939208bea6314cfe84d76940d4a583f01a9be836c10d5bc7b0fa" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "claim-cvc:PhoneNumber.lineType-v1", - "value": "urn:lineType:72c73d814f49f52da9489b2f54382abd3a95bafb1ec411afa3c97efaa5f4853c:mobile|", + "value": "urn:lineType:00f83d5a225d83c03aa6b131cf5fe68d66a048c42c1d64c6d67a34de015f0369:mobile|", "claimPath": "contact.phoneNumber.lineType", - "targetHash": "451bda252d2df1e67ffa7cde69fb9d24f6d95d9245a8a2ec16eb2248b9644402", + "targetHash": "a3e8dce79c769109113a8653dc5a52263c80bace1d8470b2b487b257e3cbfdfa", "node": [ { - "right": "11bb4c6cee8129faf970a8046d5bd81cb9db0cf0acb589f0a043f24f781869bb" + "left": "e47c3ec31d0a447e83682d2775540fff441078eb758385ac5129f62964e94d61" }, { - "right": "115e26fae6418523b92c88e7a867a26eda20491c011360d721ad9ae762796706" + "right": "5d5f630711227a7319e0d8d0d46e0fd39bb50799018604e0514ac0954a18dfa3" }, { - "left": "2224ad02df40a24360118daaa3cf76769d394b0f1a2f620db493fd78c6384fab" + "left": "21158276209d939208bea6314cfe84d76940d4a583f01a9be836c10d5bc7b0fa" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "cvc:Meta:issuer", - "value": "urn:issuer:6230acaf4655bb7b80d00af6f7bae859afe6bdfbb5315c513c29933a5cd8eb31:did:ethr:000000|", + "value": "urn:issuer:7ba242896c31394df917e871e46fdc24e131a452c7736c9e3e5502c1d4bd44f2:|", "claimPath": "meta.issuer", - "targetHash": "11bb4c6cee8129faf970a8046d5bd81cb9db0cf0acb589f0a043f24f781869bb", + "targetHash": "0f990c66ea01cd592e220c5e0a2366dfa4f3acd6323f2f09573dc6329f82d507", "node": [ { - "left": "451bda252d2df1e67ffa7cde69fb9d24f6d95d9245a8a2ec16eb2248b9644402" + "right": "2c199c4ab901519ea6d44ab4b0f3368835f58abbac7b3d5337ebf59d7ed87896" }, { - "right": "115e26fae6418523b92c88e7a867a26eda20491c011360d721ad9ae762796706" + "left": "879e27b2a26564da9168712404bb582daa381005f20886047da9f41a8f587883" }, { - "left": "2224ad02df40a24360118daaa3cf76769d394b0f1a2f620db493fd78c6384fab" + "left": "21158276209d939208bea6314cfe84d76940d4a583f01a9be836c10d5bc7b0fa" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "cvc:Meta:issuanceDate", - "value": "urn:issuanceDate:7d6f2b2d19341095a56ec658242db307033053fcaa3b05355c6d872a51ec3b66:2019-01-25T21:00:21.897Z|", + "value": "urn:issuanceDate:600c336b4a18aa9cc54540edc43049efa27110ffc096d7990233f0e2a329507e:2020-03-30T11:58:28.182Z|", "claimPath": "meta.issuanceDate", - "targetHash": "b2ec38172bc8db1f65a7cbbff587a1ce719099cfa55d762b4540fc1ecc8326c8", + "targetHash": "2c199c4ab901519ea6d44ab4b0f3368835f58abbac7b3d5337ebf59d7ed87896", "node": [ { - "right": "b1e7434c8da8755171f623248193e2dee61de60b5fe922efc59bf1c4744b4d6f" + "left": "0f990c66ea01cd592e220c5e0a2366dfa4f3acd6323f2f09573dc6329f82d507" }, { - "left": "519e150552d80e17e02c0552d9faffeb43eb526b8af78634ff69e78b0099588a" + "left": "879e27b2a26564da9168712404bb582daa381005f20886047da9f41a8f587883" }, { - "left": "2224ad02df40a24360118daaa3cf76769d394b0f1a2f620db493fd78c6384fab" + "left": "21158276209d939208bea6314cfe84d76940d4a583f01a9be836c10d5bc7b0fa" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "right": "ad1cfb98a938f1b6872dbd990fbe6dea92b234ad133aa15fb951f91ae8cb817f" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] }, { "identifier": "cvc:Meta:expirationDate", - "value": "urn:expirationDate:b966a315cd7ed8f24ceac5ccf564080374325758f0bb302cfd7875fee848a46b:null|", + "value": "urn:expirationDate:231d0822270fa43e10ee92b4c28f29ebdcdb761abab92f8327bc875419d79704:null|", "claimPath": "meta.expirationDate", - "targetHash": "b1e7434c8da8755171f623248193e2dee61de60b5fe922efc59bf1c4744b4d6f", + "targetHash": "46e1c91abad3f4630d48e45dd12ee2aedd9d97b82bb02150579b7e6c8090cae7", "node": [ { - "left": "b2ec38172bc8db1f65a7cbbff587a1ce719099cfa55d762b4540fc1ecc8326c8" + "right": "5b09f67d8f02af640e454d9d952d75dbce3fd71ecdfd77c65097ea8cbe8f5c34" }, { - "left": "519e150552d80e17e02c0552d9faffeb43eb526b8af78634ff69e78b0099588a" + "right": "79d61117c5b28eaf6a3cacc61033833618beb3c3b1f9823782a479582724a850" }, { - "left": "2224ad02df40a24360118daaa3cf76769d394b0f1a2f620db493fd78c6384fab" + "right": "57601941d5f1cee81c9a6239f7ab3b1a177e72ef64b01dfb388172fc9b9055ce" }, { - "right": "73d821c42cc4a38709c648b188f35dda0be783ab2fa5afbbf5b29da57365eccc" + "left": "0c26e4e8c8dea1ad62bbd6feaac51b7b95cf2dd95d99f1aea4f20e033cee5f85" }, { - "right": "a2031118216b01444ec4d116c88874befa268190d8bc54b0d60d10bb03a946cb" + "right": "580c09f4515a95ca1369406888b4911f6f83459c3d28db670af89c6c1fe641c8" } ] } ] }, - "user_id": "04c4c4ed4c2b7b2697b46b5a0266177de9e50d4bac03bf8ea940d2e9b482f52af04f247a719d4f603ebad8b37c3ad74bd2aeefe022db093e18b7057346f24f2b93", - "createdAt": "2019-01-25T20:59:21.706Z", - "updatedAt": "2019-01-27T00:00:15.042Z" -} + "granted": null +} \ No newline at end of file diff --git a/src/__tests__/fixtures/piiFactory/brokenDsrResponse.json b/src/__tests__/fixtures/piiFactory/brokenDsrResponse.json new file mode 100644 index 0000000..d2ec0ac --- /dev/null +++ b/src/__tests__/fixtures/piiFactory/brokenDsrResponse.json @@ -0,0 +1,53 @@ +{ + "verifiableData": [ + { + "credentialItemRequest": { + "requestIndex": 4, + "identifier": "credential-cvc:UnverifiedAddress-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedAddress-v1", + "issuer": { + "is": { + "$eq": "???" + } + } + } + } + }, + "credential": { + "_id": "5db36061c3c3860061cf87fa", + "id": "eb883d4d-6517-4c8e-a363-62f3a7212b1c", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-10-25T20:51:45.594Z", + "identifier": "credential-cvc:UnverifiedAddress-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:UnverifiedAddress-v1" + ], + "transient": true, + "claim": { + "identity": { + "address": { + "city": "San Francisco", + "country": "US", + "postalCode": "94105", + "state": "CA", + "street": "1 Market St", + "unit": "Suite 402" + } + } + }, + "proof": null, + "granted": "3045022100c065e1e404e05a508b0d9b16d0eeb6a7c1a70c6beecd4b02971963c116b5775302205d6b1e29e9c1b4eb31ad8d346ac224c1f29ffa81f61e263f4d00038137be2b2b", + "deletedAt": -1 + }, + "requestStatus": [], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060" + } + ], + "requestStatus": [], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060" +} diff --git a/src/__tests__/fixtures/piiFactory/dsrTemplate.json b/src/__tests__/fixtures/piiFactory/dsrTemplate.json new file mode 100644 index 0000000..1180d6c --- /dev/null +++ b/src/__tests__/fixtures/piiFactory/dsrTemplate.json @@ -0,0 +1,100 @@ +{ + "payload": { + "version": "1", + "requesterInfo": { + "app": { + "id": "000", + "name": "Test", + "logo": "https://", + "description": "The Test Payment Provider", + "primaryColor": "#000000", + "secondaryColor": "#000000" + } + }, + "credentialItems": [ + { + "identifier": "credential-cvc:UnverifiedSsn-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedSsn-v1", + "issuer": { + "is": { + "$eq": "" + } + } + } + } + }, + { + "identifier": "credential-cvc:UnverifiedAddress-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedAddress-v1", + "issuer": { + "is": { + "$eq": "" + } + } + } + } + }, + { + "identifier": "credential-cvc:IdDocument-v2", + "constraints": { + "meta": { + "credential": "credential-cvc:IdDocument-v2", + "issuer": { + "is": { + "$eq": "" + } + } + } + } + }, + { + "identifier": "credential-cvc:Email-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:Email-v1", + "issuer": { + "is": { + "$eq": "" + } + } + } + } + }, + { + "identifier": "credential-cvc:PhoneNumber-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:PhoneNumber-v1", + "issuer": { + "is": { + "$eq": "" + } + } + } + } + } + ], + "channels": { + "evidences": { + "idDocumentFront": { + "accepts": "application/json", + "method": "put", + "headers": { + "Content-Type": "application/json" + } + }, + "idDocumentBack": { + "accepts": "application/json", + "method": "put", + "headers": { + "Content-Type": "application/json" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseNonUsCountry.json b/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseNonUsCountry.json new file mode 100644 index 0000000..e536846 --- /dev/null +++ b/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseNonUsCountry.json @@ -0,0 +1,876 @@ +{ + "verifiableData": [ + { + "credentialItemRequest": { + "requestIndex": 0, + "identifier": "credential-cvc:Email-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:Email-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe0ff2dc363004e3fc8fc", + "id": "16cf46c4-6c9d-4618-8de7-55a4367c7e6c", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:22:39.987Z", + "identifier": "credential-cvc:Email-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:Email-v1" + ], + "claim": { + "contact": { + "email": { + "domain": { + "name": "civic", + "tld": "com" + }, + "username": "testUsername" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "dfe10517aaba1393287039f3247ce262c1c07afe6bd9a50c91a0c49cf864e936", + "anchor": { + "_id": "5d7fe1099e1ef6004fa13ef5", + "subject": { + "pub": "xpub6a1dPa1T6hJi5xiRULACAfhosfPyyACorNVtbGRxY4HKL8SmZMkp89pwEbPtrHsQDZGH4TMakNBeRVEdpnYp1ZE72P9d2iE6uq5XejZezKT", + "label": "credential-cvc:Email-v1", + "data": "dfe10517aaba1393287039f3247ce262c1c07afe6bd9a50c91a0c49cf864e936", + "signature": "3045022100b8dce405c965ecc82a6f79dc7cc67c3d7cec9c3f95c3821ed0b22b95cd444861022045914f12ca8f0d2847b126abc6c0d17ab2a71decdf28939ed36a85890b18797d" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcF1TpBFdDWwykXAM8MwV95uCpexH7mQ1M64L9AYNHoMpjrQJ9A3Vg5nLVpUBiPXrKEP7heYdi9bR2TMsjQXeYvmrceAFRZvU" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "0100000001691766681583bf2da12f15799dfc89130aa2e5b595325459ce8a9c29998ac73400000000fdfe0000483045022100d999f646408a513e121445149c38cacfe78a022d213300ac54bbaf262531f8c502204527b60064676b5c9829a7fe29b55ce2e5422c3835c08eb7e6dc7d1d3e5c264f0148304502210088967272a7e94e25ee7b55ba4fa306abaffc141201f9067c915ede5ad197082b02201234ce269909f90406fbb4fcd705ae1d617129f7dff6813bc94ba4bece713d2b014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82102b8b95203153c7bd9af54a649d447afe48dffb2ad6ff6a9928274b8bf724064ca2103807f397d4a1fad623ddcaa950e92790321c5a2b315a88b4f9f82c77aa776ee5b53aeffffffff01551500000000000017a914f737c140b7991c819d06bb250dcfd3af135e3a9a8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe1079e1ef6004fa13ef4", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Contact.email-v1", + "value": "urn:email.domain.name:c53b584233e04fbedf3d6b9e4849f40384510f979f04480c0873338591dd81d1:civic|urn:email.domain.tld:1d2bb89850051c86841e093831594830fbc2047606735e54c4cca84725a0237e:com|urn:email.username:0861781a154724a10627a1736f2f90f18e023b17714f5d18c5772a8916f921f3:testUsername|", + "claimPath": "contact.email", + "targetHash": "96b2603f12c0b45a94ba3b0674594d9b19373d718ae25ad2d4f3066a5f971022", + "node": [ + { + "right": "12978c8f5fd68e3216920e405d917ab393fddd1a1369dc534bef8b9942212704" + }, + { + "right": "ef43bc9a6104ef4ac466eae540774e6cab44329ac8fdfda201b0eab5859af798" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "claim-cvc:Email.domain-v1", + "value": "urn:domain.name:c53b584233e04fbedf3d6b9e4849f40384510f979f04480c0873338591dd81d1:civic|urn:domain.tld:1d2bb89850051c86841e093831594830fbc2047606735e54c4cca84725a0237e:com|", + "claimPath": "contact.email.domain", + "targetHash": "12978c8f5fd68e3216920e405d917ab393fddd1a1369dc534bef8b9942212704", + "node": [ + { + "left": "96b2603f12c0b45a94ba3b0674594d9b19373d718ae25ad2d4f3066a5f971022" + }, + { + "right": "ef43bc9a6104ef4ac466eae540774e6cab44329ac8fdfda201b0eab5859af798" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:fd13aca8b1c502230339f293fcdef79a80a39ffc41e0fabf848bcedbacb898c7:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "d6e2543e29c191e77ba26af224ff5c3a02b5a6888c5449c19867148ee3cbf8d5", + "node": [ + { + "right": "20426f5a57487ccbdc6057092d7873c837dd461fccbc35cfd34716cf0d968b86" + }, + { + "left": "0adf0a8712fe94906b9615c164031f6e167a61aeac085be39a39dd509d389bcc" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:be66c69a9954c7d0a070a831dc21a17c2579eae4693b2b51a0c0af4a97ad92a6:2019-09-16T19:22:39.987Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "20426f5a57487ccbdc6057092d7873c837dd461fccbc35cfd34716cf0d968b86", + "node": [ + { + "left": "d6e2543e29c191e77ba26af224ff5c3a02b5a6888c5449c19867148ee3cbf8d5" + }, + { + "left": "0adf0a8712fe94906b9615c164031f6e167a61aeac085be39a39dd509d389bcc" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:158fe6b3ceeec81df6286384a83d9681f10f8eed276b8751bd6bf89da3e2ae74:null|", + "claimPath": "meta.expirationDate", + "targetHash": "1547a09bb989614b91838f3513d12ef21d4e4b1c9cc65acfdd0cfea49a9179a0", + "node": [ + { + "right": "cde9108c7af59362c859c90a6c4a2e9c8ae50439563ce92febf92e0361bd5d2e" + }, + { + "right": "5d386f7a95b22ca7df8b9db96bd67bc1af3de2a173d936945edbaa21134b1bac" + }, + { + "left": "f396748191fad82c8378956f6b86ff25a8d452f8073b40042f681a03e7d199e1" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + } + ] + }, + "granted": null, + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 1, + "identifier": "credential-cvc:PhoneNumber-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:PhoneNumber-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe15d474a30004f93e0c0", + "id": "30754bf1-c028-4267-aef0-12b78f4a1128", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:24:13.590Z", + "identifier": "credential-cvc:PhoneNumber-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:PhoneNumber-v1" + ], + "claim": { + "contact": { + "phoneNumber": { + "country": "BR", + "countryCode": "55", + "lineType": "mobile", + "number": "31999258177" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "dd2198c6643dcad2df9379cdd5a9ad183a6ec229eedb1ed281baab51ad060022", + "anchor": { + "_id": "5d7fe167dde535004ed14240", + "subject": { + "pub": "xpub6a5Nt5cQsrk4N8oQrVkWt9L4cNALchG2U4fPkRTBGfsWj6EcW2zno7zqLFuwqo5xYbvH6xD31SFXDrudP6QePuyvMJLnuoCLjEUQEg7vwMU", + "label": "credential-cvc:PhoneNumber-v1", + "data": "dd2198c6643dcad2df9379cdd5a9ad183a6ec229eedb1ed281baab51ad060022", + "signature": "3045022100a3e2fb0a463a6144fdd3f3fa7e23bcb6621ab27251e893b0ef86a29bcce7bcbf02207386df2a0a202a5903796be9b9b1d1517335eb76c3eeaf591c052f841b2c43ed" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcGoLYtjhvZVUpfpx1pZskgkj7Q954N45mJUruxX47AxBzzwT4fgECuyS2CZyCAcLyMho4bkUjHhafoinn2BQ6o3MFteAuVkg" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "01000000016318666815bfc9b6cf884ccff2113ab9e6a655e25b6f6c67143b299f4586df9600000000fc0047304402203781e4442ed1d98020cbf5ed3c29b2980d764128771b164763be3825b0a4a02c022049bf2f682b6784fd2ea92cc9cf02c01185ea38cb573e6de5d8abebf2ddc4e0160147304402207d072970960ea849f368363538aeb5b054f4b9c45c63f66b9c2150ef766faa2b022067d21272bdce123a77b050fc103d5e16e7d2115741754a2cfa706a036e4df516014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d8210203d00b1e505c0ec983af71a680d464f7f5a3c07fb390ad3098615eec2099a0e521027aa8055bda05cd1243b071053556fb123ff665c5d28c6148f620a00934700d5953aeffffffff01551500000000000017a9146cb182f6a780180965ac84636ce152a41f2464bd8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe166dde535004ed1423f", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Contact.phoneNumber-v1", + "value": "urn:phoneNumber.country:4c08b2e0523cbbd0a4e6437a532a37a2cd96ab0523a88a5b73f5b6ef62f1ff92:BR|urn:phoneNumber.countryCode:c96e6952ee202ca25a617b15c544e0c29b393a78c82eca958400918704fe67c0:55|urn:phoneNumber.lineType:d082268ea936a66f49404c9eec1aabe0a124e95f3b441f570117d987eead70ed:mobile|urn:phoneNumber.number:e77aa268de985db9de2edcfe7e1931189274b16cca682bc2eb93e2512da4099c:31999258177|", + "claimPath": "contact.phoneNumber", + "targetHash": "f47d52bc078a643fbfbc79544bfd9cc209f10ad4af6c8836bfd22d57baa9e4b8", + "node": [ + { + "right": "93b120b68865392e7bba23bdd462341ebd372766ce22c8b30c7a9e8570c36ac2" + }, + { + "right": "e4885db96e3e9c59faae93bf91f403bf036e3b5c26006e615d569d3fda61b561" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.country-v1", + "value": "urn:country:4c08b2e0523cbbd0a4e6437a532a37a2cd96ab0523a88a5b73f5b6ef62f1ff92:BR|", + "claimPath": "contact.phoneNumber.country", + "targetHash": "93b120b68865392e7bba23bdd462341ebd372766ce22c8b30c7a9e8570c36ac2", + "node": [ + { + "left": "f47d52bc078a643fbfbc79544bfd9cc209f10ad4af6c8836bfd22d57baa9e4b8" + }, + { + "right": "e4885db96e3e9c59faae93bf91f403bf036e3b5c26006e615d569d3fda61b561" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.countryCode-v1", + "value": "urn:countryCode:c96e6952ee202ca25a617b15c544e0c29b393a78c82eca958400918704fe67c0:55|", + "claimPath": "contact.phoneNumber.countryCode", + "targetHash": "e6b9b644b84735aae746c07daf9c05ce06af928899220503559020dd6bdf7c06", + "node": [ + { + "right": "44426c48cb5dbf6a631ccd999f7aa90834585673a2db587ee2a631bfa9904a27" + }, + { + "left": "11cff67c552efb1fb08b2077ee68720f309817157c52cc6eedbc6eb43e1d7586" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.lineType-v1", + "value": "urn:lineType:d082268ea936a66f49404c9eec1aabe0a124e95f3b441f570117d987eead70ed:mobile|", + "claimPath": "contact.phoneNumber.lineType", + "targetHash": "44426c48cb5dbf6a631ccd999f7aa90834585673a2db587ee2a631bfa9904a27", + "node": [ + { + "left": "e6b9b644b84735aae746c07daf9c05ce06af928899220503559020dd6bdf7c06" + }, + { + "left": "11cff67c552efb1fb08b2077ee68720f309817157c52cc6eedbc6eb43e1d7586" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.number-v1", + "value": "urn:number:e77aa268de985db9de2edcfe7e1931189274b16cca682bc2eb93e2512da4099c:31999258177|", + "claimPath": "contact.phoneNumber.number", + "targetHash": "ed5bae9e802da35296ec775f8135f7feab13f092bd3fdd1ae576349afc7bed24", + "node": [ + { + "right": "cfe6de4c8b6e0f5d79110b6782355de3471f434303c3d1328d73374b911df458" + }, + { + "right": "cbd1d4e09696aab5678cac1698374884a23c0a21e9e3edd4047a3c4aad88ce5c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:2fc3460a06f19f35dcb01e5f0a7fed95f4341c733a7244960455912d1efe2f2b:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "cfe6de4c8b6e0f5d79110b6782355de3471f434303c3d1328d73374b911df458", + "node": [ + { + "left": "ed5bae9e802da35296ec775f8135f7feab13f092bd3fdd1ae576349afc7bed24" + }, + { + "right": "cbd1d4e09696aab5678cac1698374884a23c0a21e9e3edd4047a3c4aad88ce5c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:b3da7419c6d0f66656f7d70f02ba8845fb5d6cac86a0eefcce4e836378f9c13c:2019-09-16T19:24:13.590Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "fc825ed18a6c964d5a5d5db03ac4e12de665c21f02007594324bf2cb4f3832c5", + "node": [ + { + "right": "b6e60a140e0f135231ed146183711c66ff42e6a3280b04acf8dabd1a74a657b2" + }, + { + "left": "2712e55da0c37f529d851119121fafefa830816b4089130d9ebd2f51d96a871c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:093932b963ffb250d766c57e8fcd18107166ae6e51776efd5e752524f393d499:null|", + "claimPath": "meta.expirationDate", + "targetHash": "b6e60a140e0f135231ed146183711c66ff42e6a3280b04acf8dabd1a74a657b2", + "node": [ + { + "left": "fc825ed18a6c964d5a5d5db03ac4e12de665c21f02007594324bf2cb4f3832c5" + }, + { + "left": "2712e55da0c37f529d851119121fafefa830816b4089130d9ebd2f51d96a871c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + } + ] + }, + "granted": null, + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 2, + "identifier": "credential-cvc:IdDocument-v2", + "constraints": { + "meta": { + "credential": "credential-cvc:IdDocument-v2", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe1932dc363004e3fc8fd", + "id": "a091c9e2-b1e3-49f0-a522-e6eda79d78c3", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:25:07.813Z", + "identifier": "credential-cvc:IdDocument-v2", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:IdDocument-v2" + ], + "claim": { + "document": { + "evidences": { + "idDocumentFront": { + "algorithm": "sha256", + "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + }, + "selfie": { + "algorithm": "sha256", + "data": "0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f" + } + }, + "name": { + "familyNames": "Resu", + "givenNames": "Civic" + }, + "dateOfBirth": { + "day": 1, + "month": 1, + "year": 1900 + }, + "type": "passport", + "number": "9999999999", + "issueCountry": "GBR", + "dateOfExpiry": { + "day": 1, + "month": 1, + "year": 1900 + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "a9505c3731081c8ac0b480715cd3e366379060669dcd8b968d0a1d632d47954a", + "anchor": { + "_id": "5d7fe19c08c60a004f1a25e9", + "subject": { + "pub": "xpub6YsKJCTxJabdzfnQdeQZE3AHkQWoQtN19HQ89PxEN8YvYgJcUHseUn8QP6wJVcg1NHBFuZQjUBg8aMsd47Mh3eri9xvGAtsEN6MTmjJtzun", + "label": "credential-cvc:IdDocument-v2", + "data": "a9505c3731081c8ac0b480715cd3e366379060669dcd8b968d0a1d632d47954a", + "signature": "3045022100e459d6306719e875fda9f77138f8a3f86f924558ceefab5a3168f39cbf38161b022043cceee724d2ec064476c6b433d1935b2fc47d56122a0f1ed1b3873016c2d19c" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcFicCoKedfKjGWxH1JvcpbjaD5zChAU1tj7kLTK1kvEmC3QB8Zx5myyT6AFmHTBmXTnU2Aph429oXz5H9xpEUKtNjArhskCX" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "010000000116196668153fd917a06ddac26cbb6384ffc478335b0ce6e020a386c7ea0c613e00000000fdfd00004830450221009d8cfd892a39caa41049485c9d297c0d742b91109127f8dfd12a01eafd26b83d0220469fd77f890fde6cb0f7ceae5f3e82807adea4945c2759501275567d12cc03e6014730440220270015ac6b7e142c94b3508f7ea872be2ce1e6105bed40e8143a9f90f3b1f40702200a8761a96f4d20c9002d4c8518c9e610b46ef1acb8e462c0add29c80855c27f8014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82103fd4c5e8578f8b9c1a25dfc790f095bb012008a8f079d9615c1368451cf57dfa22102ded5ab64aa46639064d42f468d5ec380df632d61858b67b23807caa4686c6b9953aeffffffff01551500000000000017a9141e29a4fb154029de509d17d1e9029c0d3551e5128700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe19b08c60a004f1a25e8", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Document.evidences-v1", + "value": "urn:evidences.idDocumentFront.algorithm:78efc68e26a9d82b639ae9a08152198f8c5e44c645af5bcca49958ab868f5f8a:sha256|urn:evidences.idDocumentFront.data:4d585a24e1d24657d6794293eca6a440024e1cda438fed7608d9a0d4baab2c85:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|urn:evidences.selfie.algorithm:62416916b2ac3a3e4ce49d48ea969d8b74c4b716f05bc657863ba013be99ea86:sha256|urn:evidences.selfie.data:3df9bd7be02797f5db7b0a0daf1a0f3a96555a4c73e878ffeefb04a70cf8fd93:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "document.evidences", + "targetHash": "d414ac383e79a8ef4c37b2239fc86c82f7da34851f7c888e753af4f17d84986d", + "node": [ + { + "right": "c921efc6d0ef83ecdf577b97d2de384ced6cab9b6cc2b3f33e2661574b69781b" + }, + { + "right": "cebffd5d42595e9567040292efd052533fb4e8d48b86bf19a48b4e9ed715e1a9" + }, + { + "right": "5adbd0aaa735d2e0090153f4bd002968c4f0273e790f57bd96fa209fd193df73" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.idDocumentFront-v1", + "value": "urn:idDocumentFront.algorithm:78efc68e26a9d82b639ae9a08152198f8c5e44c645af5bcca49958ab868f5f8a:sha256|urn:idDocumentFront.data:4d585a24e1d24657d6794293eca6a440024e1cda438fed7608d9a0d4baab2c85:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|", + "claimPath": "validationEvidences.idDocumentFront", + "targetHash": "c921efc6d0ef83ecdf577b97d2de384ced6cab9b6cc2b3f33e2661574b69781b", + "node": [ + { + "left": "d414ac383e79a8ef4c37b2239fc86c82f7da34851f7c888e753af4f17d84986d" + }, + { + "right": "cebffd5d42595e9567040292efd052533fb4e8d48b86bf19a48b4e9ed715e1a9" + }, + { + "right": "5adbd0aaa735d2e0090153f4bd002968c4f0273e790f57bd96fa209fd193df73" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.selfie-v1", + "value": "urn:selfie.algorithm:62416916b2ac3a3e4ce49d48ea969d8b74c4b716f05bc657863ba013be99ea86:sha256|urn:selfie.data:3df9bd7be02797f5db7b0a0daf1a0f3a96555a4c73e878ffeefb04a70cf8fd93:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "validationEvidences.selfie", + "targetHash": "7b8647cd5327cff5cbae3bc5fdeb81ef84fab5eb4e12ed66f636f2193a86d971", + "node": [ + { + "right": "210bf2fa56bfb3eaf53cb80fd677d3977818e2b118209b4b7f26e9df53a7945f" + }, + { + "left": "23b749c01deec45029e655453566f0e363b999d7aa0843abef744432e93640ac" + }, + { + "right": "5adbd0aaa735d2e0090153f4bd002968c4f0273e790f57bd96fa209fd193df73" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Document.name-v1", + "value": "urn:name.familyNames:269a0a01bc30e656df09260065b891d56a78798ca75484b571fd60154c2fba6f:Resu|urn:name.givenNames:44bc1def0c4d89f3c06cb71f0993fe81f210cd3b8bf1251250e442e91b565f21:Civic|", + "claimPath": "document.name", + "targetHash": "210bf2fa56bfb3eaf53cb80fd677d3977818e2b118209b4b7f26e9df53a7945f", + "node": [ + { + "left": "7b8647cd5327cff5cbae3bc5fdeb81ef84fab5eb4e12ed66f636f2193a86d971" + }, + { + "left": "23b749c01deec45029e655453566f0e363b999d7aa0843abef744432e93640ac" + }, + { + "right": "5adbd0aaa735d2e0090153f4bd002968c4f0273e790f57bd96fa209fd193df73" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Name.familyNames-v1", + "value": "urn:familyNames:269a0a01bc30e656df09260065b891d56a78798ca75484b571fd60154c2fba6f:Resu|", + "claimPath": "document.name.familyNames", + "targetHash": "1133d018281791e8823e4391b93335ef4cc4b33f3405416b74106fabb52e02a5", + "node": [ + { + "right": "0b7ae6f6dd14c00fef0c6f6c7983e8aeb8de9df8b4ed481cafe99d3df6d13c74" + }, + { + "right": "089d13018421f6d36318c6048c772225ece79753ba2f0d60d31cc4e5d0e7a3af" + }, + { + "left": "98c92d360a365a7f8020d6e78568ebb300ad1b36d8c878eb7e70ed3493e83405" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Name.givenNames-v1", + "value": "urn:givenNames:44bc1def0c4d89f3c06cb71f0993fe81f210cd3b8bf1251250e442e91b565f21:Civic|", + "claimPath": "document.name.givenNames", + "targetHash": "0b7ae6f6dd14c00fef0c6f6c7983e8aeb8de9df8b4ed481cafe99d3df6d13c74", + "node": [ + { + "left": "1133d018281791e8823e4391b93335ef4cc4b33f3405416b74106fabb52e02a5" + }, + { + "right": "089d13018421f6d36318c6048c772225ece79753ba2f0d60d31cc4e5d0e7a3af" + }, + { + "left": "98c92d360a365a7f8020d6e78568ebb300ad1b36d8c878eb7e70ed3493e83405" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfBirth-v1", + "value": "urn:dateOfBirth.day:c0945c443677eed64189cd27373a0602ac63d7c542881145e1c1ca228a7c5b9f:1|urn:dateOfBirth.month:9d743f6be9fce913d7b7ac85d9582ed26481ad9a5ac82f082bf775b3d2bb1d9d:1|urn:dateOfBirth.year:352fab30d301a5235208c35c356af3d8b6627e6738998a556067a2632e1ef6d4:1900|", + "claimPath": "document.dateOfBirth", + "targetHash": "cde46645e4cfaa622c266aeac8f20f6239d099284d5320653d4f16b9aace9a06", + "node": [ + { + "right": "e8708d713d1e55bf1f4ab11d10f53e07588756154d860ca94b7a1af306ba1216" + }, + { + "left": "7c6ba2eb3b3f4af061e50b70b9a23ef119ee913571a97e8f61a9b83745c8835c" + }, + { + "left": "98c92d360a365a7f8020d6e78568ebb300ad1b36d8c878eb7e70ed3493e83405" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Document.type-v1", + "value": "urn:type:26708ad49083cb9aa4b6ff2c3c68dd298dbd395cb507b335817c56925799b5c1:passport|", + "claimPath": "document.type", + "targetHash": "e8708d713d1e55bf1f4ab11d10f53e07588756154d860ca94b7a1af306ba1216", + "node": [ + { + "left": "cde46645e4cfaa622c266aeac8f20f6239d099284d5320653d4f16b9aace9a06" + }, + { + "left": "7c6ba2eb3b3f4af061e50b70b9a23ef119ee913571a97e8f61a9b83745c8835c" + }, + { + "left": "98c92d360a365a7f8020d6e78568ebb300ad1b36d8c878eb7e70ed3493e83405" + }, + { + "right": "d88141e7dadbc0645dcf52e93f920167547a523c1813820ed2dfb85ae088d409" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Document.number-v1", + "value": "urn:number:0deccbbad9638810783866eb2e45dd7653a4d662cb00bf0035a8b8b067617b4e:9999999999|", + "claimPath": "document.number", + "targetHash": "90a87ee9c1a13fb49f590bf2ecc49675fd8d6b583a7d6747da69dc2eea148a17", + "node": [ + { + "right": "55f0522d4219e091d5bdb8aa090e0b40b8145149cff8ef605986bac196516c02" + }, + { + "right": "fdeb841280825937c0d0ec0fe6d475fa258b221ccf62955d248d04b61d605ba2" + }, + { + "right": "ef08fb33fddd1f861257d4191403d4674805066f67d2f4f7bcc76a3928c5eb58" + }, + { + "left": "f7420afb78a02c36c1e9a5112c2d6e7272808745a4d03acc435c6911e518f536" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Document.issueCountry-v1", + "value": "urn:issueCountry:748b476fc7755b1f76223e423dccf5a2007058b72e7a36f2ac7058be954df590:GBR|", + "claimPath": "document.issueCountry", + "targetHash": "55f0522d4219e091d5bdb8aa090e0b40b8145149cff8ef605986bac196516c02", + "node": [ + { + "left": "90a87ee9c1a13fb49f590bf2ecc49675fd8d6b583a7d6747da69dc2eea148a17" + }, + { + "right": "fdeb841280825937c0d0ec0fe6d475fa258b221ccf62955d248d04b61d605ba2" + }, + { + "right": "ef08fb33fddd1f861257d4191403d4674805066f67d2f4f7bcc76a3928c5eb58" + }, + { + "left": "f7420afb78a02c36c1e9a5112c2d6e7272808745a4d03acc435c6911e518f536" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfExpiry-v1", + "value": "urn:dateOfExpiry.day:b68beb4fb6c864cbc20c84fe12e702ccb9440650ef662ac165bc592160cdf25a:1|urn:dateOfExpiry.month:abb26b04be0f7c29c63374d82dbe6d9a005ad3e0067a6724fc632d59d99d4ece:1|urn:dateOfExpiry.year:d6e2e5ea7b84c7a6cc8c03649585b773af80011d277812d714b5a97ddb156b9c:1900|", + "claimPath": "document.dateOfExpiry", + "targetHash": "abcf3c232019e84b396ac42728581b68488522fef910914de65f68d61f115a83", + "node": [ + { + "right": "990edb33003cced2707464bafb5b4a67626dfe95fb782bc7d77d87b6eb6c92bf" + }, + { + "left": "56fa9f697f1b8230b2d3f6a16c1c0f2f3072de1acb1b4dd4a016aedd9a94e2a7" + }, + { + "right": "ef08fb33fddd1f861257d4191403d4674805066f67d2f4f7bcc76a3928c5eb58" + }, + { + "left": "f7420afb78a02c36c1e9a5112c2d6e7272808745a4d03acc435c6911e518f536" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:2256f15735ab0e435b2887aa730908ffd0a7eb100803a43674525f7ba7cc7da0:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "990edb33003cced2707464bafb5b4a67626dfe95fb782bc7d77d87b6eb6c92bf", + "node": [ + { + "left": "abcf3c232019e84b396ac42728581b68488522fef910914de65f68d61f115a83" + }, + { + "left": "56fa9f697f1b8230b2d3f6a16c1c0f2f3072de1acb1b4dd4a016aedd9a94e2a7" + }, + { + "right": "ef08fb33fddd1f861257d4191403d4674805066f67d2f4f7bcc76a3928c5eb58" + }, + { + "left": "f7420afb78a02c36c1e9a5112c2d6e7272808745a4d03acc435c6911e518f536" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:8e850077dd4161662999ae5dc0f909a1b42d2476a088a7b94b6d531c2898ce3b:2019-09-16T19:25:07.813Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "1a1ff65c506afa2ec51b51270ace88725f00ec8a915a9b988b1703a7d6288ca7", + "node": [ + { + "right": "b13114e4dbebef626cda68d64b5788e6b584a9119c30b7489ffe2d1f542b575d" + }, + { + "right": "f48cbcd382ecaed8034525a04bf8a7c76de0e11afcd66d7a188221e9ed352c35" + }, + { + "left": "8fa511b8380a3b3b3f6910258de4735834158cb9b2600181afc38b7e5adbce12" + }, + { + "left": "f7420afb78a02c36c1e9a5112c2d6e7272808745a4d03acc435c6911e518f536" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:636f18763e2448bed2cb60a984194c50acedb43fafd83804447ec4cb3e94c7c9:null|", + "claimPath": "meta.expirationDate", + "targetHash": "b13114e4dbebef626cda68d64b5788e6b584a9119c30b7489ffe2d1f542b575d", + "node": [ + { + "left": "1a1ff65c506afa2ec51b51270ace88725f00ec8a915a9b988b1703a7d6288ca7" + }, + { + "right": "f48cbcd382ecaed8034525a04bf8a7c76de0e11afcd66d7a188221e9ed352c35" + }, + { + "left": "8fa511b8380a3b3b3f6910258de4735834158cb9b2600181afc38b7e5adbce12" + }, + { + "left": "f7420afb78a02c36c1e9a5112c2d6e7272808745a4d03acc435c6911e518f536" + }, + { + "right": "6f02d885c307859ef728b3e4354a8eeab16459f09e09354945a3b2569e3745d1" + } + ] + } + ] + }, + "granted": null, + "user_id": "03bf176a6a4e4841ec348a8007e655e2e746806576048fc1fe4ff2e8bc6351ecc2", + "createdAt": "2019-09-16T19:24:29.374Z", + "updatedAt": "2019-09-16T19:25:15.023Z", + "deletedAt": -1 + } + } + ], + "requestStatus": [ + ], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060", + "token": "public-sandbox-355c007d-e553-41ee-8366-4db36bc9e688|nrVopxbLWRCRpLV44Zm8cplVGbbK6Dt6e7EoX" +} diff --git a/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseUsCountry.json b/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseUsCountry.json new file mode 100644 index 0000000..a06ba97 --- /dev/null +++ b/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseUsCountry.json @@ -0,0 +1,1332 @@ +{ + "verifiableData": [ + { + "credentialItemRequest": { + "requestIndex": 0, + "identifier": "credential-cvc:Email-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:Email-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe0ff2dc363004e3fc8fc", + "id": "16cf46c4-6c9d-4618-8de7-55a4367c7e6c", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:22:39.987Z", + "identifier": "credential-cvc:Email-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:Email-v1" + ], + "claim": { + "contact": { + "email": { + "domain": { + "name": "civic", + "tld": "com" + }, + "username": "testUsername" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "dfe10517aaba1393287039f3247ce262c1c07afe6bd9a50c91a0c49cf864e936", + "anchor": { + "_id": "5d7fe1099e1ef6004fa13ef5", + "subject": { + "pub": "xpub6a1dPa1T6hJi5xiRULACAfhosfPyyACorNVtbGRxY4HKL8SmZMkp89pwEbPtrHsQDZGH4TMakNBeRVEdpnYp1ZE72P9d2iE6uq5XejZezKT", + "label": "credential-cvc:Email-v1", + "data": "dfe10517aaba1393287039f3247ce262c1c07afe6bd9a50c91a0c49cf864e936", + "signature": "3045022100b8dce405c965ecc82a6f79dc7cc67c3d7cec9c3f95c3821ed0b22b95cd444861022045914f12ca8f0d2847b126abc6c0d17ab2a71decdf28939ed36a85890b18797d" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcF1TpBFdDWwykXAM8MwV95uCpexH7mQ1M64L9AYNHoMpjrQJ9A3Vg5nLVpUBiPXrKEP7heYdi9bR2TMsjQXeYvmrceAFRZvU" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "0100000001691766681583bf2da12f15799dfc89130aa2e5b595325459ce8a9c29998ac73400000000fdfe0000483045022100d999f646408a513e121445149c38cacfe78a022d213300ac54bbaf262531f8c502204527b60064676b5c9829a7fe29b55ce2e5422c3835c08eb7e6dc7d1d3e5c264f0148304502210088967272a7e94e25ee7b55ba4fa306abaffc141201f9067c915ede5ad197082b02201234ce269909f90406fbb4fcd705ae1d617129f7dff6813bc94ba4bece713d2b014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82102b8b95203153c7bd9af54a649d447afe48dffb2ad6ff6a9928274b8bf724064ca2103807f397d4a1fad623ddcaa950e92790321c5a2b315a88b4f9f82c77aa776ee5b53aeffffffff01551500000000000017a914f737c140b7991c819d06bb250dcfd3af135e3a9a8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe1079e1ef6004fa13ef4", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Contact.email-v1", + "value": "urn:email.domain.name:c53b584233e04fbedf3d6b9e4849f40384510f979f04480c0873338591dd81d1:civic|urn:email.domain.tld:1d2bb89850051c86841e093831594830fbc2047606735e54c4cca84725a0237e:com|urn:email.username:0861781a154724a10627a1736f2f90f18e023b17714f5d18c5772a8916f921f3:testUsername|", + "claimPath": "contact.email", + "targetHash": "96b2603f12c0b45a94ba3b0674594d9b19373d718ae25ad2d4f3066a5f971022", + "node": [ + { + "right": "12978c8f5fd68e3216920e405d917ab393fddd1a1369dc534bef8b9942212704" + }, + { + "right": "ef43bc9a6104ef4ac466eae540774e6cab44329ac8fdfda201b0eab5859af798" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "claim-cvc:Email.domain-v1", + "value": "urn:domain.name:c53b584233e04fbedf3d6b9e4849f40384510f979f04480c0873338591dd81d1:civic|urn:domain.tld:1d2bb89850051c86841e093831594830fbc2047606735e54c4cca84725a0237e:com|", + "claimPath": "contact.email.domain", + "targetHash": "12978c8f5fd68e3216920e405d917ab393fddd1a1369dc534bef8b9942212704", + "node": [ + { + "left": "96b2603f12c0b45a94ba3b0674594d9b19373d718ae25ad2d4f3066a5f971022" + }, + { + "right": "ef43bc9a6104ef4ac466eae540774e6cab44329ac8fdfda201b0eab5859af798" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:fd13aca8b1c502230339f293fcdef79a80a39ffc41e0fabf848bcedbacb898c7:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "d6e2543e29c191e77ba26af224ff5c3a02b5a6888c5449c19867148ee3cbf8d5", + "node": [ + { + "right": "20426f5a57487ccbdc6057092d7873c837dd461fccbc35cfd34716cf0d968b86" + }, + { + "left": "0adf0a8712fe94906b9615c164031f6e167a61aeac085be39a39dd509d389bcc" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:be66c69a9954c7d0a070a831dc21a17c2579eae4693b2b51a0c0af4a97ad92a6:2019-09-16T19:22:39.987Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "20426f5a57487ccbdc6057092d7873c837dd461fccbc35cfd34716cf0d968b86", + "node": [ + { + "left": "d6e2543e29c191e77ba26af224ff5c3a02b5a6888c5449c19867148ee3cbf8d5" + }, + { + "left": "0adf0a8712fe94906b9615c164031f6e167a61aeac085be39a39dd509d389bcc" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:158fe6b3ceeec81df6286384a83d9681f10f8eed276b8751bd6bf89da3e2ae74:null|", + "claimPath": "meta.expirationDate", + "targetHash": "1547a09bb989614b91838f3513d12ef21d4e4b1c9cc65acfdd0cfea49a9179a0", + "node": [ + { + "right": "cde9108c7af59362c859c90a6c4a2e9c8ae50439563ce92febf92e0361bd5d2e" + }, + { + "right": "5d386f7a95b22ca7df8b9db96bd67bc1af3de2a173d936945edbaa21134b1bac" + }, + { + "left": "f396748191fad82c8378956f6b86ff25a8d452f8073b40042f681a03e7d199e1" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + } + ] + }, + "granted": null, + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 1, + "identifier": "credential-cvc:PhoneNumber-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:PhoneNumber-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe15d474a30004f93e0c0", + "id": "30754bf1-c028-4267-aef0-12b78f4a1128", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:24:13.590Z", + "identifier": "credential-cvc:PhoneNumber-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:PhoneNumber-v1" + ], + "claim": { + "contact": { + "phoneNumber": { + "country": "BR", + "countryCode": "55", + "lineType": "mobile", + "number": "31999258177" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "dd2198c6643dcad2df9379cdd5a9ad183a6ec229eedb1ed281baab51ad060022", + "anchor": { + "_id": "5d7fe167dde535004ed14240", + "subject": { + "pub": "xpub6a5Nt5cQsrk4N8oQrVkWt9L4cNALchG2U4fPkRTBGfsWj6EcW2zno7zqLFuwqo5xYbvH6xD31SFXDrudP6QePuyvMJLnuoCLjEUQEg7vwMU", + "label": "credential-cvc:PhoneNumber-v1", + "data": "dd2198c6643dcad2df9379cdd5a9ad183a6ec229eedb1ed281baab51ad060022", + "signature": "3045022100a3e2fb0a463a6144fdd3f3fa7e23bcb6621ab27251e893b0ef86a29bcce7bcbf02207386df2a0a202a5903796be9b9b1d1517335eb76c3eeaf591c052f841b2c43ed" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcGoLYtjhvZVUpfpx1pZskgkj7Q954N45mJUruxX47AxBzzwT4fgECuyS2CZyCAcLyMho4bkUjHhafoinn2BQ6o3MFteAuVkg" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "01000000016318666815bfc9b6cf884ccff2113ab9e6a655e25b6f6c67143b299f4586df9600000000fc0047304402203781e4442ed1d98020cbf5ed3c29b2980d764128771b164763be3825b0a4a02c022049bf2f682b6784fd2ea92cc9cf02c01185ea38cb573e6de5d8abebf2ddc4e0160147304402207d072970960ea849f368363538aeb5b054f4b9c45c63f66b9c2150ef766faa2b022067d21272bdce123a77b050fc103d5e16e7d2115741754a2cfa706a036e4df516014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d8210203d00b1e505c0ec983af71a680d464f7f5a3c07fb390ad3098615eec2099a0e521027aa8055bda05cd1243b071053556fb123ff665c5d28c6148f620a00934700d5953aeffffffff01551500000000000017a9146cb182f6a780180965ac84636ce152a41f2464bd8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe166dde535004ed1423f", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Contact.phoneNumber-v1", + "value": "urn:phoneNumber.country:4c08b2e0523cbbd0a4e6437a532a37a2cd96ab0523a88a5b73f5b6ef62f1ff92:BR|urn:phoneNumber.countryCode:c96e6952ee202ca25a617b15c544e0c29b393a78c82eca958400918704fe67c0:55|urn:phoneNumber.lineType:d082268ea936a66f49404c9eec1aabe0a124e95f3b441f570117d987eead70ed:mobile|urn:phoneNumber.number:e77aa268de985db9de2edcfe7e1931189274b16cca682bc2eb93e2512da4099c:31999258177|", + "claimPath": "contact.phoneNumber", + "targetHash": "f47d52bc078a643fbfbc79544bfd9cc209f10ad4af6c8836bfd22d57baa9e4b8", + "node": [ + { + "right": "93b120b68865392e7bba23bdd462341ebd372766ce22c8b30c7a9e8570c36ac2" + }, + { + "right": "e4885db96e3e9c59faae93bf91f403bf036e3b5c26006e615d569d3fda61b561" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.country-v1", + "value": "urn:country:4c08b2e0523cbbd0a4e6437a532a37a2cd96ab0523a88a5b73f5b6ef62f1ff92:BR|", + "claimPath": "contact.phoneNumber.country", + "targetHash": "93b120b68865392e7bba23bdd462341ebd372766ce22c8b30c7a9e8570c36ac2", + "node": [ + { + "left": "f47d52bc078a643fbfbc79544bfd9cc209f10ad4af6c8836bfd22d57baa9e4b8" + }, + { + "right": "e4885db96e3e9c59faae93bf91f403bf036e3b5c26006e615d569d3fda61b561" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.countryCode-v1", + "value": "urn:countryCode:c96e6952ee202ca25a617b15c544e0c29b393a78c82eca958400918704fe67c0:55|", + "claimPath": "contact.phoneNumber.countryCode", + "targetHash": "e6b9b644b84735aae746c07daf9c05ce06af928899220503559020dd6bdf7c06", + "node": [ + { + "right": "44426c48cb5dbf6a631ccd999f7aa90834585673a2db587ee2a631bfa9904a27" + }, + { + "left": "11cff67c552efb1fb08b2077ee68720f309817157c52cc6eedbc6eb43e1d7586" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.lineType-v1", + "value": "urn:lineType:d082268ea936a66f49404c9eec1aabe0a124e95f3b441f570117d987eead70ed:mobile|", + "claimPath": "contact.phoneNumber.lineType", + "targetHash": "44426c48cb5dbf6a631ccd999f7aa90834585673a2db587ee2a631bfa9904a27", + "node": [ + { + "left": "e6b9b644b84735aae746c07daf9c05ce06af928899220503559020dd6bdf7c06" + }, + { + "left": "11cff67c552efb1fb08b2077ee68720f309817157c52cc6eedbc6eb43e1d7586" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.number-v1", + "value": "urn:number:e77aa268de985db9de2edcfe7e1931189274b16cca682bc2eb93e2512da4099c:31999258177|", + "claimPath": "contact.phoneNumber.number", + "targetHash": "ed5bae9e802da35296ec775f8135f7feab13f092bd3fdd1ae576349afc7bed24", + "node": [ + { + "right": "cfe6de4c8b6e0f5d79110b6782355de3471f434303c3d1328d73374b911df458" + }, + { + "right": "cbd1d4e09696aab5678cac1698374884a23c0a21e9e3edd4047a3c4aad88ce5c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:2fc3460a06f19f35dcb01e5f0a7fed95f4341c733a7244960455912d1efe2f2b:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "cfe6de4c8b6e0f5d79110b6782355de3471f434303c3d1328d73374b911df458", + "node": [ + { + "left": "ed5bae9e802da35296ec775f8135f7feab13f092bd3fdd1ae576349afc7bed24" + }, + { + "right": "cbd1d4e09696aab5678cac1698374884a23c0a21e9e3edd4047a3c4aad88ce5c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:b3da7419c6d0f66656f7d70f02ba8845fb5d6cac86a0eefcce4e836378f9c13c:2019-09-16T19:24:13.590Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "fc825ed18a6c964d5a5d5db03ac4e12de665c21f02007594324bf2cb4f3832c5", + "node": [ + { + "right": "b6e60a140e0f135231ed146183711c66ff42e6a3280b04acf8dabd1a74a657b2" + }, + { + "left": "2712e55da0c37f529d851119121fafefa830816b4089130d9ebd2f51d96a871c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:093932b963ffb250d766c57e8fcd18107166ae6e51776efd5e752524f393d499:null|", + "claimPath": "meta.expirationDate", + "targetHash": "b6e60a140e0f135231ed146183711c66ff42e6a3280b04acf8dabd1a74a657b2", + "node": [ + { + "left": "fc825ed18a6c964d5a5d5db03ac4e12de665c21f02007594324bf2cb4f3832c5" + }, + { + "left": "2712e55da0c37f529d851119121fafefa830816b4089130d9ebd2f51d96a871c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + } + ] + }, + "granted": null, + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 2, + "identifier": "credential-cvc:IdDocument-v2", + "constraints": { + "meta": { + "credential": "credential-cvc:IdDocument-v2", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d9217734b0fcc004f2534b6", + "id": "0f4596c5-f8fe-4d8e-a327-04d55a2780a4", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-30T14:55:47.257Z", + "identifier": "credential-cvc:IdDocument-v2", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:IdDocument-v2" + ], + "claim": { + "document": { + "evidences": { + "idDocumentFront": { + "algorithm": "sha256", + "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + }, + "selfie": { + "algorithm": "sha256", + "data": "0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f" + } + }, + "name": { + "familyNames": "User", + "givenNames": "Civic" + }, + "dateOfBirth": { + "day": 1, + "month": 1, + "year": 1900 + }, + "type": "passport", + "number": "9999999999", + "issueCountry": "USA", + "dateOfExpiry": { + "day": 1, + "month": 1, + "year": 1900 + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "43e6c19e5f51a17e5b8eaa07d97110b8c1ac16ceab889cd1a20b028c73e24cec", + "anchor": { + "_id": "5d92178708c60a004f1a263f", + "subject": { + "pub": "xpub6ZiqffBjkUQB1r4Sefd1oRD1tErUfeTSpcf8cfS9dH8Bt4pbF57AYw3dsMou1AL5kVEbp3pqgBseg5ftkpsfmkY3epNGWLnFHC1PyHPuq4a", + "label": "credential-cvc:IdDocument-v2", + "data": "43e6c19e5f51a17e5b8eaa07d97110b8c1ac16ceab889cd1a20b028c73e24cec", + "signature": "304402202b008e22248f798a7df7a6b22af60d9e8159ba09e957756df9f3428f12158add02204065d9d60d2da62f46425edeba36ec5ec1f73503d699257812ab6109d8ecc17e" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcFvNcaAnUGafMUxmEfvfnJBz9ygme1GH16m79b5KAbaL8RkXx6rhXogNmeJYgf35hAY29FvYeev8z9hPtLUhsQc87KM8H7vo" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "010000000167538569151d5ffb2093a16ed87831ccca31b2a78cf72e4be89d720d58a179f500000000fdfd0000483045022100993c50bbdfd90936425c4dc19090c5b22082be9f46598a47e1bf39ca2df5390b0220464989ad72de301b0771aa999b26b8b5a17eb042ab1c5efe1062983abed6da560147304402203ce4d95ec6d5525b9acc0ad0756ef1970a908f886b543b7bdbd5698ac371545e02203f8213b4739d60998070ff2a7c785d4c3a3ee8ab9f58879ec230ec29df1b2032014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82102d83a89b82bf0b2794eb34e03a2415bf4213fcc742f1fc99b9fc83a07176cc9ec2102eb4564aa1523caafb6759a70ce43d439369e180cb504a730d33ef1181c10c67253aeffffffff01551500000000000017a914df28e4691bb24b6494ed7cb4fbdb83f26c8d385a8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d92178508c60a004f1a263e", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Document.evidences-v1", + "value": "urn:evidences.idDocumentFront.algorithm:477c2597ac9b6632ef2221a9a1f12ffbb05c470c2ab718a44aeebf5fb95d8233:sha256|urn:evidences.idDocumentFront.data:e149ca2f627c05e39ee0da3827e93ddbcdf6f321b0575d8ba190be73b20c5294:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|urn:evidences.selfie.algorithm:a697ba4c7742c134c347e7baf24ca4ff30d5493fcf99e12ceaa3c39096c299fd:sha256|urn:evidences.selfie.data:43798481814cb3b744a9245af78b07074537280ea3dc12c92379591ec7b41229:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "document.evidences", + "targetHash": "2f81e51859d6e253b3076268512cce90f63284aa14341fe5987bdb8418d0f00f", + "node": [ + { + "right": "51cb130d06d4aac9e5db8d9eeb44e0987ffea897457ca38ff9de7ac346fa12cd" + }, + { + "right": "56c9d1989a73e02fa6303e59416a5fd232ae487b2ffe84dcfe79a8669c1dc87d" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.idDocumentFront-v1", + "value": "urn:idDocumentFront.algorithm:477c2597ac9b6632ef2221a9a1f12ffbb05c470c2ab718a44aeebf5fb95d8233:sha256|urn:idDocumentFront.data:e149ca2f627c05e39ee0da3827e93ddbcdf6f321b0575d8ba190be73b20c5294:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|", + "claimPath": "validationEvidences.idDocumentFront", + "targetHash": "51cb130d06d4aac9e5db8d9eeb44e0987ffea897457ca38ff9de7ac346fa12cd", + "node": [ + { + "left": "2f81e51859d6e253b3076268512cce90f63284aa14341fe5987bdb8418d0f00f" + }, + { + "right": "56c9d1989a73e02fa6303e59416a5fd232ae487b2ffe84dcfe79a8669c1dc87d" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.selfie-v1", + "value": "urn:selfie.algorithm:a697ba4c7742c134c347e7baf24ca4ff30d5493fcf99e12ceaa3c39096c299fd:sha256|urn:selfie.data:43798481814cb3b744a9245af78b07074537280ea3dc12c92379591ec7b41229:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "validationEvidences.selfie", + "targetHash": "fc0ef4b30106ff81e4082538f0dbe69e49355ba1ccd3b08d3d760264acd8ac83", + "node": [ + { + "right": "1fdf74342b3a68b6d247079f561c603d0ccbdaca46c620a6a64c4771579a21be" + }, + { + "left": "47c8457f5e1b791c97054517c654dbbd373128a950f502e925bf599ef8535d26" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.name-v1", + "value": "urn:name.familyNames:fa1e9472cde0f2ba6cfdeca47fffe50b212f547df00d343596125fe4ada4a008:User|urn:name.givenNames:65d8fd0c08f6c72a7292132c8e26df234f7c5f44cfd904906a938246236753f2:Civic|", + "claimPath": "document.name", + "targetHash": "1fdf74342b3a68b6d247079f561c603d0ccbdaca46c620a6a64c4771579a21be", + "node": [ + { + "left": "fc0ef4b30106ff81e4082538f0dbe69e49355ba1ccd3b08d3d760264acd8ac83" + }, + { + "left": "47c8457f5e1b791c97054517c654dbbd373128a950f502e925bf599ef8535d26" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Name.familyNames-v1", + "value": "urn:familyNames:fa1e9472cde0f2ba6cfdeca47fffe50b212f547df00d343596125fe4ada4a008:User|", + "claimPath": "document.name.familyNames", + "targetHash": "d62c86e0007cf53d6e820a74687b869c02584043a9fa75cf6b19e473d37de68d", + "node": [ + { + "right": "ecd077f681982ba1f0ae061758ee78fd830da6cc7d610bda81dcdc120e6ef204" + }, + { + "right": "863d694e390119101ad0fbf34fc09f7acb9a0198e13459e363d4fd9ce300f113" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Name.givenNames-v1", + "value": "urn:givenNames:65d8fd0c08f6c72a7292132c8e26df234f7c5f44cfd904906a938246236753f2:Civic|", + "claimPath": "document.name.givenNames", + "targetHash": "ecd077f681982ba1f0ae061758ee78fd830da6cc7d610bda81dcdc120e6ef204", + "node": [ + { + "left": "d62c86e0007cf53d6e820a74687b869c02584043a9fa75cf6b19e473d37de68d" + }, + { + "right": "863d694e390119101ad0fbf34fc09f7acb9a0198e13459e363d4fd9ce300f113" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfBirth-v1", + "value": "urn:dateOfBirth.day:491bc05c36d14b0c627584e0598600834b73284b306c19b961170d304f071bdd:1|urn:dateOfBirth.month:6acf13278b268aca87a19d41feb53578e61ad7cf3df284cff9e59321f152d315:1|urn:dateOfBirth.year:f880da1b53efe028139255b70745dd862674cb8997aee97c5bc9096c2e947529:1900|", + "claimPath": "document.dateOfBirth", + "targetHash": "05a66bd72b4dedbf38ac5359d2b9c001215eb6e60caa75aa43ec8f35d5bd7aae", + "node": [ + { + "right": "478f2da92960cf16c138362cf57e4de5f28047ed02f84459138eedcd259ee02b" + }, + { + "left": "31825a4504399c984e2cab97223e4819b5d62655f6734a31ea8da99cfe26694f" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.type-v1", + "value": "urn:type:01e5e814015d0897e6eea9c33b54e6c425629030d478138148af9435bfe28a10:passport|", + "claimPath": "document.type", + "targetHash": "478f2da92960cf16c138362cf57e4de5f28047ed02f84459138eedcd259ee02b", + "node": [ + { + "left": "05a66bd72b4dedbf38ac5359d2b9c001215eb6e60caa75aa43ec8f35d5bd7aae" + }, + { + "left": "31825a4504399c984e2cab97223e4819b5d62655f6734a31ea8da99cfe26694f" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.number-v1", + "value": "urn:number:d02644ef31758bd7a2cd49088503c9ac2732b1163eb1e3cf81e5c5d69f1e6dd9:9999999999|", + "claimPath": "document.number", + "targetHash": "a99ccb2c7b8f31a640c901ae7b1000fc355767f9279ac04cd54eaf7d6c060a2e", + "node": [ + { + "right": "e747e4f51e61d03719867d3de171a7b5fdc939cf406c7f98827009e538fa37c9" + }, + { + "right": "4d8bf603d9860f264a101e0a680c8e4f10cb5e2d07c88f2fee5f0f14175061db" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.issueCountry-v1", + "value": "urn:issueCountry:36681fd74135877629bf303a441d6bef20e7a14184be9587696fdcd4b77989cd:USA|", + "claimPath": "document.issueCountry", + "targetHash": "e747e4f51e61d03719867d3de171a7b5fdc939cf406c7f98827009e538fa37c9", + "node": [ + { + "left": "a99ccb2c7b8f31a640c901ae7b1000fc355767f9279ac04cd54eaf7d6c060a2e" + }, + { + "right": "4d8bf603d9860f264a101e0a680c8e4f10cb5e2d07c88f2fee5f0f14175061db" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfExpiry-v1", + "value": "urn:dateOfExpiry.day:4c29f28013a396e66344463b467140b6877e83f4b02230c8fb8fcedae8c2e447:1|urn:dateOfExpiry.month:2e17b27306b77403e1e5e3fbb6a75b2c8fc0fb392bda5428c39da8428e4167d7:1|urn:dateOfExpiry.year:a82b90109a542970fc11e0eca25b7c10737a9a3f164fc7446246751ad991d874:1900|", + "claimPath": "document.dateOfExpiry", + "targetHash": "58fc0deaed11ced47c0c613751dc93f151aa8741b61d81ac56b4b288a9e63fb2", + "node": [ + { + "right": "338a6d506e9a148e1ef236c0efd54693f2b136c34876c0fe8667cdc71673c8b9" + }, + { + "left": "42025bbe623da1b524248ec92f98cb1aa7411019a1db97e4a3352845ac041fe1" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:b4976a48c36ab75d3f03ba9210f0fd698b8b381eeff6f0e32a9ddc4d2c8cd202:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "338a6d506e9a148e1ef236c0efd54693f2b136c34876c0fe8667cdc71673c8b9", + "node": [ + { + "left": "58fc0deaed11ced47c0c613751dc93f151aa8741b61d81ac56b4b288a9e63fb2" + }, + { + "left": "42025bbe623da1b524248ec92f98cb1aa7411019a1db97e4a3352845ac041fe1" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:e065fe133ef5862b5aba1166ae662c2764a3259ee8f115c6c1da24f4a4dcfd35:2019-09-30T14:55:47.257Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "4ad5082d0e7be26af1797b557288a39bb95f26df749d76dd912a248cd21ca299", + "node": [ + { + "right": "707413a7d33e9540bf934e15c602c429e1700b4a4815210792f9217d2e601d65" + }, + { + "right": "85e69c5d972065395c753358013373aa37763ddda58d38824988436b044f23d3" + }, + { + "left": "459d18e39685548595d5350b557d3d94607b1aa3284236278d43c6734e215292" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:1410f6739fc58230a3ff61861e09b9aab4585801359d966e9c19aba7b4ba541d:null|", + "claimPath": "meta.expirationDate", + "targetHash": "707413a7d33e9540bf934e15c602c429e1700b4a4815210792f9217d2e601d65", + "node": [ + { + "left": "4ad5082d0e7be26af1797b557288a39bb95f26df749d76dd912a248cd21ca299" + }, + { + "right": "85e69c5d972065395c753358013373aa37763ddda58d38824988436b044f23d3" + }, + { + "left": "459d18e39685548595d5350b557d3d94607b1aa3284236278d43c6734e215292" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + } + ] + }, + "granted": "3045022100844dce9c5d719755cd4721598f060e49b2977ac244cd5b6dac604ef4c3beea1302206164f0f985d9a916290c5aa33b2167a24ae6aac3ec39409ad23113680b895da6", + "user_id": "03bf176a6a4e4841ec348a8007e655e2e746806576048fc1fe4ff2e8bc6351ecc2", + "createdAt": "2019-09-30T14:53:47.809Z", + "updatedAt": "2019-09-30T14:56:05.927Z", + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 3, + "identifier": "credential-cvc:UnverifiedSsn-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedSsn-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5db42a6dc3c3860061cf87fb", + "id": "b3a4af17-a881-4bbd-b52e-61f63f84a77e", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-10-26T11:13:49.288Z", + "identifier": "credential-cvc:UnverifiedSsn-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:UnverifiedSsn-v1" + ], + "transient": true, + "claim": { + "socialSecurity": { + "number": { + "areaNumber": "000", + "groupNumber": "41", + "serialNumber": "4511" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "982c1e56e29e794c67fda2d1c85e81b18d9de068e2bfc46e3734fa2b81e6cabd", + "anchor": { + "type": "transient", + "subject": { + "label": "credential-cvc:UnverifiedSsn-v1", + "data": "982c1e56e29e794c67fda2d1c85e81b18d9de068e2bfc46e3734fa2b81e6cabd" + } + }, + "leaves": [ + { + "identifier": "claim-cvc:SocialSecurity.number-v1", + "value": "urn:number.areaNumber:67e414e493e4d5ab594d3d6aff068b6b7bb9019787415e28dd99e68a9c2eb360:000|urn:number.groupNumber:e539eedd02baa7366601ed462df4976ff7d131584f4b44d4554380bcee0be517:41|urn:number.serialNumber:a5efe7d520317f977a7dae2e6dfcbdc7fba926551c7474cfd540a9af52163514:4511|", + "claimPath": "socialSecurity.number", + "targetHash": "8e78be7fc923c1c112ed1017a53833942d5bf7b3601d7f1003450f92af07034a", + "node": [ + { + "right": "b3e2b3be053bc58ead319fa416719b062436c6fc44dd867f4e2792084b8fb4d3" + }, + { + "right": "e896ae2b5bea11c63c34e944a0f0e707e3ba45fd76e3f096bc27b089e4e84dc6" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:SocialSecurity:serialNumber", + "value": "urn:serialNumber:a5efe7d520317f977a7dae2e6dfcbdc7fba926551c7474cfd540a9af52163514:4511|", + "claimPath": "socialSecurity.serialNumber", + "targetHash": "b3e2b3be053bc58ead319fa416719b062436c6fc44dd867f4e2792084b8fb4d3", + "node": [ + { + "left": "8e78be7fc923c1c112ed1017a53833942d5bf7b3601d7f1003450f92af07034a" + }, + { + "right": "e896ae2b5bea11c63c34e944a0f0e707e3ba45fd76e3f096bc27b089e4e84dc6" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:ac7df526505e716e1ef75ffcfc544840c8dc56f09f1f460d91c2c27971ac4872:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "fb8e45de8ed6be64548731dc3eea94f70192698b375564ea46b489558c274fa4", + "node": [ + { + "right": "5faa249552a2415d0b800067cf076787f8a08879c1b1d357105f19d1eff997f9" + }, + { + "left": "d1fefb64084a4f389514725866588ce9c1ebbd835fddef41b50e5c3f9fe19585" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:943fa3e0d76aed29dd44fcbf874b1148351664551c15b8700998eaf2c6502f56:2019-10-26T11:13:49.288Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "5faa249552a2415d0b800067cf076787f8a08879c1b1d357105f19d1eff997f9", + "node": [ + { + "left": "fb8e45de8ed6be64548731dc3eea94f70192698b375564ea46b489558c274fa4" + }, + { + "left": "d1fefb64084a4f389514725866588ce9c1ebbd835fddef41b50e5c3f9fe19585" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:092d7db5e7b9a5a0a75e6576c5d766c212ae1650ab4da0d8c6787736d4c38a11:null|", + "claimPath": "meta.expirationDate", + "targetHash": "997d24328b8c5d78ca532a4534b73fb32bea4a6105a60f27994d7d994dacd743", + "node": [ + { + "right": "e25e98cd2dac504fb1ae855619e9c8fe6d5324c884091097273fe3b36beea2c5" + }, + { + "right": "f06e60ee6a098705d70d235cf7e809ae43f2419f66667c3ffc1ae66b40be801e" + }, + { + "left": "3b0bd73e5eb0b7784117d761689efe836e243e036e83fd606180946987af48b7" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + } + ] + }, + "granted": "3045022100b0321713c5dc1b28e29e5b23d6b39679e56c704c54bd1126b8785ba4b0bf279602203cfde4dcc59beed93dd960d733e3a44e869fcbcb88f2a4ff2d719bead1bc89a9", + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 4, + "identifier": "credential-cvc:UnverifiedAddress-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedAddress-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5db36061c3c3860061cf87fa", + "id": "eb883d4d-6517-4c8e-a363-62f3a7212b1c", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-10-25T20:51:45.594Z", + "identifier": "credential-cvc:UnverifiedAddress-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:UnverifiedAddress-v1" + ], + "transient": true, + "claim": { + "identity": { + "address": { + "city": "San Francisco", + "country": "US", + "postalCode": "94105", + "state": "CA", + "street": "1 Market St", + "unit": "Suite 402" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "9b2cf585902aa7be0a4626d35de3d0c7946f4c8b5a04875d277a5d56a9fedea6", + "anchor": { + "type": "transient", + "subject": { + "label": "credential-cvc:UnverifiedAddress-v1", + "data": "9b2cf585902aa7be0a4626d35de3d0c7946f4c8b5a04875d277a5d56a9fedea6" + } + }, + "leaves": [ + { + "identifier": "claim-cvc:Identity.address-v1", + "value": "urn:address.city:4a1aef770beb9d75bf2277a67940323a1a6d0dc66f2a4a17ebc7c8310a2335fd:San Francisco|urn:address.country:9c235472dd4adcdec5d0c1eea933cd40f9212758d63b8428374189dd020f097f:US|urn:address.postalCode:d993b2d60f3bf84386e7578ba6e18956b9f5173cdb9ccb35759d8115cee1846a:94105|urn:address.state:abda4f643bcd7faf6c7504d1922496ad3a342d3f8b071e7c1b761febd9bcd439:CA|urn:address.street:1e702358cc90498afb4aa34f6d92735de51b422b3e28bfb5876570a51c41a076:1 Market St|urn:address.unit:f4d67864782bb80160cc962c1bdadb725533a75bcbc17d5e463c72fd56116e3c:Suite 402|", + "claimPath": "identity.address", + "targetHash": "400bb853b60627639c00209800a3c53fadb159690af2672c3442e246d93f0ee5", + "node": [ + { + "right": "084ffb3a48749e91e0f707203ae864a1685c82899bf6334fcba3e886c83cb3a5" + }, + { + "right": "aeb779b3b6da1ce39ba382e1a3ddd2cb390fccbe63b6c0735b83df14941f71f2" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.city-v1", + "value": "urn:city:4a1aef770beb9d75bf2277a67940323a1a6d0dc66f2a4a17ebc7c8310a2335fd:San Francisco|", + "claimPath": "identity.address.city", + "targetHash": "084ffb3a48749e91e0f707203ae864a1685c82899bf6334fcba3e886c83cb3a5", + "node": [ + { + "left": "400bb853b60627639c00209800a3c53fadb159690af2672c3442e246d93f0ee5" + }, + { + "right": "aeb779b3b6da1ce39ba382e1a3ddd2cb390fccbe63b6c0735b83df14941f71f2" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.country-v1", + "value": "urn:country:9c235472dd4adcdec5d0c1eea933cd40f9212758d63b8428374189dd020f097f:US|", + "claimPath": "identity.address.country", + "targetHash": "b916a66c9648a21d04e4b52b2a5fe6c1f526dcbd6c3cf50245a545e6b68cc7e1", + "node": [ + { + "right": "6bfcd383735560954df32d065362c45d4f57522d0b66fa9d496c457f5ba8a20d" + }, + { + "left": "a1b1bd4692f0c0428a7cda3f7753b823ba6988a6e731285959333e770d9d3fcc" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.postalCode-v1", + "value": "urn:postalCode:d993b2d60f3bf84386e7578ba6e18956b9f5173cdb9ccb35759d8115cee1846a:94105|", + "claimPath": "identity.address.postalCode", + "targetHash": "6bfcd383735560954df32d065362c45d4f57522d0b66fa9d496c457f5ba8a20d", + "node": [ + { + "left": "b916a66c9648a21d04e4b52b2a5fe6c1f526dcbd6c3cf50245a545e6b68cc7e1" + }, + { + "left": "a1b1bd4692f0c0428a7cda3f7753b823ba6988a6e731285959333e770d9d3fcc" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.state-v1", + "value": "urn:state:abda4f643bcd7faf6c7504d1922496ad3a342d3f8b071e7c1b761febd9bcd439:CA|", + "claimPath": "identity.address.state", + "targetHash": "f3489be173669853b46667382f4b1dc6b24b08e5a686963cd1112765cacf61df", + "node": [ + { + "right": "0cbdf2be4546beff0c47d48bbe60b7168272b718bc9bf9b4cf8bd314baa14a7a" + }, + { + "right": "2766510eba1d30efc87e5bfad0157aabc612d86af805b052fd3cf5a4df1d9d34" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.street-v1", + "value": "urn:street:1e702358cc90498afb4aa34f6d92735de51b422b3e28bfb5876570a51c41a076:1 Market St|", + "claimPath": "identity.address.street", + "targetHash": "0cbdf2be4546beff0c47d48bbe60b7168272b718bc9bf9b4cf8bd314baa14a7a", + "node": [ + { + "left": "f3489be173669853b46667382f4b1dc6b24b08e5a686963cd1112765cacf61df" + }, + { + "right": "2766510eba1d30efc87e5bfad0157aabc612d86af805b052fd3cf5a4df1d9d34" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.unit-v1", + "value": "urn:unit:f4d67864782bb80160cc962c1bdadb725533a75bcbc17d5e463c72fd56116e3c:Suite 402|", + "claimPath": "identity.address.unit", + "targetHash": "8efb609c942a8b19d7801fdd2b3d15b1850f2936f82990bd2e6647ce76259a37", + "node": [ + { + "right": "6e37058c587c6fbbf7c416043f63d6afe5af57199882a80e2a252d939be74364" + }, + { + "left": "b3b52375270472380a73f9b34615d0d2354d431ca4f9eb4661b7dcf40665a10c" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:5bf22e14d0040fd201cfaccf463b2d5323fab4c71da742dd82d38b4eb4cb7674:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "6e37058c587c6fbbf7c416043f63d6afe5af57199882a80e2a252d939be74364", + "node": [ + { + "left": "8efb609c942a8b19d7801fdd2b3d15b1850f2936f82990bd2e6647ce76259a37" + }, + { + "left": "b3b52375270472380a73f9b34615d0d2354d431ca4f9eb4661b7dcf40665a10c" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:8ea37c0f6310f4a9f7500a59de8989052066413ec40b612e27757ccfee33a4f1:2019-10-25T20:51:45.594Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "d146a567ad28a831ebecc71b179360bb650a3ead83ec105c4b15a3acf1f06491", + "node": [ + { + "right": "d40b97d413be0ce7a12b2b1b795f8f01aa06e55fae389b1d1addd1b30bcd7e36" + }, + { + "right": "0e6dc0dee5b6d217472bc55b1766950d3e16371b4a393ec546419c83c5d8dc5b" + }, + { + "right": "269a7fe0e07c130626e072b207d3657dfa1039ed4f4f8b328b77b3c8179b9835" + }, + { + "left": "eeb18b12d05c9881ea4428a6ac80197e02967ceb0fb75a9577575ee87565cb4c" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:7c82eb965bb6fe0af75a8ddfe93209efc6aee8209aefd93191e5d084f1e6748f:null|", + "claimPath": "meta.expirationDate", + "targetHash": "d40b97d413be0ce7a12b2b1b795f8f01aa06e55fae389b1d1addd1b30bcd7e36", + "node": [ + { + "left": "d146a567ad28a831ebecc71b179360bb650a3ead83ec105c4b15a3acf1f06491" + }, + { + "right": "0e6dc0dee5b6d217472bc55b1766950d3e16371b4a393ec546419c83c5d8dc5b" + }, + { + "right": "269a7fe0e07c130626e072b207d3657dfa1039ed4f4f8b328b77b3c8179b9835" + }, + { + "left": "eeb18b12d05c9881ea4428a6ac80197e02967ceb0fb75a9577575ee87565cb4c" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + } + ] + }, + "granted": "3045022100c065e1e404e05a508b0d9b16d0eeb6a7c1a70c6beecd4b02971963c116b5775302205d6b1e29e9c1b4eb31ad8d346ac224c1f29ffa81f61e263f4d00038137be2b2b", + "deletedAt": -1 + }, + "requestStatus": [], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060" + } + ], + "requestStatus": [], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060" +} diff --git a/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseUsCountryFrontAndBack.json b/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseUsCountryFrontAndBack.json new file mode 100644 index 0000000..5f2e3b3 --- /dev/null +++ b/src/__tests__/fixtures/piiFactory/userPIIFromDsrResponseUsCountryFrontAndBack.json @@ -0,0 +1,1336 @@ +{ + "verifiableData": [ + { + "credentialItemRequest": { + "requestIndex": 0, + "identifier": "credential-cvc:Email-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:Email-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe0ff2dc363004e3fc8fc", + "id": "16cf46c4-6c9d-4618-8de7-55a4367c7e6c", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:22:39.987Z", + "identifier": "credential-cvc:Email-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:Email-v1" + ], + "claim": { + "contact": { + "email": { + "domain": { + "name": "civic", + "tld": "com" + }, + "username": "testUsername" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "dfe10517aaba1393287039f3247ce262c1c07afe6bd9a50c91a0c49cf864e936", + "anchor": { + "_id": "5d7fe1099e1ef6004fa13ef5", + "subject": { + "pub": "xpub6a1dPa1T6hJi5xiRULACAfhosfPyyACorNVtbGRxY4HKL8SmZMkp89pwEbPtrHsQDZGH4TMakNBeRVEdpnYp1ZE72P9d2iE6uq5XejZezKT", + "label": "credential-cvc:Email-v1", + "data": "dfe10517aaba1393287039f3247ce262c1c07afe6bd9a50c91a0c49cf864e936", + "signature": "3045022100b8dce405c965ecc82a6f79dc7cc67c3d7cec9c3f95c3821ed0b22b95cd444861022045914f12ca8f0d2847b126abc6c0d17ab2a71decdf28939ed36a85890b18797d" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcF1TpBFdDWwykXAM8MwV95uCpexH7mQ1M64L9AYNHoMpjrQJ9A3Vg5nLVpUBiPXrKEP7heYdi9bR2TMsjQXeYvmrceAFRZvU" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "0100000001691766681583bf2da12f15799dfc89130aa2e5b595325459ce8a9c29998ac73400000000fdfe0000483045022100d999f646408a513e121445149c38cacfe78a022d213300ac54bbaf262531f8c502204527b60064676b5c9829a7fe29b55ce2e5422c3835c08eb7e6dc7d1d3e5c264f0148304502210088967272a7e94e25ee7b55ba4fa306abaffc141201f9067c915ede5ad197082b02201234ce269909f90406fbb4fcd705ae1d617129f7dff6813bc94ba4bece713d2b014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82102b8b95203153c7bd9af54a649d447afe48dffb2ad6ff6a9928274b8bf724064ca2103807f397d4a1fad623ddcaa950e92790321c5a2b315a88b4f9f82c77aa776ee5b53aeffffffff01551500000000000017a914f737c140b7991c819d06bb250dcfd3af135e3a9a8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe1079e1ef6004fa13ef4", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Contact.email-v1", + "value": "urn:email.domain.name:c53b584233e04fbedf3d6b9e4849f40384510f979f04480c0873338591dd81d1:civic|urn:email.domain.tld:1d2bb89850051c86841e093831594830fbc2047606735e54c4cca84725a0237e:com|urn:email.username:0861781a154724a10627a1736f2f90f18e023b17714f5d18c5772a8916f921f3:testUsername|", + "claimPath": "contact.email", + "targetHash": "96b2603f12c0b45a94ba3b0674594d9b19373d718ae25ad2d4f3066a5f971022", + "node": [ + { + "right": "12978c8f5fd68e3216920e405d917ab393fddd1a1369dc534bef8b9942212704" + }, + { + "right": "ef43bc9a6104ef4ac466eae540774e6cab44329ac8fdfda201b0eab5859af798" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "claim-cvc:Email.domain-v1", + "value": "urn:domain.name:c53b584233e04fbedf3d6b9e4849f40384510f979f04480c0873338591dd81d1:civic|urn:domain.tld:1d2bb89850051c86841e093831594830fbc2047606735e54c4cca84725a0237e:com|", + "claimPath": "contact.email.domain", + "targetHash": "12978c8f5fd68e3216920e405d917ab393fddd1a1369dc534bef8b9942212704", + "node": [ + { + "left": "96b2603f12c0b45a94ba3b0674594d9b19373d718ae25ad2d4f3066a5f971022" + }, + { + "right": "ef43bc9a6104ef4ac466eae540774e6cab44329ac8fdfda201b0eab5859af798" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:fd13aca8b1c502230339f293fcdef79a80a39ffc41e0fabf848bcedbacb898c7:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "d6e2543e29c191e77ba26af224ff5c3a02b5a6888c5449c19867148ee3cbf8d5", + "node": [ + { + "right": "20426f5a57487ccbdc6057092d7873c837dd461fccbc35cfd34716cf0d968b86" + }, + { + "left": "0adf0a8712fe94906b9615c164031f6e167a61aeac085be39a39dd509d389bcc" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:be66c69a9954c7d0a070a831dc21a17c2579eae4693b2b51a0c0af4a97ad92a6:2019-09-16T19:22:39.987Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "20426f5a57487ccbdc6057092d7873c837dd461fccbc35cfd34716cf0d968b86", + "node": [ + { + "left": "d6e2543e29c191e77ba26af224ff5c3a02b5a6888c5449c19867148ee3cbf8d5" + }, + { + "left": "0adf0a8712fe94906b9615c164031f6e167a61aeac085be39a39dd509d389bcc" + }, + { + "right": "a83c18ddbb206fdf202cabd420431363a0e9bf6ed3bb06157373f49b9aa7d52e" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:158fe6b3ceeec81df6286384a83d9681f10f8eed276b8751bd6bf89da3e2ae74:null|", + "claimPath": "meta.expirationDate", + "targetHash": "1547a09bb989614b91838f3513d12ef21d4e4b1c9cc65acfdd0cfea49a9179a0", + "node": [ + { + "right": "cde9108c7af59362c859c90a6c4a2e9c8ae50439563ce92febf92e0361bd5d2e" + }, + { + "right": "5d386f7a95b22ca7df8b9db96bd67bc1af3de2a173d936945edbaa21134b1bac" + }, + { + "left": "f396748191fad82c8378956f6b86ff25a8d452f8073b40042f681a03e7d199e1" + }, + { + "right": "4472191599a2bb567dd7f47c03ce48f106043f28aa0588e645857733e1b733f5" + }, + { + "right": "e480fae14145c8b9c0f9d01869b3a18031b5f7dcad9d85a791211ac68bcfacbc" + } + ] + } + ] + }, + "granted": null, + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 1, + "identifier": "credential-cvc:PhoneNumber-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:PhoneNumber-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d7fe15d474a30004f93e0c0", + "id": "30754bf1-c028-4267-aef0-12b78f4a1128", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-16T19:24:13.590Z", + "identifier": "credential-cvc:PhoneNumber-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:PhoneNumber-v1" + ], + "claim": { + "contact": { + "phoneNumber": { + "country": "BR", + "countryCode": "55", + "lineType": "mobile", + "number": "31999258177" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "dd2198c6643dcad2df9379cdd5a9ad183a6ec229eedb1ed281baab51ad060022", + "anchor": { + "_id": "5d7fe167dde535004ed14240", + "subject": { + "pub": "xpub6a5Nt5cQsrk4N8oQrVkWt9L4cNALchG2U4fPkRTBGfsWj6EcW2zno7zqLFuwqo5xYbvH6xD31SFXDrudP6QePuyvMJLnuoCLjEUQEg7vwMU", + "label": "credential-cvc:PhoneNumber-v1", + "data": "dd2198c6643dcad2df9379cdd5a9ad183a6ec229eedb1ed281baab51ad060022", + "signature": "3045022100a3e2fb0a463a6144fdd3f3fa7e23bcb6621ab27251e893b0ef86a29bcce7bcbf02207386df2a0a202a5903796be9b9b1d1517335eb76c3eeaf591c052f841b2c43ed" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcGoLYtjhvZVUpfpx1pZskgkj7Q954N45mJUruxX47AxBzzwT4fgECuyS2CZyCAcLyMho4bkUjHhafoinn2BQ6o3MFteAuVkg" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "01000000016318666815bfc9b6cf884ccff2113ab9e6a655e25b6f6c67143b299f4586df9600000000fc0047304402203781e4442ed1d98020cbf5ed3c29b2980d764128771b164763be3825b0a4a02c022049bf2f682b6784fd2ea92cc9cf02c01185ea38cb573e6de5d8abebf2ddc4e0160147304402207d072970960ea849f368363538aeb5b054f4b9c45c63f66b9c2150ef766faa2b022067d21272bdce123a77b050fc103d5e16e7d2115741754a2cfa706a036e4df516014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d8210203d00b1e505c0ec983af71a680d464f7f5a3c07fb390ad3098615eec2099a0e521027aa8055bda05cd1243b071053556fb123ff665c5d28c6148f620a00934700d5953aeffffffff01551500000000000017a9146cb182f6a780180965ac84636ce152a41f2464bd8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d7fe166dde535004ed1423f", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Contact.phoneNumber-v1", + "value": "urn:phoneNumber.country:4c08b2e0523cbbd0a4e6437a532a37a2cd96ab0523a88a5b73f5b6ef62f1ff92:BR|urn:phoneNumber.countryCode:c96e6952ee202ca25a617b15c544e0c29b393a78c82eca958400918704fe67c0:55|urn:phoneNumber.lineType:d082268ea936a66f49404c9eec1aabe0a124e95f3b441f570117d987eead70ed:mobile|urn:phoneNumber.number:e77aa268de985db9de2edcfe7e1931189274b16cca682bc2eb93e2512da4099c:31999258177|", + "claimPath": "contact.phoneNumber", + "targetHash": "f47d52bc078a643fbfbc79544bfd9cc209f10ad4af6c8836bfd22d57baa9e4b8", + "node": [ + { + "right": "93b120b68865392e7bba23bdd462341ebd372766ce22c8b30c7a9e8570c36ac2" + }, + { + "right": "e4885db96e3e9c59faae93bf91f403bf036e3b5c26006e615d569d3fda61b561" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.country-v1", + "value": "urn:country:4c08b2e0523cbbd0a4e6437a532a37a2cd96ab0523a88a5b73f5b6ef62f1ff92:BR|", + "claimPath": "contact.phoneNumber.country", + "targetHash": "93b120b68865392e7bba23bdd462341ebd372766ce22c8b30c7a9e8570c36ac2", + "node": [ + { + "left": "f47d52bc078a643fbfbc79544bfd9cc209f10ad4af6c8836bfd22d57baa9e4b8" + }, + { + "right": "e4885db96e3e9c59faae93bf91f403bf036e3b5c26006e615d569d3fda61b561" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.countryCode-v1", + "value": "urn:countryCode:c96e6952ee202ca25a617b15c544e0c29b393a78c82eca958400918704fe67c0:55|", + "claimPath": "contact.phoneNumber.countryCode", + "targetHash": "e6b9b644b84735aae746c07daf9c05ce06af928899220503559020dd6bdf7c06", + "node": [ + { + "right": "44426c48cb5dbf6a631ccd999f7aa90834585673a2db587ee2a631bfa9904a27" + }, + { + "left": "11cff67c552efb1fb08b2077ee68720f309817157c52cc6eedbc6eb43e1d7586" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.lineType-v1", + "value": "urn:lineType:d082268ea936a66f49404c9eec1aabe0a124e95f3b441f570117d987eead70ed:mobile|", + "claimPath": "contact.phoneNumber.lineType", + "targetHash": "44426c48cb5dbf6a631ccd999f7aa90834585673a2db587ee2a631bfa9904a27", + "node": [ + { + "left": "e6b9b644b84735aae746c07daf9c05ce06af928899220503559020dd6bdf7c06" + }, + { + "left": "11cff67c552efb1fb08b2077ee68720f309817157c52cc6eedbc6eb43e1d7586" + }, + { + "right": "cb52b8420f19e6a6740b14052f144f985e23433f34043f4330ec859af8bc3ebf" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "claim-cvc:PhoneNumber.number-v1", + "value": "urn:number:e77aa268de985db9de2edcfe7e1931189274b16cca682bc2eb93e2512da4099c:31999258177|", + "claimPath": "contact.phoneNumber.number", + "targetHash": "ed5bae9e802da35296ec775f8135f7feab13f092bd3fdd1ae576349afc7bed24", + "node": [ + { + "right": "cfe6de4c8b6e0f5d79110b6782355de3471f434303c3d1328d73374b911df458" + }, + { + "right": "cbd1d4e09696aab5678cac1698374884a23c0a21e9e3edd4047a3c4aad88ce5c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:2fc3460a06f19f35dcb01e5f0a7fed95f4341c733a7244960455912d1efe2f2b:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "cfe6de4c8b6e0f5d79110b6782355de3471f434303c3d1328d73374b911df458", + "node": [ + { + "left": "ed5bae9e802da35296ec775f8135f7feab13f092bd3fdd1ae576349afc7bed24" + }, + { + "right": "cbd1d4e09696aab5678cac1698374884a23c0a21e9e3edd4047a3c4aad88ce5c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:b3da7419c6d0f66656f7d70f02ba8845fb5d6cac86a0eefcce4e836378f9c13c:2019-09-16T19:24:13.590Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "fc825ed18a6c964d5a5d5db03ac4e12de665c21f02007594324bf2cb4f3832c5", + "node": [ + { + "right": "b6e60a140e0f135231ed146183711c66ff42e6a3280b04acf8dabd1a74a657b2" + }, + { + "left": "2712e55da0c37f529d851119121fafefa830816b4089130d9ebd2f51d96a871c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:093932b963ffb250d766c57e8fcd18107166ae6e51776efd5e752524f393d499:null|", + "claimPath": "meta.expirationDate", + "targetHash": "b6e60a140e0f135231ed146183711c66ff42e6a3280b04acf8dabd1a74a657b2", + "node": [ + { + "left": "fc825ed18a6c964d5a5d5db03ac4e12de665c21f02007594324bf2cb4f3832c5" + }, + { + "left": "2712e55da0c37f529d851119121fafefa830816b4089130d9ebd2f51d96a871c" + }, + { + "left": "8cdcb92042b67b68dc767a813670e1f46729f72d8bb9b9e4ad6b3d706a80d03d" + }, + { + "right": "6955ec0cec50aaa5bd0162d339dd690e98680eec9c3009816ee27efdf823aff7" + }, + { + "right": "75d8cd22867f9fcc7893c089d7b22ed15399a9824a5c1e343ffda7c7abb1576e" + } + ] + } + ] + }, + "granted": null, + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 2, + "identifier": "credential-cvc:IdDocument-v2", + "constraints": { + "meta": { + "credential": "credential-cvc:IdDocument-v2", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5d9217734b0fcc004f2534b6", + "id": "0f4596c5-f8fe-4d8e-a327-04d55a2780a4", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-09-30T14:55:47.257Z", + "identifier": "credential-cvc:IdDocument-v2", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:IdDocument-v2" + ], + "claim": { + "document": { + "evidences": { + "idDocumentFront": { + "algorithm": "sha256", + "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + }, + "idDocumentBack": { + "algorithm": "sha256", + "data": "195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4" + }, + "selfie": { + "algorithm": "sha256", + "data": "0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f" + } + }, + "name": { + "familyNames": "User", + "givenNames": "Civic" + }, + "dateOfBirth": { + "day": 1, + "month": 1, + "year": 1900 + }, + "type": "passport", + "number": "9999999999", + "issueCountry": "USA", + "dateOfExpiry": { + "day": 1, + "month": 1, + "year": 1900 + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "43e6c19e5f51a17e5b8eaa07d97110b8c1ac16ceab889cd1a20b028c73e24cec", + "anchor": { + "_id": "5d92178708c60a004f1a263f", + "subject": { + "pub": "xpub6ZiqffBjkUQB1r4Sefd1oRD1tErUfeTSpcf8cfS9dH8Bt4pbF57AYw3dsMou1AL5kVEbp3pqgBseg5ftkpsfmkY3epNGWLnFHC1PyHPuq4a", + "label": "credential-cvc:IdDocument-v2", + "data": "43e6c19e5f51a17e5b8eaa07d97110b8c1ac16ceab889cd1a20b028c73e24cec", + "signature": "304402202b008e22248f798a7df7a6b22af60d9e8159ba09e957756df9f3428f12158add02204065d9d60d2da62f46425edeba36ec5ec1f73503d699257812ab6109d8ecc17e" + }, + "cosigners": [ + { + "pub": "xpub661MyMwAqRbcFML6P96tik5kQ2hZmL2p6yD72dTdh4gJafpwrWRgqEUhx1k9RjztGJ4LscYrcqYUiH6hKksbsUZrFCmpjqgZCa9sKtbyWvi" + }, + { + "pub": "xpub661MyMwAqRbcFvNcaAnUGafMUxmEfvfnJBz9ygme1GH16m79b5KAbaL8RkXx6rhXogNmeJYgf35hAY29FvYeev8z9hPtLUhsQc87KM8H7vo" + } + ], + "authority": { + "pub": "xpub661MyMwAqRbcFeLHVqQi8mo3Ck1yz7aDcWV6MTKpai7p8pw9fNstmqY3x4Te9hf3sKkD1mMqPiLjjiCvkaCLRm1zv2KBneudxJ4ZZZH4q92", + "path": "/1/0/0/0" + }, + "tx": "010000000167538569151d5ffb2093a16ed87831ccca31b2a78cf72e4be89d720d58a179f500000000fdfd0000483045022100993c50bbdfd90936425c4dc19090c5b22082be9f46598a47e1bf39ca2df5390b0220464989ad72de301b0771aa999b26b8b5a17eb042ab1c5efe1062983abed6da560147304402203ce4d95ec6d5525b9acc0ad0756ef1970a908f886b543b7bdbd5698ac371545e02203f8213b4739d60998070ff2a7c785d4c3a3ee8ab9f58879ec230ec29df1b2032014c69522102a3318eddcb8b8070798df9325208e3cb23a0a80779b9eea57dadbc07b097a5d82102d83a89b82bf0b2794eb34e03a2415bf4213fcc742f1fc99b9fc83a07176cc9ec2102eb4564aa1523caafb6759a70ce43d439369e180cb504a730d33ef1181c10c67253aeffffffff01551500000000000017a914df28e4691bb24b6494ed7cb4fbdb83f26c8d385a8700000000", + "type": "temporary", + "network": "bitcoincashTestnet", + "schema": "tbch-20180201", + "requestId": "5d92178508c60a004f1a263e", + "deletedAt": -1 + }, + "leaves": [ + { + "identifier": "claim-cvc:Document.evidences-v1", + "value": "urn:evidences.idDocumentFront.algorithm:477c2597ac9b6632ef2221a9a1f12ffbb05c470c2ab718a44aeebf5fb95d8233:sha256|urn:evidences.idDocumentFront.data:e149ca2f627c05e39ee0da3827e93ddbcdf6f321b0575d8ba190be73b20c5294:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|urn:evidences.selfie.algorithm:a697ba4c7742c134c347e7baf24ca4ff30d5493fcf99e12ceaa3c39096c299fd:sha256|urn:evidences.selfie.data:43798481814cb3b744a9245af78b07074537280ea3dc12c92379591ec7b41229:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "document.evidences", + "targetHash": "2f81e51859d6e253b3076268512cce90f63284aa14341fe5987bdb8418d0f00f", + "node": [ + { + "right": "51cb130d06d4aac9e5db8d9eeb44e0987ffea897457ca38ff9de7ac346fa12cd" + }, + { + "right": "56c9d1989a73e02fa6303e59416a5fd232ae487b2ffe84dcfe79a8669c1dc87d" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.idDocumentFront-v1", + "value": "urn:idDocumentFront.algorithm:477c2597ac9b6632ef2221a9a1f12ffbb05c470c2ab718a44aeebf5fb95d8233:sha256|urn:idDocumentFront.data:e149ca2f627c05e39ee0da3827e93ddbcdf6f321b0575d8ba190be73b20c5294:195f9bf62b1a807abe26828c13f29e443169cdc5f60b22b470bfa50eef55a5a4|", + "claimPath": "validationEvidences.idDocumentFront", + "targetHash": "51cb130d06d4aac9e5db8d9eeb44e0987ffea897457ca38ff9de7ac346fa12cd", + "node": [ + { + "left": "2f81e51859d6e253b3076268512cce90f63284aa14341fe5987bdb8418d0f00f" + }, + { + "right": "56c9d1989a73e02fa6303e59416a5fd232ae487b2ffe84dcfe79a8669c1dc87d" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Validation:evidences.selfie-v1", + "value": "urn:selfie.algorithm:a697ba4c7742c134c347e7baf24ca4ff30d5493fcf99e12ceaa3c39096c299fd:sha256|urn:selfie.data:43798481814cb3b744a9245af78b07074537280ea3dc12c92379591ec7b41229:0e06d43673ae1bb490070a54d47b731c5f9f7720426d976756e4bad1b679dd3f|", + "claimPath": "validationEvidences.selfie", + "targetHash": "fc0ef4b30106ff81e4082538f0dbe69e49355ba1ccd3b08d3d760264acd8ac83", + "node": [ + { + "right": "1fdf74342b3a68b6d247079f561c603d0ccbdaca46c620a6a64c4771579a21be" + }, + { + "left": "47c8457f5e1b791c97054517c654dbbd373128a950f502e925bf599ef8535d26" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.name-v1", + "value": "urn:name.familyNames:fa1e9472cde0f2ba6cfdeca47fffe50b212f547df00d343596125fe4ada4a008:User|urn:name.givenNames:65d8fd0c08f6c72a7292132c8e26df234f7c5f44cfd904906a938246236753f2:Civic|", + "claimPath": "document.name", + "targetHash": "1fdf74342b3a68b6d247079f561c603d0ccbdaca46c620a6a64c4771579a21be", + "node": [ + { + "left": "fc0ef4b30106ff81e4082538f0dbe69e49355ba1ccd3b08d3d760264acd8ac83" + }, + { + "left": "47c8457f5e1b791c97054517c654dbbd373128a950f502e925bf599ef8535d26" + }, + { + "right": "f992a7f4bb9efd66ec33fa60e6b20049ce7743e49bbcc9abe139a2a5e90b7124" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Name.familyNames-v1", + "value": "urn:familyNames:fa1e9472cde0f2ba6cfdeca47fffe50b212f547df00d343596125fe4ada4a008:User|", + "claimPath": "document.name.familyNames", + "targetHash": "d62c86e0007cf53d6e820a74687b869c02584043a9fa75cf6b19e473d37de68d", + "node": [ + { + "right": "ecd077f681982ba1f0ae061758ee78fd830da6cc7d610bda81dcdc120e6ef204" + }, + { + "right": "863d694e390119101ad0fbf34fc09f7acb9a0198e13459e363d4fd9ce300f113" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Name.givenNames-v1", + "value": "urn:givenNames:65d8fd0c08f6c72a7292132c8e26df234f7c5f44cfd904906a938246236753f2:Civic|", + "claimPath": "document.name.givenNames", + "targetHash": "ecd077f681982ba1f0ae061758ee78fd830da6cc7d610bda81dcdc120e6ef204", + "node": [ + { + "left": "d62c86e0007cf53d6e820a74687b869c02584043a9fa75cf6b19e473d37de68d" + }, + { + "right": "863d694e390119101ad0fbf34fc09f7acb9a0198e13459e363d4fd9ce300f113" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfBirth-v1", + "value": "urn:dateOfBirth.day:491bc05c36d14b0c627584e0598600834b73284b306c19b961170d304f071bdd:1|urn:dateOfBirth.month:6acf13278b268aca87a19d41feb53578e61ad7cf3df284cff9e59321f152d315:1|urn:dateOfBirth.year:f880da1b53efe028139255b70745dd862674cb8997aee97c5bc9096c2e947529:1900|", + "claimPath": "document.dateOfBirth", + "targetHash": "05a66bd72b4dedbf38ac5359d2b9c001215eb6e60caa75aa43ec8f35d5bd7aae", + "node": [ + { + "right": "478f2da92960cf16c138362cf57e4de5f28047ed02f84459138eedcd259ee02b" + }, + { + "left": "31825a4504399c984e2cab97223e4819b5d62655f6734a31ea8da99cfe26694f" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.type-v1", + "value": "urn:type:01e5e814015d0897e6eea9c33b54e6c425629030d478138148af9435bfe28a10:passport|", + "claimPath": "document.type", + "targetHash": "478f2da92960cf16c138362cf57e4de5f28047ed02f84459138eedcd259ee02b", + "node": [ + { + "left": "05a66bd72b4dedbf38ac5359d2b9c001215eb6e60caa75aa43ec8f35d5bd7aae" + }, + { + "left": "31825a4504399c984e2cab97223e4819b5d62655f6734a31ea8da99cfe26694f" + }, + { + "left": "bf02a341610e1ef0dc1ebb4a6061a4cff6886b3f0403504da9f35f66f4ed28cd" + }, + { + "right": "6059015024ec9cc444bd4d9d24c0990829a40b6533e73995b4beed4c5e92cd91" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.number-v1", + "value": "urn:number:d02644ef31758bd7a2cd49088503c9ac2732b1163eb1e3cf81e5c5d69f1e6dd9:9999999999|", + "claimPath": "document.number", + "targetHash": "a99ccb2c7b8f31a640c901ae7b1000fc355767f9279ac04cd54eaf7d6c060a2e", + "node": [ + { + "right": "e747e4f51e61d03719867d3de171a7b5fdc939cf406c7f98827009e538fa37c9" + }, + { + "right": "4d8bf603d9860f264a101e0a680c8e4f10cb5e2d07c88f2fee5f0f14175061db" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.issueCountry-v1", + "value": "urn:issueCountry:36681fd74135877629bf303a441d6bef20e7a14184be9587696fdcd4b77989cd:US|", + "claimPath": "document.issueCountry", + "targetHash": "e747e4f51e61d03719867d3de171a7b5fdc939cf406c7f98827009e538fa37c9", + "node": [ + { + "left": "a99ccb2c7b8f31a640c901ae7b1000fc355767f9279ac04cd54eaf7d6c060a2e" + }, + { + "right": "4d8bf603d9860f264a101e0a680c8e4f10cb5e2d07c88f2fee5f0f14175061db" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "claim-cvc:Document.dateOfExpiry-v1", + "value": "urn:dateOfExpiry.day:4c29f28013a396e66344463b467140b6877e83f4b02230c8fb8fcedae8c2e447:1|urn:dateOfExpiry.month:2e17b27306b77403e1e5e3fbb6a75b2c8fc0fb392bda5428c39da8428e4167d7:1|urn:dateOfExpiry.year:a82b90109a542970fc11e0eca25b7c10737a9a3f164fc7446246751ad991d874:1900|", + "claimPath": "document.dateOfExpiry", + "targetHash": "58fc0deaed11ced47c0c613751dc93f151aa8741b61d81ac56b4b288a9e63fb2", + "node": [ + { + "right": "338a6d506e9a148e1ef236c0efd54693f2b136c34876c0fe8667cdc71673c8b9" + }, + { + "left": "42025bbe623da1b524248ec92f98cb1aa7411019a1db97e4a3352845ac041fe1" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:b4976a48c36ab75d3f03ba9210f0fd698b8b381eeff6f0e32a9ddc4d2c8cd202:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "338a6d506e9a148e1ef236c0efd54693f2b136c34876c0fe8667cdc71673c8b9", + "node": [ + { + "left": "58fc0deaed11ced47c0c613751dc93f151aa8741b61d81ac56b4b288a9e63fb2" + }, + { + "left": "42025bbe623da1b524248ec92f98cb1aa7411019a1db97e4a3352845ac041fe1" + }, + { + "right": "98617f1dbb43be7dccef4e31caf0089d9217625aefff6d9a0b97ac67fb42608e" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:e065fe133ef5862b5aba1166ae662c2764a3259ee8f115c6c1da24f4a4dcfd35:2019-09-30T14:55:47.257Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "4ad5082d0e7be26af1797b557288a39bb95f26df749d76dd912a248cd21ca299", + "node": [ + { + "right": "707413a7d33e9540bf934e15c602c429e1700b4a4815210792f9217d2e601d65" + }, + { + "right": "85e69c5d972065395c753358013373aa37763ddda58d38824988436b044f23d3" + }, + { + "left": "459d18e39685548595d5350b557d3d94607b1aa3284236278d43c6734e215292" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:1410f6739fc58230a3ff61861e09b9aab4585801359d966e9c19aba7b4ba541d:null|", + "claimPath": "meta.expirationDate", + "targetHash": "707413a7d33e9540bf934e15c602c429e1700b4a4815210792f9217d2e601d65", + "node": [ + { + "left": "4ad5082d0e7be26af1797b557288a39bb95f26df749d76dd912a248cd21ca299" + }, + { + "right": "85e69c5d972065395c753358013373aa37763ddda58d38824988436b044f23d3" + }, + { + "left": "459d18e39685548595d5350b557d3d94607b1aa3284236278d43c6734e215292" + }, + { + "left": "a5d3b988dae527355a8ec1dff11ce9e96224cb8806bf014b1c45f17df162719b" + }, + { + "right": "75045db606befb71ea97cc4850b092127f69e22c52b7d10e53f3b625312174de" + } + ] + } + ] + }, + "granted": "3045022100844dce9c5d719755cd4721598f060e49b2977ac244cd5b6dac604ef4c3beea1302206164f0f985d9a916290c5aa33b2167a24ae6aac3ec39409ad23113680b895da6", + "user_id": "03bf176a6a4e4841ec348a8007e655e2e746806576048fc1fe4ff2e8bc6351ecc2", + "createdAt": "2019-09-30T14:53:47.809Z", + "updatedAt": "2019-09-30T14:56:05.927Z", + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 3, + "identifier": "credential-cvc:UnverifiedSsn-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedSsn-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5db42a6dc3c3860061cf87fb", + "id": "b3a4af17-a881-4bbd-b52e-61f63f84a77e", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-10-26T11:13:49.288Z", + "identifier": "credential-cvc:UnverifiedSsn-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:UnverifiedSsn-v1" + ], + "transient": true, + "claim": { + "socialSecurity": { + "number": { + "areaNumber": "000", + "groupNumber": "41", + "serialNumber": "4511" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "982c1e56e29e794c67fda2d1c85e81b18d9de068e2bfc46e3734fa2b81e6cabd", + "anchor": { + "type": "transient", + "subject": { + "label": "credential-cvc:UnverifiedSsn-v1", + "data": "982c1e56e29e794c67fda2d1c85e81b18d9de068e2bfc46e3734fa2b81e6cabd" + } + }, + "leaves": [ + { + "identifier": "claim-cvc:SocialSecurity.number-v1", + "value": "urn:number.areaNumber:67e414e493e4d5ab594d3d6aff068b6b7bb9019787415e28dd99e68a9c2eb360:000|urn:number.groupNumber:e539eedd02baa7366601ed462df4976ff7d131584f4b44d4554380bcee0be517:41|urn:number.serialNumber:a5efe7d520317f977a7dae2e6dfcbdc7fba926551c7474cfd540a9af52163514:4511|", + "claimPath": "socialSecurity.number", + "targetHash": "8e78be7fc923c1c112ed1017a53833942d5bf7b3601d7f1003450f92af07034a", + "node": [ + { + "right": "b3e2b3be053bc58ead319fa416719b062436c6fc44dd867f4e2792084b8fb4d3" + }, + { + "right": "e896ae2b5bea11c63c34e944a0f0e707e3ba45fd76e3f096bc27b089e4e84dc6" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:SocialSecurity:serialNumber", + "value": "urn:serialNumber:a5efe7d520317f977a7dae2e6dfcbdc7fba926551c7474cfd540a9af52163514:4511|", + "claimPath": "socialSecurity.serialNumber", + "targetHash": "b3e2b3be053bc58ead319fa416719b062436c6fc44dd867f4e2792084b8fb4d3", + "node": [ + { + "left": "8e78be7fc923c1c112ed1017a53833942d5bf7b3601d7f1003450f92af07034a" + }, + { + "right": "e896ae2b5bea11c63c34e944a0f0e707e3ba45fd76e3f096bc27b089e4e84dc6" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:ac7df526505e716e1ef75ffcfc544840c8dc56f09f1f460d91c2c27971ac4872:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "fb8e45de8ed6be64548731dc3eea94f70192698b375564ea46b489558c274fa4", + "node": [ + { + "right": "5faa249552a2415d0b800067cf076787f8a08879c1b1d357105f19d1eff997f9" + }, + { + "left": "d1fefb64084a4f389514725866588ce9c1ebbd835fddef41b50e5c3f9fe19585" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:943fa3e0d76aed29dd44fcbf874b1148351664551c15b8700998eaf2c6502f56:2019-10-26T11:13:49.288Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "5faa249552a2415d0b800067cf076787f8a08879c1b1d357105f19d1eff997f9", + "node": [ + { + "left": "fb8e45de8ed6be64548731dc3eea94f70192698b375564ea46b489558c274fa4" + }, + { + "left": "d1fefb64084a4f389514725866588ce9c1ebbd835fddef41b50e5c3f9fe19585" + }, + { + "right": "b3d95b92745de85f07afd119ab1d6b314cd9f46366fb47ea61709bf68903c1cb" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:092d7db5e7b9a5a0a75e6576c5d766c212ae1650ab4da0d8c6787736d4c38a11:null|", + "claimPath": "meta.expirationDate", + "targetHash": "997d24328b8c5d78ca532a4534b73fb32bea4a6105a60f27994d7d994dacd743", + "node": [ + { + "right": "e25e98cd2dac504fb1ae855619e9c8fe6d5324c884091097273fe3b36beea2c5" + }, + { + "right": "f06e60ee6a098705d70d235cf7e809ae43f2419f66667c3ffc1ae66b40be801e" + }, + { + "left": "3b0bd73e5eb0b7784117d761689efe836e243e036e83fd606180946987af48b7" + }, + { + "right": "6c1e13d0b7b4b9ddd3a8de57cd7f9c1a122df26e8ce0400a10f0b5aa1db9ba94" + }, + { + "right": "881bc8d789238af784f8a103562aeea9b20eec7976b4d96022177cdba55c3953" + } + ] + } + ] + }, + "granted": "3045022100b0321713c5dc1b28e29e5b23d6b39679e56c704c54bd1126b8785ba4b0bf279602203cfde4dcc59beed93dd960d733e3a44e869fcbcb88f2a4ff2d719bead1bc89a9", + "deletedAt": -1 + } + }, + { + "credentialItemRequest": { + "requestIndex": 4, + "identifier": "credential-cvc:UnverifiedAddress-v1", + "constraints": { + "meta": { + "credential": "credential-cvc:UnverifiedAddress-v1", + "issuer": { + "is": { + "$eq": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a" + } + } + } + } + }, + "credential": { + "_id": "5db36061c3c3860061cf87fa", + "id": "eb883d4d-6517-4c8e-a363-62f3a7212b1c", + "issuer": "did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a", + "issuanceDate": "2019-10-25T20:51:45.594Z", + "identifier": "credential-cvc:UnverifiedAddress-v1", + "expirationDate": null, + "version": "1", + "type": [ + "Credential", + "credential-cvc:UnverifiedAddress-v1" + ], + "transient": true, + "claim": { + "identity": { + "address": { + "city": "San Francisco", + "country": "US", + "postalCode": "94105", + "state": "CA", + "street": "1 Market St", + "unit": "Suite 402" + } + } + }, + "proof": { + "type": "CvcMerkleProof2018", + "merkleRoot": "9b2cf585902aa7be0a4626d35de3d0c7946f4c8b5a04875d277a5d56a9fedea6", + "anchor": { + "type": "transient", + "subject": { + "label": "credential-cvc:UnverifiedAddress-v1", + "data": "9b2cf585902aa7be0a4626d35de3d0c7946f4c8b5a04875d277a5d56a9fedea6" + } + }, + "leaves": [ + { + "identifier": "claim-cvc:Identity.address-v1", + "value": "urn:address.city:4a1aef770beb9d75bf2277a67940323a1a6d0dc66f2a4a17ebc7c8310a2335fd:San Francisco|urn:address.country:9c235472dd4adcdec5d0c1eea933cd40f9212758d63b8428374189dd020f097f:US|urn:address.postalCode:d993b2d60f3bf84386e7578ba6e18956b9f5173cdb9ccb35759d8115cee1846a:94105|urn:address.state:abda4f643bcd7faf6c7504d1922496ad3a342d3f8b071e7c1b761febd9bcd439:CA|urn:address.street:1e702358cc90498afb4aa34f6d92735de51b422b3e28bfb5876570a51c41a076:1 Market St|urn:address.unit:f4d67864782bb80160cc962c1bdadb725533a75bcbc17d5e463c72fd56116e3c:Suite 402|", + "claimPath": "identity.address", + "targetHash": "400bb853b60627639c00209800a3c53fadb159690af2672c3442e246d93f0ee5", + "node": [ + { + "right": "084ffb3a48749e91e0f707203ae864a1685c82899bf6334fcba3e886c83cb3a5" + }, + { + "right": "aeb779b3b6da1ce39ba382e1a3ddd2cb390fccbe63b6c0735b83df14941f71f2" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.city-v1", + "value": "urn:city:4a1aef770beb9d75bf2277a67940323a1a6d0dc66f2a4a17ebc7c8310a2335fd:San Francisco|", + "claimPath": "identity.address.city", + "targetHash": "084ffb3a48749e91e0f707203ae864a1685c82899bf6334fcba3e886c83cb3a5", + "node": [ + { + "left": "400bb853b60627639c00209800a3c53fadb159690af2672c3442e246d93f0ee5" + }, + { + "right": "aeb779b3b6da1ce39ba382e1a3ddd2cb390fccbe63b6c0735b83df14941f71f2" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.country-v1", + "value": "urn:country:9c235472dd4adcdec5d0c1eea933cd40f9212758d63b8428374189dd020f097f:US|", + "claimPath": "identity.address.country", + "targetHash": "b916a66c9648a21d04e4b52b2a5fe6c1f526dcbd6c3cf50245a545e6b68cc7e1", + "node": [ + { + "right": "6bfcd383735560954df32d065362c45d4f57522d0b66fa9d496c457f5ba8a20d" + }, + { + "left": "a1b1bd4692f0c0428a7cda3f7753b823ba6988a6e731285959333e770d9d3fcc" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.postalCode-v1", + "value": "urn:postalCode:d993b2d60f3bf84386e7578ba6e18956b9f5173cdb9ccb35759d8115cee1846a:94105|", + "claimPath": "identity.address.postalCode", + "targetHash": "6bfcd383735560954df32d065362c45d4f57522d0b66fa9d496c457f5ba8a20d", + "node": [ + { + "left": "b916a66c9648a21d04e4b52b2a5fe6c1f526dcbd6c3cf50245a545e6b68cc7e1" + }, + { + "left": "a1b1bd4692f0c0428a7cda3f7753b823ba6988a6e731285959333e770d9d3fcc" + }, + { + "right": "a56ca726fa06dac9a44247675b6a76d21fa3edfda4d26faa46d98cc5597e8298" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.state-v1", + "value": "urn:state:abda4f643bcd7faf6c7504d1922496ad3a342d3f8b071e7c1b761febd9bcd439:CA|", + "claimPath": "identity.address.state", + "targetHash": "f3489be173669853b46667382f4b1dc6b24b08e5a686963cd1112765cacf61df", + "node": [ + { + "right": "0cbdf2be4546beff0c47d48bbe60b7168272b718bc9bf9b4cf8bd314baa14a7a" + }, + { + "right": "2766510eba1d30efc87e5bfad0157aabc612d86af805b052fd3cf5a4df1d9d34" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.street-v1", + "value": "urn:street:1e702358cc90498afb4aa34f6d92735de51b422b3e28bfb5876570a51c41a076:1 Market St|", + "claimPath": "identity.address.street", + "targetHash": "0cbdf2be4546beff0c47d48bbe60b7168272b718bc9bf9b4cf8bd314baa14a7a", + "node": [ + { + "left": "f3489be173669853b46667382f4b1dc6b24b08e5a686963cd1112765cacf61df" + }, + { + "right": "2766510eba1d30efc87e5bfad0157aabc612d86af805b052fd3cf5a4df1d9d34" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "claim-cvc:Address.unit-v1", + "value": "urn:unit:f4d67864782bb80160cc962c1bdadb725533a75bcbc17d5e463c72fd56116e3c:Suite 402|", + "claimPath": "identity.address.unit", + "targetHash": "8efb609c942a8b19d7801fdd2b3d15b1850f2936f82990bd2e6647ce76259a37", + "node": [ + { + "right": "6e37058c587c6fbbf7c416043f63d6afe5af57199882a80e2a252d939be74364" + }, + { + "left": "b3b52375270472380a73f9b34615d0d2354d431ca4f9eb4661b7dcf40665a10c" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "cvc:Meta:issuer", + "value": "urn:issuer:5bf22e14d0040fd201cfaccf463b2d5323fab4c71da742dd82d38b4eb4cb7674:did:ethr:0x1a88a35421a4a0d3e13fe4e8ebcf18e9a249dc5a|", + "claimPath": "meta.issuer", + "targetHash": "6e37058c587c6fbbf7c416043f63d6afe5af57199882a80e2a252d939be74364", + "node": [ + { + "left": "8efb609c942a8b19d7801fdd2b3d15b1850f2936f82990bd2e6647ce76259a37" + }, + { + "left": "b3b52375270472380a73f9b34615d0d2354d431ca4f9eb4661b7dcf40665a10c" + }, + { + "left": "81f97b9602d543d3e124479194b4b9eb45787275d17e5d28372125f40100fe30" + }, + { + "right": "6ffce1957d30dd493854a2c8da0ee311f28710a5a347e4c623d890627373d69a" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "cvc:Meta:issuanceDate", + "value": "urn:issuanceDate:8ea37c0f6310f4a9f7500a59de8989052066413ec40b612e27757ccfee33a4f1:2019-10-25T20:51:45.594Z|", + "claimPath": "meta.issuanceDate", + "targetHash": "d146a567ad28a831ebecc71b179360bb650a3ead83ec105c4b15a3acf1f06491", + "node": [ + { + "right": "d40b97d413be0ce7a12b2b1b795f8f01aa06e55fae389b1d1addd1b30bcd7e36" + }, + { + "right": "0e6dc0dee5b6d217472bc55b1766950d3e16371b4a393ec546419c83c5d8dc5b" + }, + { + "right": "269a7fe0e07c130626e072b207d3657dfa1039ed4f4f8b328b77b3c8179b9835" + }, + { + "left": "eeb18b12d05c9881ea4428a6ac80197e02967ceb0fb75a9577575ee87565cb4c" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + }, + { + "identifier": "cvc:Meta:expirationDate", + "value": "urn:expirationDate:7c82eb965bb6fe0af75a8ddfe93209efc6aee8209aefd93191e5d084f1e6748f:null|", + "claimPath": "meta.expirationDate", + "targetHash": "d40b97d413be0ce7a12b2b1b795f8f01aa06e55fae389b1d1addd1b30bcd7e36", + "node": [ + { + "left": "d146a567ad28a831ebecc71b179360bb650a3ead83ec105c4b15a3acf1f06491" + }, + { + "right": "0e6dc0dee5b6d217472bc55b1766950d3e16371b4a393ec546419c83c5d8dc5b" + }, + { + "right": "269a7fe0e07c130626e072b207d3657dfa1039ed4f4f8b328b77b3c8179b9835" + }, + { + "left": "eeb18b12d05c9881ea4428a6ac80197e02967ceb0fb75a9577575ee87565cb4c" + }, + { + "right": "f6cb2184e9430a6d5a45d1eba5d84bc6784f99e56faebe2fb569f1aed449b31b" + } + ] + } + ] + }, + "granted": "3045022100c065e1e404e05a508b0d9b16d0eeb6a7c1a70c6beecd4b02971963c116b5775302205d6b1e29e9c1b4eb31ad8d346ac224c1f29ffa81f61e263f4d00038137be2b2b", + "deletedAt": -1 + }, + "requestStatus": [], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060" + } + ], + "requestStatus": [], + "userId": "6e38a9572647f9ce2040caf901d844de97b32d0fcc4c1c340bd462e3556fb060" +} diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index c174c95..dca5edb 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -13,7 +13,7 @@ import idDocumentCredential from './fixtures/idDocumentCredential.json'; import idDocumentEvidence from './fixtures/idDocumentSelfieEvidence.json'; describe('Index', () => { - it('should perform a validation on every operation with a secure redundant presentation manager', async (done) => { + it('should perform a validation on every operation with a secure redundant presentation manager', async () => { const artifacts = { presentations: [ phoneNumberCredential, @@ -65,10 +65,10 @@ describe('Index', () => { const claimValue = await secureRedundantManager.getClaimValue(claims[0]); expect(claimValue).toBeDefined(); - done(); + }); - it('should perform a validation on every READ operation with a secure fast ingest manager', async (done) => { + it('should perform a validation on every READ operation with a secure fast ingest manager', async () => { const artifacts = { presentations: [ phoneNumberCredential, @@ -124,10 +124,10 @@ describe('Index', () => { const claimValue = await secureFastIngestManager.getClaimValue(claims[0]); expect(claimValue).toBeDefined(); - done(); + }); - it('should perform a validation on every ADD operation with a secure fast read manager', async (done) => { + it('should perform a validation on every ADD operation with a secure fast read manager', async () => { const artifacts = { presentations: [ phoneNumberCredential, @@ -180,10 +180,10 @@ describe('Index', () => { const claimValue = await secureFastReadManager.getClaimValue(claims[0]); expect(claimValue).toBeDefined(); - done(); + }); - it('should skip validation for all ADD or GET operations with an insecure manager', async (done) => { + it('should skip validation for all ADD or GET operations with an insecure manager', async () => { const artifacts = { presentations: [ phoneNumberCredential, @@ -240,6 +240,6 @@ describe('Index', () => { const claimValue = await insecureManager.getClaimValue(claims[0]); expect(claimValue).toBeDefined(); - done(); + }); }); diff --git a/src/types.d.ts b/src/types.d.ts index a023973..f6a3eee 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -1,2 +1,4 @@ declare module '@identity.com/credential-commons/src'; +declare module '@identity.com/dsr'; declare module 'crypto'; +declare module 'ramda'; diff --git a/tslint.json b/tslint.json index a1559c7..764ee75 100644 --- a/tslint.json +++ b/tslint.json @@ -4,6 +4,7 @@ "object-literal-sort-keys": false, "interface-name": false, "member-access": [true, "no-public"], - "ordered-imports": false + "ordered-imports": false, + "resolveJsonModule": true } }