Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added schemas to KVAC credential requests #29

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions _credentials/forsur.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
import { v4 as uuidv4 } from "uuid";
import { dockUrl } from "utils/constants";
import { v4 as uuidv4 } from 'uuid';
import { dockUrl } from 'utils/constants';
import { validateEmail } from 'utils/validation';

export function createBiometricsCredential({
receiverDid,
recipientEmail
}
) {

console.log("Creating ForSur - Biometric Enrollment Credential for:", receiverDid);
console.log('Creating ForSur - Biometric Enrollment Credential for:', receiverDid);

const credentialPayload = {
url: `${dockUrl}/credentials`,
body: {
anchor: false,
algorithm: "dockbbs",
algorithm: 'bbdt16',
distribute: true,
credential: {
schema: 'https://schema.dock.io/ForSurBiometricCheck-V4-1709846734949.json',
id: `https://creds-testnet.dock.io/${uuidv4()}`,
name: "ForSur - Biometric",
description: "The \"ForSur - Biometric\" schema is specifically developed for the secure registration and storage of biometric data.",
name: 'ForSur - Biometric',
description: 'The "ForSur - Biometric" schema is specifically developed for the secure registration and storage of biometric data.',
type: [
"VerifiableCredential",
"ForSurBiometric"
'VerifiableCredential',
'ForSurBiometric'
],
issuer: {
name: "Forsur",
description: "Forsur is the biometric provider.",
logo: "https://img.dock.io/80f154126a78bba321b413c3ffb8d4a7",
name: 'Forsur',
description: 'Forsur is the biometric provider.',
logo: 'https://img.dock.io/80f154126a78bba321b413c3ffb8d4a7',
id: process.env.NEXT_PUBLIC_FORSUR_ISSUER_ID
},
subject: {
id: receiverDid,
biometric: {
id: uuidv4(),
created: new Date().toISOString(),
data: "some biometric data",
data: 'some biometric data',
}
}
}
}
};

if (recipientEmail && recipientEmail.length > 2 && validateEmail(recipientEmail)) {
credentialPayload.recipientEmail = recipientEmail
credentialPayload.recipientEmail = recipientEmail;
}

return credentialPayload

return credentialPayload;
}
3 changes: 2 additions & 1 deletion _credentials/quotient.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ export function createBankIdCredential({
url: `${dockUrl}/credentials`,
body: {
anchor: false,
algorithm: 'dockbbs',
algorithm: 'bbdt16',
distribute: true,
credential: {
id: `https://creds-testnet.dock.io/${uuidv4()}`,
schema: 'https://schema.dock.io/QuotientBankIdentity-V4-1708715398120.json',
name: 'Quotient - Bank Identity',
description: "The \"Quotient - Bank Identity\" schema provides a secure and standardized format for representing key aspects of an individual's bank identity.",
type: [
Expand Down
Loading