Skip to content

Commit 67f815b

Browse files
authored
OpenId4VP draft24 support (#134)
* Align with draft 24 path pointers for mso_mdoc. Add intent_to_retain to mso_mdoc claim queries. * Update EHIC and PDA1 for draft 24 (#158)
1 parent c5be3bb commit 67f815b

7 files changed

Lines changed: 26 additions & 24 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_NAME=Verifier
22
DOMAIN_NAME=http://localhost:8080
3-
OPENID4VP_DRAFT=23
3+
OPENID4VP_DRAFT=24

src/app/core/constants/attestations-per-format.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {AGE_OVER_18_ATTESTATION, EHIC_ATTESTATION, MDL_ATTESTATION, PDA1_ATTESTA
33
import {AttestationFormat} from "@core/models/attestation/AttestationFormat";
44
import {AttestationType} from "@core/models/attestation/AttestationType";
55
import {DataElement} from "@core/models/attestation/AttestationDefinition";
6+
import { ClaimsQuery } from "../models/dcql/DCQL";
67

78
export 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
}
3132
export 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 ----*/
@@ -63,14 +64,14 @@ export const EHIC_MSO_MDOC: MsoMdocAttestation = {
6364
doctype: 'eu.europa.ec.eudi.ehic.1',
6465
namespace: 'eu.europa.ec.eudi.ehic.1',
6566
attributePath: (attribute: DataElement) => { return msoMdocAttributePath(attribute, 'eu.europa.ec.eudi.ehic.1') },
66-
claimPath: (attribute: DataElement) => { return { namespace: 'eu.europa.ec.eudi.ehic.1', claim_name: attribute.identifier } }
67+
claimQuery: (attribute: DataElement) => { return msoMdocClaimQuery('eu.europa.ec.eudi.ehic.1', attribute.identifier) }
6768
}
6869
export const EHIC_SD_JWT_VC: SdJwtVcAttestation = {
6970
format: AttestationFormat.SD_JWT_VC,
7071
attestationDef: EHIC_ATTESTATION,
7172
vct: 'urn:eu.europa.ec.eudi:ehic:1',
7273
attributePath: (attribute: DataElement) => { return `$.${sdJwtVcAttributePath(attribute, AttestationType.EHIC)}` },
73-
claimPath: (attribute: DataElement) => { return { path: sdJwtVcAttributePath(attribute, AttestationType.EHIC).split('.') } }
74+
claimQuery: (attribute: DataElement) => { return { path: sdJwtVcAttributePath(attribute, AttestationType.EHIC).split('.') } }
7475
}
7576

7677
/*---- PDA1 INSTANCES PER FORMAT ----*/
@@ -80,14 +81,14 @@ export const PDA1_MSO_MDOC: MsoMdocAttestation = {
8081
doctype: 'eu.europa.ec.eudi.pda1.1',
8182
namespace: 'eu.europa.ec.eudi.pda1.1',
8283
attributePath: (attribute: DataElement) => { return msoMdocAttributePath(attribute, 'eu.europa.ec.eudi.pda1.1') },
83-
claimPath: (attribute: DataElement) => { return { namespace: 'eu.europa.ec.eudi.pda1.1', claim_name: attribute.identifier } }
84+
claimQuery: (attribute: DataElement) => { return msoMdocClaimQuery('eu.europa.ec.eudi.pda1.1', attribute.identifier) }
8485
}
8586
export const PDA1_SD_JWT_VC: SdJwtVcAttestation = {
8687
format: AttestationFormat.SD_JWT_VC,
8788
attestationDef: PDA1_ATTESTATION,
8889
vct: 'urn:eu.europa.ec.eudi:pda1:1',
8990
attributePath: (attribute: DataElement) => { return `$.${sdJwtVcAttributePath(attribute, AttestationType.PDA1)}` },
90-
claimPath: (attribute: DataElement) => { return { path: sdJwtVcAttributePath(attribute, AttestationType.PDA1).split('.') } }
91+
claimQuery: (attribute: DataElement) => { return { path: sdJwtVcAttributePath(attribute, AttestationType.PDA1).split('.') } }
9192
}
9293

9394
function msoMdocAttributePath(attribute: DataElement, namespace: string): string {
@@ -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+
110115
export const PID_SD_JWT_VC_ATTRIBUTE_MAP: { [id: string]: string } = {
111116
"birth_date": "birthdate",
112117
"age_over_18": "age_equal_or_over.18",

src/app/core/models/attestation/Attestations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export type MsoMdocAttestation = {
1010
namespace: string,
1111
attestationDef: AttestationDefinition,
1212
attributePath: (attribute: DataElement) => string,
13-
claimPath: (attribute: DataElement) => ClaimsQuery,
13+
claimQuery: (attribute: DataElement) => ClaimsQuery,
1414
}
1515

1616
export type SdJwtVcAttestation = {
1717
format: AttestationFormat.SD_JWT_VC,
1818
vct: string,
1919
attestationDef: AttestationDefinition
2020
attributePath: (attribute: DataElement) => string,
21-
claimPath: (attribute: DataElement) => ClaimsQuery,
21+
claimQuery: (attribute: DataElement) => ClaimsQuery,
2222
}

src/app/core/models/dcql/DCQL.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,19 @@ export type CredentialSetQuery = {
1717
required?: boolean;
1818
};
1919

20-
export type BaseClaimQuery = {
20+
export type ClaimQuery = {
2121
id?: ClaimId;
22+
path: ClaimPath;
2223
values?: Object[];
2324
};
2425

25-
export type JsonClaimQuery = {
26-
path: string[];
27-
};
28-
2926
export type MsoMdocClaimQueryExtension = {
30-
namespace: string;
31-
claim_name: string;
27+
intent_to_retain: boolean;
3228
};
3329

34-
export type ClaimsQuery = BaseClaimQuery &
35-
(JsonClaimQuery | MsoMdocClaimQueryExtension);
30+
export type ClaimsQuery = ClaimQuery &
31+
(ClaimQuery | MsoMdocClaimQueryExtension);
32+
3633

3734
export type QueryId = string;
3835
export type ClaimId = string;

src/app/core/services/dcql-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class DCQLService {
7575
selectedAttributes!.includes(dataElement.identifier)
7676
)
7777
.map((dataElement) => {
78-
return attestation!!.claimPath(dataElement);
78+
return attestation!.claimQuery(dataElement);
7979
});
8080

8181
if (claims.length > 0) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const environment = {
22
apiUrl: 'http://localhost:4200',
33
appName: 'Verifier',
4-
openid4vpDraft: '23',
4+
openid4vpDraft: '24',
55
};

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const environment = {
22
apiUrl: 'http://localhost:8080',
33
appName: 'Verifier',
4-
openid4vpDraft: '23',
4+
openid4vpDraft: '24',
55
};

0 commit comments

Comments
 (0)