From 9c9cc4f8dda2ee21ad20fcc0829098576892bee0 Mon Sep 17 00:00:00 2001 From: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:25:37 -0500 Subject: [PATCH] Update VDL context (#68) * Add pcr base credential * Create mandatoryPointers.json * Create selectivePointers.json * Delete tests/fixtures/pcr directory * Update credential.json * Update credential.json * Update selectivePointers.json * Update selectivePointers.json * Update 30-bbs-interop.js --- tests/30-bbs-interop.js | 2 +- tests/fixtures/license/1.1/credential.json | 36 +++++------------- .../license/1.1/selectivePointers.json | 8 ++-- tests/fixtures/license/2.0/credential.json | 37 +++++-------------- .../license/2.0/selectivePointers.json | 8 ++-- 5 files changed, 27 insertions(+), 64 deletions(-) diff --git a/tests/30-bbs-interop.js b/tests/30-bbs-interop.js index e55543c..3282915 100644 --- a/tests/30-bbs-interop.js +++ b/tests/30-bbs-interop.js @@ -53,7 +53,7 @@ const { ({disclosedCredential} = await createDisclosedVc({ selectivePointers: [ '/credentialSubject/id', - '/credentialSubject/driverLicense/issuingAuthority' + '/credentialSubject/driversLicense/document_number' ], signedCredential: issuedVc, vcHolder diff --git a/tests/fixtures/license/1.1/credential.json b/tests/fixtures/license/1.1/credential.json index a193b5f..efcab4f 100644 --- a/tests/fixtures/license/1.1/credential.json +++ b/tests/fixtures/license/1.1/credential.json @@ -1,37 +1,19 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - { - "@protected": true, - "DriverLicenseCredential": "urn:example:DriverLicenseCredential", - "DriverLicense": { - "@id": "urn:example:DriverLicense", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "documentIdentifier": "urn:example:documentIdentifier", - "dateOfBirth": "urn:example:dateOfBirth", - "expirationDate": "urn:example:expiration", - "issuingAuthority": "urn:example:issuingAuthority" - } - }, - "driverLicense": { - "@id": "urn:example:driverLicense", - "@type": "@id" - } - } + "https://w3id.org/vdl/v2" ], "id": "urn:uuid:36245ee9-9074-4b05-a777-febff2e69757", - "type": ["VerifiableCredential", "DriverLicenseCredential"], + "type": ["VerifiableCredential", "Iso18013DriversLicenseCredential"], "credentialSubject": { "id": "urn:uuid:1a0e4ef5-091f-4060-842e-18e519ab9440", - "driverLicense": { - "type": "DriverLicense", - "documentIdentifier": "T21387yc328c7y32h23f23", - "dateOfBirth": "01-01-1990", - "expirationDate": "01-01-2030", - "issuingAuthority": "VA" + "type": "LicensedDriver", + "driversLicense": { + "type": "Iso18013DriversLicense", + "document_number": "T21387yc328c7y32h23f23", + "birth_date": "01-01-1990", + "expiry_date": "01-01-2030", + "issuing_authority": "VA" } } } diff --git a/tests/fixtures/license/1.1/selectivePointers.json b/tests/fixtures/license/1.1/selectivePointers.json index 6370df6..80f5c81 100644 --- a/tests/fixtures/license/1.1/selectivePointers.json +++ b/tests/fixtures/license/1.1/selectivePointers.json @@ -1,6 +1,6 @@ [ - "/credentialSubject/driverLicense/documentIdentifier", - "/credentialSubject/driverLicense/dateOfBirth", - "/credentialSubject/driverLicense/expirationDate", - "/credentialSubject/driverLicense/issuingAuthority" + "/credentialSubject/driversLicense/document_number", + "/credentialSubject/driversLicense/birth_date", + "/credentialSubject/driversLicense/expiry_date", + "/credentialSubject/driversLicense/issuing_authority" ] diff --git a/tests/fixtures/license/2.0/credential.json b/tests/fixtures/license/2.0/credential.json index d789e19..19e5f0a 100644 --- a/tests/fixtures/license/2.0/credential.json +++ b/tests/fixtures/license/2.0/credential.json @@ -1,38 +1,19 @@ { "@context": [ "https://www.w3.org/ns/credentials/v2", - { - "@protected": true, - "DriverLicenseCredential": "urn:example:DriverLicenseCredential", - "DriverLicense": { - "@id": "urn:example:DriverLicense", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "documentIdentifier": "urn:example:documentIdentifier", - "dateOfBirth": "urn:example:dateOfBirth", - "expirationDate": "urn:example:expiration", - "issuingAuthority": "urn:example:issuingAuthority" - } - }, - "driverLicense": { - "@id": "urn:example:driverLicense", - "@type": "@id" - } - } + "https://w3id.org/vdl/v2" ], "id": "urn:uuid:36245ee9-9074-4b05-a777-febff2e69757", - "type": ["VerifiableCredential", "DriverLicenseCredential"], + "type": ["VerifiableCredential", "Iso18013DriversLicenseCredential"], "credentialSubject": { "id": "urn:uuid:1a0e4ef5-091f-4060-842e-18e519ab9440", - "driverLicense": { - "type": "DriverLicense", - "documentIdentifier": "T21387yc328c7y32h23f23", - "dateOfBirth": "01-01-1990", - "expirationDate": "01-01-2030", - "issuingAuthority": "VA" + "type": "LicensedDriver", + "driversLicense": { + "type": "Iso18013DriversLicense", + "document_number": "T21387yc328c7y32h23f23", + "birth_date": "01-01-1990", + "expiry_date": "01-01-2030", + "issuing_authority": "VA" } } } - diff --git a/tests/fixtures/license/2.0/selectivePointers.json b/tests/fixtures/license/2.0/selectivePointers.json index 6370df6..80f5c81 100644 --- a/tests/fixtures/license/2.0/selectivePointers.json +++ b/tests/fixtures/license/2.0/selectivePointers.json @@ -1,6 +1,6 @@ [ - "/credentialSubject/driverLicense/documentIdentifier", - "/credentialSubject/driverLicense/dateOfBirth", - "/credentialSubject/driverLicense/expirationDate", - "/credentialSubject/driverLicense/issuingAuthority" + "/credentialSubject/driversLicense/document_number", + "/credentialSubject/driversLicense/birth_date", + "/credentialSubject/driversLicense/expiry_date", + "/credentialSubject/driversLicense/issuing_authority" ]