Skip to content

Commit

Permalink
passing the personal identifier value to the credential status service
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmanos committed Jun 26, 2024
1 parent 38e085a commit 0290e6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class EHICSupportedCredentialSdJwt implements SupportedCredentialProtocol
throw new Error("Cannot generate credential: personalIdentifier is missing");
}
this.dataset = JSON.parse(fs.readFileSync('/datasets/dataset.json', 'utf-8').toString()) as any
const ehicClaims = this.dataset.users.filter((user: any) => user.authentication.personalIdentifier == userSession.personalIdentifier)[0].claims;
const { claims } = this.dataset.users.filter((user: any) => user.authentication.personalIdentifier == userSession.personalIdentifier)[0];

const payload = {
"@context": ["https://www.w3.org/2018/credentials/v1"],
Expand All @@ -79,11 +79,11 @@ export class EHICSupportedCredentialSdJwt implements SupportedCredentialProtocol
"name": "EHIC ID Card", // https://www.w3.org/TR/vc-data-model-2.0/#names-and-descriptions
"description": "This credential is issued by the National EHIC ID credential issuer and it can be used for authentication purposes",
"credentialSubject": {
...ehicClaims,
...claims,
"id": holderDID,
},
"credentialStatus": {
"id": `${config.crl.url}#${(await CredentialStatusList.insert()).id}`,
"id": `${config.crl.url}#${(await CredentialStatusList.insert(claims.personalIdentifier)).id}`,
"type": "CertificateRevocationList"
},
"credentialBranding": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class PDA1SupportedCredentialSdJwt implements SupportedCredentialProtocol
"id": holderDID,
},
"credentialStatus": {
"id": `${config.crl.url}#${(await CredentialStatusList.insert()).id}`,
"id": `${config.crl.url}#${(await CredentialStatusList.insert(claims.personalIdentifier)).id}`,
"type": "CertificateRevocationList"
},
"credentialBranding": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,22 @@ export class VIDSupportedCredentialSdJwt implements SupportedCredentialProtocol
throw new Error("Cannot generate credential: Taxis id is missing");
}


this.dataset = JSON.parse(fs.readFileSync('/datasets/dataset.json', 'utf-8').toString()) as any;
const vidClaims = this.dataset.users.filter((user: any) => user.authentication.personalIdentifier == userSession.personalIdentifier)[0].claims;
console.log("Vid claims = ", vidClaims)
const { claims } = this.dataset.users.filter((user: any) => user.authentication.personalIdentifier == userSession.personalIdentifier)[0];
console.log("Vid claims = ", claims)
const payload = {
"@context": ["https://www.w3.org/2018/credentials/v1"],
"type": this.getTypes(),
"id": `urn:vid:${randomUUID()}`,
"name": "PID", // https://www.w3.org/TR/vc-data-model-2.0/#names-and-descriptions
"description": "This credential is issued by the National PID credential issuer and it can be used for authentication purposes",
"credentialSubject": {
...vidClaims,
...claims,
"id": holderDID,
},
"credentialStatus": {
"id": `${config.crl.url}#${(await CredentialStatusList.insert()).id}`,
"id": `${config.crl.url}#${(await CredentialStatusList.insert(claims.personalIdentifier)).id}`,
"type": "CertificateRevocationList"
},
"credentialBranding": {
Expand Down

0 comments on commit 0290e6a

Please sign in to comment.