diff --git a/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwt.ts b/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwt.ts index 921f895..aef07c5 100644 --- a/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwt.ts +++ b/wallet-enterprise-configurations/ehic-issuer/src/configuration/SupportedCredentialsConfiguration/EHICSupportedCredentialSdJwt.ts @@ -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"], @@ -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": { diff --git a/wallet-enterprise-configurations/pda1-issuer/src/configuration/SupportedCredentialsConfiguration/PDA1SupportedCredentialSdJwt.ts b/wallet-enterprise-configurations/pda1-issuer/src/configuration/SupportedCredentialsConfiguration/PDA1SupportedCredentialSdJwt.ts index 6e1f31c..57137cf 100644 --- a/wallet-enterprise-configurations/pda1-issuer/src/configuration/SupportedCredentialsConfiguration/PDA1SupportedCredentialSdJwt.ts +++ b/wallet-enterprise-configurations/pda1-issuer/src/configuration/SupportedCredentialsConfiguration/PDA1SupportedCredentialSdJwt.ts @@ -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": { diff --git a/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwt.ts b/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwt.ts index 5ce6ec7..0301858 100644 --- a/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwt.ts +++ b/wallet-enterprise-configurations/vid-issuer/src/configuration/SupportedCredentialsConfiguration/VIDSupportedCredentialSdJwt.ts @@ -71,9 +71,10 @@ 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(), @@ -81,11 +82,11 @@ export class VIDSupportedCredentialSdJwt implements SupportedCredentialProtocol "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": {