Skip to content

Commit

Permalink
erua-id verification
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed May 28, 2024
1 parent d634446 commit 16b026f
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
75 changes: 75 additions & 0 deletions data/presentation_definition_alliance_and_education_Id.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
9 changes: 9 additions & 0 deletions routes/verifierRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 16b026f

Please sign in to comment.