@pagopa/io-react-native-wallet 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/client/generated/wallet-provider.js +37 -11
- package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
- package/lib/commonjs/credential/issuance/02-get-issuer-config.js +83 -3
- package/lib/commonjs/credential/issuance/02-get-issuer-config.js.map +1 -1
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +5 -7
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +27 -10
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +50 -46
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +1 -1
- package/lib/commonjs/credential/issuance/const.js +1 -1
- package/lib/commonjs/credential/issuance/const.js.map +1 -1
- package/lib/commonjs/credential/issuance/index.js +6 -0
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/types.js +19 -10
- package/lib/commonjs/credential/issuance/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +10 -3
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +11 -4
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +3 -3
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/commonjs/entity/openid-connect/issuer/types.js +2 -2
- package/lib/commonjs/entity/openid-connect/issuer/types.js.map +1 -1
- package/lib/commonjs/entity/trust/types.js +19 -30
- package/lib/commonjs/entity/trust/types.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mdoc/index.js +3 -3
- package/lib/commonjs/mdoc/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +2 -2
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +1 -1
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +3 -2
- package/lib/commonjs/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +1 -1
- package/lib/commonjs/utils/pop.js +1 -1
- package/lib/commonjs/utils/pop.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/issuing.js +11 -7
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +14 -19
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/client/generated/wallet-provider.js +29 -7
- package/lib/module/client/generated/wallet-provider.js.map +1 -1
- package/lib/module/credential/issuance/02-get-issuer-config.js +80 -1
- package/lib/module/credential/issuance/02-get-issuer-config.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +5 -7
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +28 -11
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +50 -46
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +1 -1
- package/lib/module/credential/issuance/const.js +1 -1
- package/lib/module/credential/issuance/const.js.map +1 -1
- package/lib/module/credential/issuance/index.js +2 -2
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/credential/issuance/types.js +15 -8
- package/lib/module/credential/issuance/types.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +10 -3
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +11 -4
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +3 -3
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/module/entity/openid-connect/issuer/types.js +2 -2
- package/lib/module/entity/openid-connect/issuer/types.js.map +1 -1
- package/lib/module/entity/trust/types.js +19 -30
- package/lib/module/entity/trust/types.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mdoc/index.js +3 -3
- package/lib/module/mdoc/index.js.map +1 -1
- package/lib/module/sd-jwt/index.js +2 -2
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +1 -1
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js +3 -2
- package/lib/module/utils/credential/issuance/07-verify-and-parse-credentials-utils.js.map +1 -1
- package/lib/module/utils/pop.js +1 -1
- package/lib/module/utils/pop.js.map +1 -1
- package/lib/module/wallet-instance-attestation/issuing.js +13 -9
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +12 -17
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +146 -17
- package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts +15 -0
- package/lib/typescript/credential/issuance/02-get-issuer-config.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +7 -2
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/const.d.ts +1 -1
- package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +2 -2
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +52 -21
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +4 -2
- package/lib/typescript/credential/presentation/types.d.ts.map +1 -1
- package/lib/typescript/entity/openid-connect/issuer/types.d.ts +17 -17
- package/lib/typescript/entity/openid-connect/issuer/types.d.ts.map +1 -1
- package/lib/typescript/entity/trust/index.d.ts +150 -140
- package/lib/typescript/entity/trust/index.d.ts.map +1 -1
- package/lib/typescript/entity/trust/types.d.ts +540 -344
- package/lib/typescript/entity/trust/types.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts +2 -2
- package/lib/typescript/sd-jwt/index.d.ts +12 -12
- package/lib/typescript/sd-jwt/types.d.ts +14 -14
- package/lib/typescript/utils/credential/issuance/07-verify-and-parse-credentials-utils.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +50 -102
- package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/generated/wallet-provider.ts +39 -7
- package/src/credential/issuance/02-get-issuer-config.ts +117 -0
- package/src/credential/issuance/03-start-user-authorization.ts +7 -8
- package/src/credential/issuance/06-obtain-credential.ts +41 -14
- package/src/credential/issuance/07-verify-and-parse-credential.ts +7 -3
- package/src/credential/issuance/README.md +1 -1
- package/src/credential/issuance/const.ts +1 -0
- package/src/credential/issuance/index.ts +6 -1
- package/src/credential/issuance/types.ts +21 -8
- package/src/credential/presentation/07-evaluate-dcql-query.ts +15 -5
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +21 -4
- package/src/credential/presentation/08-send-authorization-response.ts +3 -3
- package/src/credential/presentation/types.ts +3 -0
- package/src/entity/openid-connect/issuer/types.ts +2 -1
- package/src/entity/trust/types.ts +22 -20
- package/src/index.ts +2 -0
- package/src/mdoc/index.ts +3 -3
- package/src/sd-jwt/index.ts +2 -2
- package/src/sd-jwt/types.ts +1 -1
- package/src/utils/credential/issuance/07-verify-and-parse-credentials-utils.ts +3 -2
- package/src/utils/pop.ts +1 -1
- package/src/wallet-instance-attestation/issuing.ts +14 -8
- package/src/wallet-instance-attestation/types.ts +16 -22
@@ -49,12 +49,12 @@ const CredentialIssuerDisplayMetadata = z.object({
|
|
49
49
|
});
|
50
50
|
|
51
51
|
type ClaimsMetadata = z.infer<typeof ClaimsMetadata>;
|
52
|
-
const ClaimsMetadata = z.
|
53
|
-
z.
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
);
|
52
|
+
const ClaimsMetadata = z.object({
|
53
|
+
path: z.array(z.string()),
|
54
|
+
display: z.array(CredentialDisplayMetadata),
|
55
|
+
mandatory: z.boolean().optional(),
|
56
|
+
value_type: z.string().optional(),
|
57
|
+
});
|
58
58
|
|
59
59
|
type IssuanceErrorSupported = z.infer<typeof IssuanceErrorSupported>;
|
60
60
|
const IssuanceErrorSupported = z.object({
|
@@ -70,12 +70,17 @@ const IssuanceErrorSupported = z.object({
|
|
70
70
|
// Metadata for a credentia which is supported by a Issuer
|
71
71
|
type SupportedCredentialMetadata = z.infer<typeof SupportedCredentialMetadata>;
|
72
72
|
const SupportedCredentialMetadata = z.object({
|
73
|
-
format: z.union([
|
73
|
+
format: z.union([
|
74
|
+
z.literal("vc+sd-jwt"),
|
75
|
+
z.literal("dc+sd-jwt"),
|
76
|
+
z.literal("mso_mdoc"),
|
77
|
+
]),
|
78
|
+
vct: z.string().optional(),
|
74
79
|
scope: z.string(),
|
75
80
|
display: z.array(CredentialDisplayMetadata),
|
76
|
-
claims:
|
81
|
+
claims: z.array(ClaimsMetadata),
|
77
82
|
cryptographic_binding_methods_supported: z.array(z.string()),
|
78
|
-
credential_signing_alg_values_supported: z.array(z.string()),
|
83
|
+
credential_signing_alg_values_supported: z.array(z.string()).optional(),
|
79
84
|
authentic_source: z.string().optional(),
|
80
85
|
issuance_errors_supported: z.record(IssuanceErrorSupported).optional(),
|
81
86
|
});
|
@@ -165,40 +170,37 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(
|
|
165
170
|
credential_issuer: z.string(),
|
166
171
|
credential_endpoint: z.string(),
|
167
172
|
revocation_endpoint: z.string(),
|
173
|
+
nonce_endpoint: z.string(),
|
168
174
|
status_attestation_endpoint: z.string(),
|
169
175
|
display: z.array(CredentialIssuerDisplayMetadata),
|
170
176
|
credential_configurations_supported: z.record(
|
171
177
|
SupportedCredentialMetadata
|
172
178
|
),
|
173
179
|
jwks: z.object({ keys: z.array(JWK) }),
|
180
|
+
trust_frameworks_supported: z.array(z.string()),
|
181
|
+
evidence_supported: z.array(z.string()),
|
174
182
|
}),
|
175
183
|
oauth_authorization_server: z.object({
|
176
184
|
authorization_endpoint: z.string(),
|
177
185
|
pushed_authorization_request_endpoint: z.string(),
|
178
|
-
dpop_signing_alg_values_supported: z.array(z.string()).optional(), // TODO [SIW-1268]: should not be optional
|
179
186
|
token_endpoint: z.string(),
|
180
|
-
introspection_endpoint: z.string().optional(), // TODO [SIW-1268]: should not be optional
|
181
187
|
client_registration_types_supported: z.array(z.string()),
|
182
188
|
code_challenge_methods_supported: z.array(z.string()),
|
183
|
-
authorization_details_types_supported: z.array(z.string()).optional(), // TODO [SIW-1268]: should not be optional,
|
184
189
|
acr_values_supported: z.array(z.string()),
|
185
190
|
grant_types_supported: z.array(z.string()),
|
186
191
|
issuer: z.string(),
|
187
192
|
jwks: z.object({ keys: z.array(JWK) }),
|
188
193
|
scopes_supported: z.array(z.string()),
|
189
|
-
request_parameter_supported: z.boolean().optional(), // TODO [SIW-1268]: should not be optional
|
190
|
-
request_uri_parameter_supported: z.boolean().optional(), // TODO [SIW-1268]: should not be optional
|
191
|
-
response_types_supported: z.array(z.string()).optional(), // TODO [SIW-1268]: should not be optional
|
192
194
|
response_modes_supported: z.array(z.string()),
|
193
|
-
subject_types_supported: z.array(z.string()).optional(), // TODO [SIW-1268]: should not be optional
|
194
195
|
token_endpoint_auth_methods_supported: z.array(z.string()),
|
195
196
|
token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
|
196
197
|
request_object_signing_alg_values_supported: z.array(z.string()),
|
197
198
|
}),
|
198
|
-
/**
|
199
|
-
|
200
|
-
|
201
|
-
|
199
|
+
/**
|
200
|
+
* Credential Issuers act as Relying Party when they require the presentation of other credentials.
|
201
|
+
* This does not apply for PID issuance, which requires CIE authz.
|
202
|
+
*/
|
203
|
+
openid_credential_verifier: RelyingPartyMetadata.optional(),
|
202
204
|
}),
|
203
205
|
}),
|
204
206
|
})
|
package/src/index.ts
CHANGED
@@ -13,6 +13,7 @@ import * as WalletInstance from "./wallet-instance";
|
|
13
13
|
import { AuthorizationDetail, AuthorizationDetails } from "./utils/par";
|
14
14
|
import { createCryptoContextFor } from "./utils/crypto";
|
15
15
|
import type { IntegrityContext } from "./utils/integrity";
|
16
|
+
import { getCredentialIssuerEntityConfiguration } from "./entity/trust";
|
16
17
|
|
17
18
|
export {
|
18
19
|
SdJwt,
|
@@ -25,6 +26,7 @@ export {
|
|
25
26
|
AuthorizationDetail,
|
26
27
|
AuthorizationDetails,
|
27
28
|
fixBase64EncodingOnKey,
|
29
|
+
getCredentialIssuerEntityConfiguration,
|
28
30
|
};
|
29
31
|
|
30
32
|
export type { IntegrityContext, AuthorizationContext };
|
package/src/mdoc/index.ts
CHANGED
@@ -14,8 +14,8 @@ export const verify = async (
|
|
14
14
|
token: string,
|
15
15
|
_: JWK | JWK[]
|
16
16
|
): Promise<{ issuerSigned: CBOR.IssuerSigned }> => {
|
17
|
-
//
|
18
|
-
const issuerSigned = await CBOR.decodeIssuerSigned(token);
|
17
|
+
// ensure that token is base64
|
18
|
+
const issuerSigned = await CBOR.decodeIssuerSigned(b64utob64(token));
|
19
19
|
if (!issuerSigned) {
|
20
20
|
throw new Error("Invalid mDoc");
|
21
21
|
}
|
@@ -55,7 +55,7 @@ export const prepareVpTokenMdoc = async (
|
|
55
55
|
/* verifiableCredential is a IssuerSigned structure */
|
56
56
|
const documents = [
|
57
57
|
{
|
58
|
-
issuerSignedContent: verifiableCredential,
|
58
|
+
issuerSignedContent: b64utob64(verifiableCredential),
|
59
59
|
alias: keyTag,
|
60
60
|
docType,
|
61
61
|
},
|
package/src/sd-jwt/index.ts
CHANGED
@@ -41,7 +41,7 @@ export const decode = <S extends z.ZodType<SdJwt4VC>>(
|
|
41
41
|
if (token.slice(-1) === "~") {
|
42
42
|
token = token.slice(0, -1);
|
43
43
|
}
|
44
|
-
const [rawSdJwt = "", ...rawDisclosures] = token.split("~");
|
44
|
+
const [rawSdJwt = "", ...rawDisclosures] = token.split("~").filter(Boolean);
|
45
45
|
|
46
46
|
// get the sd-jwt as object
|
47
47
|
// validate it's a valid SD-JWT for Verifiable Credentials
|
@@ -80,7 +80,7 @@ export const disclose = async (
|
|
80
80
|
token: string,
|
81
81
|
claims: string[]
|
82
82
|
): Promise<{ token: string; paths: { claim: string; path: string }[] }> => {
|
83
|
-
const [rawSdJwt, ...rawDisclosures] = token.split("~");
|
83
|
+
const [rawSdJwt, ...rawDisclosures] = token.split("~").filter(Boolean);
|
84
84
|
const { sdJwt, disclosures } = decode(token, SdJwt4VC);
|
85
85
|
|
86
86
|
// for each claim, return the path on which they are located in the SD-JWT token
|
package/src/sd-jwt/types.ts
CHANGED
@@ -127,10 +127,11 @@ export function buildMockSDJWTTestScenario(
|
|
127
127
|
): Parameters<typeof parseCredentialSdJwt> {
|
128
128
|
return [
|
129
129
|
{
|
130
|
-
|
130
|
+
dc_sd_jwt_PersonIdentificationData: {
|
131
131
|
cryptographic_suites_supported: [],
|
132
132
|
cryptographic_binding_methods_supported: [],
|
133
133
|
format: "vc+sd-jwt",
|
134
|
+
vct: "urn:eu.europa.ec.eudi:pid:1",
|
134
135
|
display: [],
|
135
136
|
claims,
|
136
137
|
},
|
@@ -147,7 +148,7 @@ export function buildMockSDJWTTestScenario(
|
|
147
148
|
credential_hash_alg: "sha-256",
|
148
149
|
},
|
149
150
|
},
|
150
|
-
vct: "eu.europa.ec.eudi
|
151
|
+
vct: "urn:eu.europa.ec.eudi:pid:1",
|
151
152
|
iss: "unused",
|
152
153
|
sub: "unused",
|
153
154
|
expiry_date: "unused",
|
package/src/utils/pop.ts
CHANGED
@@ -7,11 +7,12 @@ import { fixBase64EncodingOnKey, JWK } from "../utils/jwk";
|
|
7
7
|
import { getWalletProviderClient } from "../client";
|
8
8
|
import type { IntegrityContext } from "..";
|
9
9
|
import {
|
10
|
+
IoWalletError,
|
10
11
|
ResponseErrorBuilder,
|
11
12
|
WalletProviderResponseError,
|
12
13
|
WalletProviderResponseErrorCodes,
|
13
14
|
} from "../utils/errors";
|
14
|
-
import {
|
15
|
+
import { WalletAttestationResponse } from "./types";
|
15
16
|
|
16
17
|
/**
|
17
18
|
* Getter for an attestation request. The attestation request is a JWT that will be sent to the Wallet Provider to request a Wallet Instance Attestation.
|
@@ -47,8 +48,8 @@ export async function getAttestationRequest(
|
|
47
48
|
return new SignJWT(wiaCryptoContext)
|
48
49
|
.setPayload({
|
49
50
|
iss: keyThumbprint,
|
50
|
-
|
51
|
-
challenge,
|
51
|
+
aud: walletProviderBaseUrl,
|
52
|
+
nonce: challenge,
|
52
53
|
hardware_signature: signature,
|
53
54
|
integrity_assertion: authenticatorData,
|
54
55
|
hardware_key_tag: hardwareKeyTag,
|
@@ -58,7 +59,7 @@ export async function getAttestationRequest(
|
|
58
59
|
})
|
59
60
|
.setProtectedHeader({
|
60
61
|
kid: publicKey.kid,
|
61
|
-
typ: "war+jwt",
|
62
|
+
typ: "wp-war+jwt",
|
62
63
|
})
|
63
64
|
.setIssuedAt()
|
64
65
|
.setExpirationTime("1h")
|
@@ -103,16 +104,21 @@ export const getAttestation = async ({
|
|
103
104
|
|
104
105
|
// 3. Request WIA
|
105
106
|
const tokenResponse = await api
|
106
|
-
.post("/
|
107
|
+
.post("/wallet-attestations", {
|
107
108
|
body: {
|
108
|
-
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
|
109
109
|
assertion: signedAttestationRequest,
|
110
110
|
},
|
111
111
|
})
|
112
|
-
.then(
|
112
|
+
.then(WalletAttestationResponse.parse)
|
113
113
|
.catch(handleAttestationCreationError);
|
114
114
|
|
115
|
-
|
115
|
+
const wallet_attestation = tokenResponse.wallet_attestations;
|
116
|
+
if (wallet_attestation && wallet_attestation[0]) {
|
117
|
+
// Return first because eudiw be return only jwt
|
118
|
+
return wallet_attestation[0].wallet_attestation;
|
119
|
+
}
|
120
|
+
|
121
|
+
throw new IoWalletError("Wallet Attestation response is empty!");
|
116
122
|
};
|
117
123
|
|
118
124
|
const handleAttestationCreationError = (e: unknown) => {
|
@@ -33,7 +33,7 @@ export const WalletInstanceAttestationRequestJwt = z.object({
|
|
33
33
|
header: z.intersection(
|
34
34
|
Jwt.shape.header,
|
35
35
|
z.object({
|
36
|
-
typ: z.literal("war+jwt"),
|
36
|
+
typ: z.literal("wp-war+jwt"),
|
37
37
|
})
|
38
38
|
),
|
39
39
|
payload: z.intersection(
|
@@ -53,35 +53,29 @@ export const WalletInstanceAttestationJwt = z.object({
|
|
53
53
|
header: z.intersection(
|
54
54
|
Jwt.shape.header,
|
55
55
|
z.object({
|
56
|
-
typ: z.literal("
|
56
|
+
typ: z.literal("oauth-client-attestation+jwt"),
|
57
|
+
trust_chain: z.array(z.string()).optional(), // TODO: [SIW-2264] Make mandatory
|
57
58
|
})
|
58
59
|
),
|
59
60
|
payload: z.intersection(
|
60
61
|
Jwt.shape.payload,
|
61
62
|
z.object({
|
62
63
|
sub: z.string(),
|
63
|
-
aal: z.string(),
|
64
|
-
|
65
|
-
|
66
|
-
vp_formats_supported: z.object({
|
67
|
-
"vc+sd-jwt": z
|
68
|
-
.object({
|
69
|
-
"sd-jwt_alg_values": z.array(z.string()),
|
70
|
-
})
|
71
|
-
.optional(),
|
72
|
-
"vp+sd-jwt": z
|
73
|
-
.object({
|
74
|
-
"sd-jwt_alg_values": z.array(z.string()),
|
75
|
-
})
|
76
|
-
.optional(),
|
77
|
-
}),
|
78
|
-
request_object_signing_alg_values_supported: z.array(z.string()),
|
79
|
-
presentation_definition_uri_supported: z.boolean(),
|
64
|
+
aal: z.string().optional(),
|
65
|
+
wallet_link: z.string().optional(),
|
66
|
+
wallet_name: z.string().optional(),
|
80
67
|
})
|
81
68
|
),
|
82
69
|
});
|
83
70
|
|
84
|
-
export type
|
85
|
-
|
86
|
-
|
71
|
+
export type WalletAttestationResponse = z.infer<
|
72
|
+
typeof WalletAttestationResponse
|
73
|
+
>;
|
74
|
+
export const WalletAttestationResponse = z.object({
|
75
|
+
wallet_attestations: z.array(
|
76
|
+
z.object({
|
77
|
+
wallet_attestation: z.string(),
|
78
|
+
format: z.enum(["jwt", "dc+sd-jwt", "mso_mdoc"]),
|
79
|
+
})
|
80
|
+
),
|
87
81
|
});
|