diff --git a/data/presentation_definition_alliance_and_education_Id.json b/data/presentation_definition_alliance_and_education_Id.json new file mode 100644 index 0000000..06ef615 --- /dev/null +++ b/data/presentation_definition_alliance_and_education_Id.json @@ -0,0 +1,75 @@ +{ + "id": "multi-credential-request", + "name": "Multi-Credential Request", + "format": { + "jwt_vc": { + "alg": ["ES256", "ES384"] + } + }, + "input_descriptors": [ + { + "id": "alliance-id-credential", + "name": "Alliance ID Credential", + "format": { + "jwt_vc": { + "alg": ["ES256", "ES384"] + } + }, + "constraints": { + "fields": [ + { + "path": ["$.credentialSubject.identifier.id", "$.vc.credentialSubject.identifier.id"], + "purpose": "We need to verify your Alliance ID credential." + } + ] + }, + "limit_disclosure": "required" + }, + { + "id": "educational-id-credential", + "name": "Educational ID Credential", + "format": { + "jwt_vc": { + "alg": ["ES256", "ES384"] + } + }, + "constraints": { + "fields": [ + { + "path": ["$.credentialSubject.schacPersonalUniqueID", "$.vc.credentialSubject.schacPersonalUniqueID"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.schacHomeOrganization", "$.vc.credentialSubject.schacHomeOrganization"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.familyName", "$.vc.credentialSubject.familyName"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.firstName", "$.vc.credentialSubject.firstName"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.dateOfBirth", "$.vc.credentialSubject.dateOfBirth"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.eduPersonPrincipalName", "$.vc.credentialSubject.eduPersonPrincipalName"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.eduPersonPrimaryAffiliation", "$.vc.credentialSubject.eduPersonPrimaryAffiliation"], + "purpose": "We need to verify your Educational ID credential." + }, + { + "path": ["$.credentialSubject.eduPersonAffiliation", "$.vc.credentialSubject.eduPersonAffiliation"], + "purpose": "We need to verify your Educational ID credential." + } + ] + }, + "limit_disclosure": "required" + } + ] +} diff --git a/routes/verifierRoutes.js b/routes/verifierRoutes.js index 29afbf0..ac9eac9 100644 --- a/routes/verifierRoutes.js +++ b/routes/verifierRoutes.js @@ -48,6 +48,13 @@ const presentation_definition_ferryboardingpass = JSON.parse( "utf-8" ) ); + +const presentation_definition_alliance_and_education_Id = JSON.parse( + fs.readFileSync( + "./data/presentation_definition_alliance_and_education_Id.json", + "utf-8" + ) +); // const jwks = pemToJWK(publicKeyPem, "public"); @@ -273,6 +280,8 @@ verifierRouter.get("/vpRequest/:type/:id", async (req, res) => { presentationDefinition = presentation_definition_alliance_id; } else if (type === "ferryboardingpass") { presentationDefinition = presentation_definition_ferryboardingpass; + } else if (type === "erua-id") { + presentationDefinition = presentation_definition_alliance_and_education_Id; } else { return res.status(400).type("text/plain").send("Invalid type parameter"); }