From 664f59780da27758c8af6bbd3640ef7eb9b4d977 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Mon, 29 Jul 2024 16:44:22 -0400 Subject: [PATCH 1/3] horrible hack to turn biometric.data into a string to satisfy the schema --- pages/org/quotient/index.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/org/quotient/index.jsx b/pages/org/quotient/index.jsx index 0d723de..4c8da5d 100644 --- a/pages/org/quotient/index.jsx +++ b/pages/org/quotient/index.jsx @@ -99,7 +99,14 @@ const QuotientBankForm = () => { function getBiometricalData() { if (retrievedData !== null) { const credential = retrievedData.credentials.find((obj) => Object.prototype.hasOwnProperty.call(obj.credentialSubject, 'biometric')); - if (credential) return credential.credentialSubject.biometric; + + // TODO: get wallet to return a string rather than a boolean so we don't have to do this hack + const biometric = credential?.createCredentialSubject?.biometric; + + if (biometric) { + biometric.data = biometric.data?.toString(); + return biometric; + } } return null; } From 3058758033edd5a8612ac14f92bb7bacbec20e46 Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Mon, 29 Jul 2024 16:54:01 -0400 Subject: [PATCH 2/3] fix typo in previous commit --- pages/org/quotient/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/org/quotient/index.jsx b/pages/org/quotient/index.jsx index 4c8da5d..1b9dba4 100644 --- a/pages/org/quotient/index.jsx +++ b/pages/org/quotient/index.jsx @@ -101,7 +101,7 @@ const QuotientBankForm = () => { const credential = retrievedData.credentials.find((obj) => Object.prototype.hasOwnProperty.call(obj.credentialSubject, 'biometric')); // TODO: get wallet to return a string rather than a boolean so we don't have to do this hack - const biometric = credential?.createCredentialSubject?.biometric; + const biometric = credential?.credentialSubject?.biometric; if (biometric) { biometric.data = biometric.data?.toString(); From 59e13edec62c3c89ab06a6145d99163f5e90b6ee Mon Sep 17 00:00:00 2001 From: Mike Parkhill Date: Tue, 30 Jul 2024 17:27:13 -0400 Subject: [PATCH 3/3] update equinet with schema and kvack --- _credentials/equinet.js | 29 +++++++++++++++-------------- utils/issue-crendentials.js | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/_credentials/equinet.js b/_credentials/equinet.js index cab64c3..ded5622 100644 --- a/_credentials/equinet.js +++ b/_credentials/equinet.js @@ -1,27 +1,28 @@ -import { v4 as uuidv4 } from "uuid"; -import { dockUrl } from "utils/constants"; -import { validateEmail } from "utils/validation"; +import { v4 as uuidv4 } from 'uuid'; +import { dockUrl } from 'utils/constants'; +import { validateEmail } from 'utils/validation'; export function createCreditScoreCredential({ receiverDid, recipientEmail, creditScore }) { - - console.log("Creating EquiNet - Credit Score Credential for:", receiverDid); + console.log('Creating EquiNet - Credit Score Credential for:', receiverDid); const credentialPayload = { url: `${dockUrl}/credentials`, body: { anchor: false, distribute: true, + algorithm: 'bbdt16', credential: { - name: "EquiNet - Credit Score", - description: "This schema represents a Verified Credit Score Credential, issued by EquiNet. It standardizes the presentation of credit scores for reliable and efficient verification processes.", + name: 'EquiNet - Credit Score', + schema: 'https://schema.dock.io/EquiNetCreditScore-V2-1706975901761.json', + description: 'This schema represents a Verified Credit Score Credential, issued by EquiNet. It standardizes the presentation of credit scores for reliable and efficient verification processes.', type: [ - "VerifiableCredential", - "EquiNetCreditScore" + 'VerifiableCredential', + 'EquiNetCreditScore' ], issuer: { - name: "EquiNET", - description: "EquiNet is the credit bureau.", - logo: "https://img.dock.io/9f327cafda3be5f0cff0da2df44c55da", + name: 'EquiNET', + description: 'EquiNet is the credit bureau.', + logo: 'https://img.dock.io/9f327cafda3be5f0cff0da2df44c55da', id: process.env.NEXT_PUBLIC_EQUINET_ISSUER_ID }, subject: { @@ -30,10 +31,10 @@ export function createCreditScoreCredential({ receiverDid, recipientEmail, credi } } } - } + }; if (recipientEmail && recipientEmail.length > 2 && validateEmail(recipientEmail)) { - credentialPayload.recipientEmail = recipientEmail + credentialPayload.recipientEmail = recipientEmail; } return credentialPayload; diff --git a/utils/issue-crendentials.js b/utils/issue-crendentials.js index 8217ac3..4fe023e 100644 --- a/utils/issue-crendentials.js +++ b/utils/issue-crendentials.js @@ -9,7 +9,7 @@ export const issueRevokableCredential = async (credential, setRevokableCredentia let registry = null; if (isRevocable) { - const type = credentialPayload.algorithm === 'dockbbs' ? 'DockVBAccumulator2022' : 'StatusList2021Entry'; + const type = credentialPayload.algorithm === ('dockbbs' || 'bbdt16') ? 'DockVBAccumulator2022' : 'StatusList2021Entry'; registry = await getExistingRegistry(_credential.issuer.id, type); if (!registry) {