@@ -3,6 +3,7 @@ import {AGE_OVER_18_ATTESTATION, EHIC_ATTESTATION, MDL_ATTESTATION, PDA1_ATTESTA
33import { AttestationFormat } from "@core/models/attestation/AttestationFormat" ;
44import { AttestationType } from "@core/models/attestation/AttestationType" ;
55import { DataElement } from "@core/models/attestation/AttestationDefinition" ;
6+ import { ClaimsQuery } from "../models/dcql/DCQL" ;
67
78export const SUPPORTED_FORMATS : AttestationFormat [ ] = [
89 AttestationFormat . MSO_MDOC ,
@@ -16,7 +17,7 @@ export const MDL_MSO_MDOC: MsoMdocAttestation = {
1617 doctype : 'org.iso.18013.5.1.mDL' ,
1718 namespace : 'org.iso.18013.5.1' ,
1819 attributePath : ( attribute : DataElement ) => { return msoMdocAttributePath ( attribute , 'org.iso.18013.5.1' ) } ,
19- claimPath : ( attribute : DataElement ) => { return { namespace : 'org.iso.18013.5.1' , claim_name : attribute . identifier } }
20+ claimQuery : ( attribute : DataElement ) => { return msoMdocClaimQuery ( 'org.iso.18013.5.1' , attribute . identifier ) }
2021}
2122
2223/*---- PID ATTESTATION INSTANCES PER FORMAT ----*/
@@ -26,14 +27,14 @@ export const PID_MSO_MDOC: MsoMdocAttestation = {
2627 doctype : 'eu.europa.ec.eudi.pid.1' ,
2728 namespace : 'eu.europa.ec.eudi.pid.1' ,
2829 attributePath : ( attribute : DataElement ) => { return msoMdocAttributePath ( attribute , 'eu.europa.ec.eudi.pid.1' ) } ,
29- claimPath : ( attribute : DataElement ) => { return { namespace : 'eu.europa.ec.eudi.pid.1' , claim_name : attribute . identifier } }
30+ claimQuery : ( attribute : DataElement ) => { return msoMdocClaimQuery ( 'eu.europa.ec.eudi.pid.1' , attribute . identifier ) }
3031}
3132export const PID_SD_JWT_VC : SdJwtVcAttestation = {
3233 format : AttestationFormat . SD_JWT_VC ,
3334 vct : "urn:eu.europa.ec.eudi:pid:1" ,
3435 attestationDef : PID_ATTESTATION ,
3536 attributePath : ( attribute : DataElement ) => { return `$.${ sdJwtVcAttributePath ( attribute , AttestationType . PID ) } ` } ,
36- claimPath : ( attribute : DataElement ) => { return { path : sdJwtVcAttributePath ( attribute , AttestationType . PID ) . split ( '.' ) } }
37+ claimQuery : ( attribute : DataElement ) => { return { path : sdJwtVcAttributePath ( attribute , AttestationType . PID ) . split ( '.' ) } }
3738}
3839
3940/*---- AGE OVER 18 ATTESTATION INSTANCES PER FORMAT ----*/
@@ -43,7 +44,7 @@ export const AGE_OVER_18_MSO_MDOC: MsoMdocAttestation = {
4344 doctype : 'eu.europa.ec.eudi.pseudonym.age_over_18.1' ,
4445 namespace : 'eu.europa.ec.eudi.pseudonym.age_over_18.1' ,
4546 attributePath : ( attribute : DataElement ) => { return msoMdocAttributePath ( attribute , 'eu.europa.ec.eudi.pseudonym.age_over_18.1' ) } ,
46- claimPath : ( attribute : DataElement ) => { return { namespace : 'eu.europa.ec.eudi.pseudonym.age_over_18.1' , claim_name : attribute . identifier } }
47+ claimQuery : ( attribute : DataElement ) => { return msoMdocClaimQuery ( 'eu.europa.ec.eudi.pseudonym.age_over_18.1' , attribute . identifier ) }
4748}
4849
4950/*---- PHOTO ID ATTESTATION INSTANCES PER FORMAT ----*/
@@ -53,7 +54,7 @@ export const PHOTO_ID_MSO_MDOC: MsoMdocAttestation = {
5354 doctype : 'org.iso.23220.2.photoid.1' ,
5455 namespace : 'org.iso.23220.photoid.1' ,
5556 attributePath : ( attribute : DataElement ) => { return msoMdocAttributePath ( attribute , 'org.iso.23220.photoid.1' ) } ,
56- claimPath : ( attribute : DataElement ) => { return { namespace : 'org.iso.23220.photoid.1' , claim_name : attribute . identifier } }
57+ claimQuery : ( attribute : DataElement ) => { return msoMdocClaimQuery ( 'org.iso.23220.photoid.1' , attribute . identifier ) }
5758}
5859
5960/*---- EHIC INSTANCES PER FORMAT ----*/
@@ -107,6 +108,10 @@ function sdJwtVcAttributePath(attribute: DataElement, attestationType: Attestati
107108 return resolvedAttribute ;
108109}
109110
111+ function msoMdocClaimQuery ( namespace : string , claimName : string ) : ClaimsQuery {
112+ return { path : [ namespace , claimName ] , intent_to_retain : false }
113+ }
114+
110115export const PID_SD_JWT_VC_ATTRIBUTE_MAP : { [ id : string ] : string } = {
111116 "birth_date" : "birthdate" ,
112117 "age_over_18" : "age_equal_or_over.18" ,
0 commit comments