|
1 | 1 | import { assertEquals } from '@std/assert'; |
2 | 2 |
|
3 | | -import type { DCAPIRequestOptions } from '../../dcapi.ts'; |
| 3 | +import type { CredentialRequestOptions } from '../../dcapi.ts'; |
4 | 4 | import { generateSessionTranscript } from './generateSessionTranscript.ts'; |
5 | 5 | import { base64url } from '../../helpers/index.ts'; |
6 | 6 |
|
7 | 7 | Deno.test('should generate OID4VP-specific session transcript', async () => { |
8 | | - const options: DCAPIRequestOptions = { |
| 8 | + const options: CredentialRequestOptions = { |
9 | 9 | digital: { |
10 | 10 | requests: [ |
11 | 11 | { |
12 | | - response_type: 'vp_token', |
13 | | - response_mode: 'dc_api', |
14 | | - client_id: 'web-origin:http://localhost:8000', |
15 | | - nonce: 'Y_Sl5cgcgTiw7XnikC24SCDvPEFb81gcOp3lrsdSwZ8', |
16 | | - dcql_query: { |
17 | | - credentials: [ |
18 | | - { |
19 | | - id: 'cred1', |
20 | | - format: 'mso_mdoc', |
21 | | - meta: { doctype_value: 'org.iso.18013.5.1.mDL' }, |
22 | | - claims: [ |
23 | | - { path: ['org.iso.18013.5.1', 'family_name'] }, |
24 | | - { path: ['org.iso.18013.5.1', 'given_name'] }, |
25 | | - ], |
26 | | - }, |
27 | | - ], |
| 12 | + protocol: 'openid4vp', |
| 13 | + data: { |
| 14 | + response_type: 'vp_token', |
| 15 | + response_mode: 'dc_api', |
| 16 | + client_id: 'web-origin:http://localhost:8000', |
| 17 | + nonce: 'Y_Sl5cgcgTiw7XnikC24SCDvPEFb81gcOp3lrsdSwZ8', |
| 18 | + dcql_query: { |
| 19 | + credentials: [ |
| 20 | + { |
| 21 | + id: 'cred1', |
| 22 | + format: 'mso_mdoc', |
| 23 | + meta: { doctype_value: 'org.iso.18013.5.1.mDL' }, |
| 24 | + claims: [ |
| 25 | + { path: ['org.iso.18013.5.1', 'family_name'] }, |
| 26 | + { path: ['org.iso.18013.5.1', 'given_name'] }, |
| 27 | + ], |
| 28 | + }, |
| 29 | + ], |
| 30 | + }, |
28 | 31 | }, |
29 | 32 | }, |
30 | 33 | ], |
31 | 34 | }, |
32 | 35 | }; |
33 | 36 |
|
34 | | - const sessionTranscript = await generateSessionTranscript(options.digital.requests[0]); |
| 37 | + const sessionTranscript = await generateSessionTranscript(options.digital.requests[0].data); |
35 | 38 |
|
36 | 39 | assertEquals( |
37 | 40 | sessionTranscript, |
|
0 commit comments