-
Notifications
You must be signed in to change notification settings - Fork 16
/
Mdoc.spec.ts
268 lines (245 loc) · 25.7 KB
/
Mdoc.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
import { createHash } from 'crypto';
import { PresentationDefinitionV2 } from '@sphereon/pex-models';
import { PEX, Status, Validated } from '../lib';
import { SubmissionRequirementMatchType } from '../lib/evaluation/core';
export const hasher = (data: string) => createHash('sha256').update(data).digest();
const mdocBase64UrlMultipleDocumentsPresentation =
'uQADZ3ZlcnNpb25jMS4waWRvY3VtZW50c4KjZ2RvY1R5cGV1b3JnLmlzby4xODAxMy41LjEubURMbGlzc3VlclNpZ25lZLkAAmpuYW1lU3BhY2VzoXFvcmcuaXNvLjE4MDEzLjUuMYHYGFhipGhkaWdlc3RJRAFxZWxlbWVudElkZW50aWZpZXJqZ2l2ZW5fbmFtZWxlbGVtZW50VmFsdWVjQXZhZnJhbmRvbVggKtvEv2_zGjeiQxMF6Qr_ubn_R7oUADdffjsLaAleH_VqaXNzd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RwsBQ';
const pex = new PEX({
hasher,
});
function getPresentationDefinitionV2(withSdJwtInputDescriptor = false): PresentationDefinitionV2 {
const pd: PresentationDefinitionV2 = {
id: 'mDL-sample-req',
input_descriptors: [
{
id: 'org.eu.university',
format: {
mso_mdoc: {
alg: ['ES256', 'ES384', 'ES512', 'EdDSA', 'ESB256', 'ESB320', 'ESB384', 'ESB512'],
},
},
constraints: {
fields: [
{
path: ["$['eu.europa.ec.eudi.pid.1']['name']"],
intent_to_retain: false,
},
{
path: ["$['eu.europa.ec.eudi.pid.1']['degree']"],
intent_to_retain: false,
},
],
limit_disclosure: 'required',
},
},
],
};
if (withSdJwtInputDescriptor) {
pd.input_descriptors.push({
id: 'OpenBadgeCredentialDescriptor',
format: {
'vc+sd-jwt': {
'sd-jwt_alg_values': ['EdDSA'],
},
},
constraints: {
limit_disclosure: 'required',
fields: [
{
path: ['$.vct'],
filter: {
type: 'string',
const: 'OpenBadgeCredential',
},
},
{
path: ['$.university'],
},
],
},
});
}
return pd;
}
// Disabled tests, as the Credo mdocs are invalid containing undefined values for keys, instead of omitting the keys altogether. Since undefined is its own type and not listed as valid, that is not conformant. Our current version throws errors on these
describe.skip('evaluate mdoc', () => {
it('Evaluate presentationDefinition with mso_mdoc format', () => {
const pd = getPresentationDefinitionV2();
const result: Validated = PEX.validateDefinition(pd);
expect(result).toEqual([{ message: 'ok', status: 'info', tag: 'root' }]);
});
it('selectFrom with mso_mdoc format encoded', () => {
const result = pex.selectFrom(getPresentationDefinitionV2(), [mdocBase64UrlPid, mdocBase64UrlUniversity, mdocBase64UrlUniversityCustomNamespace]);
expect(result.errors?.length).toEqual(0);
expect(result.matches).toEqual([
{
name: 'org.eu.university',
rule: 'all',
vc_path: ['$.verifiableCredential[0]'],
type: SubmissionRequirementMatchType.InputDescriptor,
id: 'org.eu.university',
},
]);
expect(result.verifiableCredential).toEqual([mdocBase64UrlUniversity]);
expect(result.areRequiredCredentialsPresent).toBe('info');
});
it('selectFrom with both mso_mdoc and vc+sd-jwt format encoded', () => {
const result = pex.selectFrom(getPresentationDefinitionV2(true), [
sdJwt,
mdocBase64UrlPid,
mdocBase64UrlUniversity,
mdocBase64UrlUniversityCustomNamespace,
]);
expect(result.errors?.length).toEqual(0);
expect(result.matches).toEqual([
{
name: 'org.eu.university',
rule: 'all',
vc_path: ['$.verifiableCredential[0]'],
type: SubmissionRequirementMatchType.InputDescriptor,
id: 'org.eu.university',
},
{
id: 'OpenBadgeCredentialDescriptor',
name: 'OpenBadgeCredentialDescriptor',
rule: 'all',
type: SubmissionRequirementMatchType.InputDescriptor,
vc_path: ['$.verifiableCredential[1]'],
},
]);
expect(result.verifiableCredential).toEqual([mdocBase64UrlUniversity, sdJwt]);
expect(result.areRequiredCredentialsPresent).toBe('info');
});
it('evaluatePresentation with mso_mdoc format', async () => {
const presentationDefinition = getPresentationDefinitionV2();
const submission = {
definition_id: presentationDefinition.id,
descriptor_map: [
{
format: 'mso_mdoc',
id: 'org.eu.university',
path: '$[0]',
},
],
id: '2d0b0be7-9d91-4760-ad58-f204f9f39de7',
};
const evaluateResults = pex.evaluatePresentation(presentationDefinition, [mdocBase64UrlUniversityPresentation], {
presentationSubmission: submission,
});
expect(evaluateResults).toEqual({
presentations: [mdocBase64UrlUniversityPresentation],
areRequiredCredentialsPresent: Status.INFO,
warnings: [],
errors: [],
value: submission,
});
});
it('evaluatePresentation with mso_mdoc format where mdoc device response contains multiple documents', async () => {
const definition: PresentationDefinitionV2 = {
id: 'mDL-sample-req',
input_descriptors: [
{
id: 'org.iso.18013.5.1.mDL2',
format: {
mso_mdoc: {
alg: ['ES256', 'ES384', 'ES512', 'EdDSA', 'ESB256', 'ESB320', 'ESB384', 'ESB512'],
},
},
constraints: {
fields: [
{
path: ["$['org.iso.18013.5.1']['family_name']"],
intent_to_retain: false,
},
],
limit_disclosure: 'required',
},
},
],
};
const submission = {
definition_id: definition.id,
descriptor_map: [
{
format: 'mso_mdoc',
id: 'org.iso.18013.5.1.mDL2',
path: '$[0]',
},
],
id: '2d0b0be7-9d91-4760-ad58-f204f9f39de7',
};
const evaluateResults = pex.evaluatePresentation(definition, [mdocBase64UrlMultipleDocumentsPresentation], {
presentationSubmission: submission,
});
expect(evaluateResults).toEqual({
presentations: [mdocBase64UrlMultipleDocumentsPresentation],
areRequiredCredentialsPresent: Status.INFO,
warnings: [],
errors: [],
value: submission,
});
});
it('evaluatePresentation with mso_mdoc format generating a submission', async () => {
const presentationDefinition = getPresentationDefinitionV2();
const evaluateResults = pex.evaluatePresentation(presentationDefinition, [mdocBase64UrlUniversityPresentation], {
generatePresentationSubmission: true,
});
expect(evaluateResults).toEqual({
presentations: [mdocBase64UrlUniversityPresentation],
areRequiredCredentialsPresent: Status.INFO,
warnings: [],
errors: [],
value: {
definition_id: presentationDefinition.id,
descriptor_map: [
{
format: 'mso_mdoc',
id: 'org.eu.university',
path: '$[0]',
},
],
id: expect.any(String),
},
});
});
it('evaluatePresentation with both mso_mdoc and vc+sd-jwt format', async () => {
const presentationDefinition = getPresentationDefinitionV2(true);
const submission = {
definition_id: presentationDefinition.id,
descriptor_map: [
{
format: 'mso_mdoc',
id: 'org.eu.university',
path: '$[0]',
},
{
format: 'vc+sd-jwt',
id: 'OpenBadgeCredentialDescriptor',
path: '$[1]',
},
],
id: '2d0b0be7-9d91-4760-ad58-f204f9f39de7',
};
const evaluateResults = pex.evaluatePresentation(presentationDefinition, [mdocBase64UrlUniversityPresentation, sdJwt], {
presentationSubmission: submission,
});
expect(evaluateResults).toEqual({
presentations: [mdocBase64UrlUniversityPresentation, sdJwt],
areRequiredCredentialsPresent: Status.INFO,
warnings: [],
errors: [],
value: submission,
});
});
});