@pagopa/io-react-native-wallet 0.5.0 → 0.6.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/README.md +52 -19
- package/lib/commonjs/index.js +13 -24
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/issuing.js +22 -28
- package/lib/commonjs/pid/issuing.js.map +1 -1
- package/lib/commonjs/rp/__test__/index.test.js +2 -2
- package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
- package/lib/commonjs/rp/index.js +5 -19
- package/lib/commonjs/rp/index.js.map +1 -1
- package/lib/commonjs/rp/types.js +1 -21
- package/lib/commonjs/rp/types.js.map +1 -1
- package/lib/commonjs/trust/index.js +24 -5
- package/lib/commonjs/trust/index.js.map +1 -1
- package/lib/commonjs/trust/types.js +95 -4
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/issuing.js +5 -13
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/index.js +2 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/issuing.js +16 -23
- package/lib/module/pid/issuing.js.map +1 -1
- package/lib/module/rp/__test__/index.test.js +2 -2
- package/lib/module/rp/__test__/index.test.js.map +1 -1
- package/lib/module/rp/index.js +2 -17
- package/lib/module/rp/index.js.map +1 -1
- package/lib/module/rp/types.js +0 -20
- package/lib/module/rp/types.js.map +1 -1
- package/lib/module/trust/index.js +19 -5
- package/lib/module/trust/index.js.map +1 -1
- package/lib/module/trust/types.js +94 -2
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/wallet-instance-attestation/issuing.js +5 -13
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/typescript/index.d.ts +2 -5
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/issuing.d.ts +3 -12
- package/lib/typescript/pid/issuing.d.ts.map +1 -1
- package/lib/typescript/rp/index.d.ts +4 -12
- package/lib/typescript/rp/index.d.ts.map +1 -1
- package/lib/typescript/rp/types.d.ts +4 -1256
- package/lib/typescript/rp/types.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +806 -3
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +8637 -5
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts +2 -1
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
- package/package.json +1 -1
- package/src/index.ts +11 -12
- package/src/pid/issuing.ts +24 -30
- package/src/rp/__test__/index.test.ts +2 -2
- package/src/rp/index.ts +8 -22
- package/src/rp/types.ts +0 -24
- package/src/trust/index.ts +106 -5
- package/src/trust/types.ts +114 -3
- package/src/wallet-instance-attestation/issuing.ts +10 -15
- package/lib/commonjs/pid/metadata.js +0 -52
- package/lib/commonjs/pid/metadata.js.map +0 -1
- package/lib/module/pid/metadata.js +0 -44
- package/lib/module/pid/metadata.js.map +0 -1
- package/lib/typescript/pid/metadata.d.ts +0 -1412
- package/lib/typescript/pid/metadata.d.ts.map +0 -1
- package/src/pid/metadata.ts +0 -51
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/trust/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,SAAS;;;;;;;;;EAAuD,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAU/B,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="react-native" />
|
2
2
|
import { type CryptoContext } from "@pagopa/io-react-native-jwt";
|
3
|
+
import type { WalletProviderEntityConfiguration } from "../trust/types";
|
3
4
|
/**
|
4
5
|
* Request a Wallet Instance Attestation (WIA) to the Wallet provider
|
5
6
|
*
|
@@ -14,5 +15,5 @@ export declare const getAttestation: ({ wiaCryptoContext, appFetch, }: {
|
|
14
15
|
(input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
|
15
16
|
(input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
|
16
17
|
} | undefined;
|
17
|
-
}) => (
|
18
|
+
}) => (walletProviderEntityConfiguration: WalletProviderEntityConfiguration) => Promise<string>;
|
18
19
|
//# sourceMappingURL=issuing.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/issuing.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;
|
1
|
+
{"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/wallet-instance-attestation/issuing.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAOrC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AA8BxE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;sBAKL,aAAa;;;;;0CAII,iCAAiC,KACnE,QAAQ,MAAM,CAuChB,CAAC"}
|
@@ -232,12 +232,12 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
232
232
|
nonce: z.ZodString;
|
233
233
|
}, "strip", z.ZodTypeAny, {
|
234
234
|
jti: string;
|
235
|
-
nonce: string;
|
236
235
|
aud: string;
|
236
|
+
nonce: string;
|
237
237
|
}, {
|
238
238
|
jti: string;
|
239
|
-
nonce: string;
|
240
239
|
aud: string;
|
240
|
+
nonce: string;
|
241
241
|
}>>;
|
242
242
|
}, "strip", z.ZodTypeAny, {
|
243
243
|
header: {
|
@@ -283,8 +283,8 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
283
283
|
};
|
284
284
|
} & {
|
285
285
|
jti: string;
|
286
|
-
nonce: string;
|
287
286
|
aud: string;
|
287
|
+
nonce: string;
|
288
288
|
};
|
289
289
|
}, {
|
290
290
|
header: {
|
@@ -330,8 +330,8 @@ export declare const WalletInstanceAttestationRequestJwt: z.ZodObject<{
|
|
330
330
|
};
|
331
331
|
} & {
|
332
332
|
jti: string;
|
333
|
-
nonce: string;
|
334
333
|
aud: string;
|
334
|
+
nonce: string;
|
335
335
|
};
|
336
336
|
}>;
|
337
337
|
export type WalletInstanceAttestationJwt = z.infer<typeof WalletInstanceAttestationJwt>;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -7,15 +7,15 @@ import * as RP from "./rp";
|
|
7
7
|
import * as Errors from "./utils/errors";
|
8
8
|
import * as WalletInstanceAttestation from "./wallet-instance-attestation";
|
9
9
|
import * as RelyingPartySolution from "./rp";
|
10
|
-
import { RpEntityConfiguration } from "./rp/types";
|
11
|
-
import { verifyTrustChain, getEntityConfiguration } from "./trust";
|
12
10
|
import {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
verifyTrustChain,
|
12
|
+
getEntityConfiguration,
|
13
|
+
getCredentialIssuerEntityConfiguration,
|
14
|
+
getRelyingPartyEntityConfiguration,
|
15
|
+
getTrustAnchorEntityConfiguration,
|
16
|
+
getWalletProviderEntityConfiguration,
|
17
|
+
} from "./trust";
|
17
18
|
import { createCryptoContextFor } from "./utils/crypto";
|
18
|
-
import { PidIssuerEntityConfiguration } from "./pid/metadata";
|
19
19
|
|
20
20
|
export {
|
21
21
|
PID,
|
@@ -25,10 +25,9 @@ export {
|
|
25
25
|
RelyingPartySolution,
|
26
26
|
verifyTrustChain,
|
27
27
|
getEntityConfiguration,
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
TrustAnchorEntityConfiguration,
|
28
|
+
getCredentialIssuerEntityConfiguration,
|
29
|
+
getRelyingPartyEntityConfiguration,
|
30
|
+
getTrustAnchorEntityConfiguration,
|
31
|
+
getWalletProviderEntityConfiguration,
|
33
32
|
createCryptoContextFor,
|
34
33
|
};
|
package/src/pid/issuing.ts
CHANGED
@@ -8,13 +8,11 @@ import { JWK } from "../utils/jwk";
|
|
8
8
|
import uuid from "react-native-uuid";
|
9
9
|
import { PidIssuingError } from "../utils/errors";
|
10
10
|
import { createDPopToken } from "../utils/dpop";
|
11
|
-
import {
|
12
|
-
import
|
13
|
-
createCryptoContextFor,
|
14
|
-
getEntityConfiguration as getGenericEntityConfiguration,
|
15
|
-
} from "..";
|
11
|
+
import { CredentialIssuerEntityConfiguration } from "../trust/types";
|
12
|
+
import * as WalletInstanceAttestation from "../wallet-instance-attestation";
|
16
13
|
import { generate, deleteKey } from "@pagopa/io-react-native-crypto";
|
17
14
|
import { SdJwt } from ".";
|
15
|
+
import { createCryptoContextFor } from "../utils/crypto";
|
18
16
|
// This is a temporary type that will be used for demo purposes only
|
19
17
|
export type CieData = {
|
20
18
|
birthDate: string;
|
@@ -39,18 +37,8 @@ export type PidResponse = {
|
|
39
37
|
format: string;
|
40
38
|
};
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
*/
|
45
|
-
export const getEntityConfiguration =
|
46
|
-
({ appFetch = fetch }: { appFetch?: GlobalFetch["fetch"] } = {}) =>
|
47
|
-
async (
|
48
|
-
relyingPartyBaseUrl: string
|
49
|
-
): Promise<PidIssuerEntityConfiguration> => {
|
50
|
-
return getGenericEntityConfiguration(relyingPartyBaseUrl, {
|
51
|
-
appFetch: appFetch,
|
52
|
-
}).then(PidIssuerEntityConfiguration.parse);
|
53
|
-
};
|
40
|
+
const assertionType =
|
41
|
+
"urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
54
42
|
|
55
43
|
/**
|
56
44
|
* Make a PAR request to the PID issuer and return the response url
|
@@ -67,7 +55,7 @@ const getPar =
|
|
67
55
|
clientId: string,
|
68
56
|
codeVerifier: string,
|
69
57
|
walletProviderBaseUrl: string,
|
70
|
-
pidProviderEntityConfiguration:
|
58
|
+
pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration,
|
71
59
|
walletInstanceAttestation: string
|
72
60
|
): Promise<string> => {
|
73
61
|
// Calculate the thumbprint of the public key of the Wallet Instance Attestation.
|
@@ -79,6 +67,9 @@ const getPar =
|
|
79
67
|
.then(JWK.parse)
|
80
68
|
.then(thumbprint);
|
81
69
|
|
70
|
+
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation)
|
71
|
+
.payload.cnf.jwk.kid;
|
72
|
+
|
82
73
|
const codeChallenge = await sha256ToBase64(codeVerifier);
|
83
74
|
|
84
75
|
const signedJwtForPar = await new SignJWT(wiaCryptoContext)
|
@@ -86,15 +77,17 @@ const getPar =
|
|
86
77
|
kid: keyThumbprint,
|
87
78
|
})
|
88
79
|
.setPayload({
|
89
|
-
|
90
|
-
|
80
|
+
iss,
|
81
|
+
aud: pidProviderEntityConfiguration.payload.iss,
|
82
|
+
jti: `${uuid.v4()}`,
|
83
|
+
client_assertion_type: assertionType,
|
91
84
|
authorization_details: [
|
92
85
|
{
|
93
|
-
|
94
|
-
type:
|
86
|
+
credential_definition: {
|
87
|
+
type: "PersonIdentificationData",
|
95
88
|
},
|
96
89
|
format: "vc+sd-jwt",
|
97
|
-
type: "
|
90
|
+
type: "openid_credential",
|
98
91
|
},
|
99
92
|
],
|
100
93
|
response_type: "code",
|
@@ -117,8 +110,7 @@ const getPar =
|
|
117
110
|
client_id: clientId,
|
118
111
|
code_challenge: codeChallenge,
|
119
112
|
code_challenge_method: "S256",
|
120
|
-
client_assertion_type:
|
121
|
-
"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
|
113
|
+
client_assertion_type: assertionType,
|
122
114
|
client_assertion: walletInstanceAttestation,
|
123
115
|
request: signedJwtForPar,
|
124
116
|
};
|
@@ -164,7 +156,7 @@ export const authorizeIssuing =
|
|
164
156
|
async (
|
165
157
|
walletInstanceAttestation: string,
|
166
158
|
walletProviderBaseUrl: string,
|
167
|
-
pidProviderEntityConfiguration:
|
159
|
+
pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration
|
168
160
|
): Promise<AuthorizationConf> => {
|
169
161
|
// FIXME: do better
|
170
162
|
const clientId = await wiaCryptoContext.getPublicKey().then((_) => _.kid);
|
@@ -203,8 +195,7 @@ export const authorizeIssuing =
|
|
203
195
|
client_id: clientId,
|
204
196
|
code: authorizationCode,
|
205
197
|
code_verifier: codeVerifier,
|
206
|
-
client_assertion_type:
|
207
|
-
"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
|
198
|
+
client_assertion_type: assertionType,
|
208
199
|
client_assertion: walletInstanceAttestation,
|
209
200
|
redirect_uri: walletProviderBaseUrl,
|
210
201
|
};
|
@@ -248,6 +239,7 @@ const createNonceProof = async (
|
|
248
239
|
return new SignJWT(ctx)
|
249
240
|
.setPayload({
|
250
241
|
nonce,
|
242
|
+
jwk: await ctx.getPublicKey(),
|
251
243
|
})
|
252
244
|
.setProtectedHeader({
|
253
245
|
type: "openid4vci-proof+jwt",
|
@@ -278,7 +270,7 @@ export const getCredential =
|
|
278
270
|
}) =>
|
279
271
|
async (
|
280
272
|
{ nonce, accessToken, clientId, walletProviderBaseUrl }: AuthorizationConf,
|
281
|
-
pidProviderEntityConfiguration:
|
273
|
+
pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration,
|
282
274
|
cieData: CieData
|
283
275
|
): Promise<PidResponse> => {
|
284
276
|
const signedDPopForPid = await createDPopToken(
|
@@ -302,7 +294,9 @@ export const getCredential =
|
|
302
294
|
.credential_endpoint;
|
303
295
|
|
304
296
|
const requestBody = {
|
305
|
-
credential_definition: JSON.stringify({
|
297
|
+
credential_definition: JSON.stringify({
|
298
|
+
type: ["PersonIdentificationData"],
|
299
|
+
}),
|
306
300
|
format: "vc+sd-jwt",
|
307
301
|
proof: JSON.stringify({
|
308
302
|
jwt: signedNonceProof,
|
@@ -1,6 +1,6 @@
|
|
1
|
+
import { RelyingPartyEntityConfiguration } from "../../trust/types";
|
1
2
|
import * as RelyingPartySolution from "..";
|
2
3
|
import { AuthRequestDecodeError } from "../../utils/errors";
|
3
|
-
import { RpEntityConfiguration } from "../types";
|
4
4
|
|
5
5
|
describe("decodeAuthRequestQR", () => {
|
6
6
|
it("should return authentication request URL", async () => {
|
@@ -239,7 +239,7 @@ describe("RpEntityConfiguration", () => {
|
|
239
239
|
],
|
240
240
|
},
|
241
241
|
};
|
242
|
-
const result =
|
242
|
+
const result = RelyingPartyEntityConfiguration.safeParse(pp);
|
243
243
|
if (result.success === false) {
|
244
244
|
throw result.error;
|
245
245
|
}
|
package/src/rp/index.ts
CHANGED
@@ -12,19 +12,14 @@ import {
|
|
12
12
|
verify,
|
13
13
|
type CryptoContext,
|
14
14
|
} from "@pagopa/io-react-native-jwt";
|
15
|
-
import {
|
16
|
-
QRCodePayload,
|
17
|
-
RequestObject,
|
18
|
-
RpEntityConfiguration,
|
19
|
-
type Presentation,
|
20
|
-
} from "./types";
|
15
|
+
import { QRCodePayload, RequestObject, type Presentation } from "./types";
|
21
16
|
|
22
17
|
import uuid from "react-native-uuid";
|
23
18
|
import type { JWK } from "@pagopa/io-react-native-jwt/lib/typescript/types";
|
24
19
|
import { disclose } from "../sd-jwt";
|
25
|
-
import { getEntityConfiguration as getGenericEntityConfiguration } from "../trust";
|
26
20
|
import { createDPopToken } from "../utils/dpop";
|
27
|
-
import {
|
21
|
+
import { RelyingPartyEntityConfiguration } from "../trust/types";
|
22
|
+
import * as WalletInstanceAttestation from "../wallet-instance-attestation";
|
28
23
|
|
29
24
|
/**
|
30
25
|
* Select a RSA public key from those provided by the RP to encrypt.
|
@@ -33,7 +28,9 @@ import { WalletInstanceAttestation } from "..";
|
|
33
28
|
* @returns A suitable public key with its compatible encryption algorithm
|
34
29
|
* @throws {NoSuitableKeysFoundInEntityConfiguration} If entity do not contain any public key suitable for encrypting
|
35
30
|
*/
|
36
|
-
const chooseRSAPublicKeyToEncrypt = (
|
31
|
+
const chooseRSAPublicKeyToEncrypt = (
|
32
|
+
entity: RelyingPartyEntityConfiguration
|
33
|
+
): JWK => {
|
37
34
|
const [usingRsa256] =
|
38
35
|
entity.payload.metadata.wallet_relying_party.jwks.filter(
|
39
36
|
(jwk) => jwk.use === "enc" && jwk.kty === "RSA"
|
@@ -49,17 +46,6 @@ const chooseRSAPublicKeyToEncrypt = (entity: RpEntityConfiguration): JWK => {
|
|
49
46
|
);
|
50
47
|
};
|
51
48
|
|
52
|
-
/**
|
53
|
-
* Obtain the relying party entity configuration.
|
54
|
-
*/
|
55
|
-
export const getEntityConfiguration =
|
56
|
-
({ appFetch = fetch }: { appFetch?: GlobalFetch["fetch"] } = {}) =>
|
57
|
-
async (relyingPartyBaseUrl: string): Promise<RpEntityConfiguration> => {
|
58
|
-
return getGenericEntityConfiguration(relyingPartyBaseUrl, {
|
59
|
-
appFetch: appFetch,
|
60
|
-
}).then(RpEntityConfiguration.parse);
|
61
|
-
};
|
62
|
-
|
63
49
|
/**
|
64
50
|
* Decode a QR code content to an authentication request url.
|
65
51
|
* @function
|
@@ -92,7 +78,7 @@ export const decodeAuthRequestQR = (qrcode: string): QRCodePayload => {
|
|
92
78
|
|
93
79
|
export type RequestObjectConf = {
|
94
80
|
requestObject: RequestObject;
|
95
|
-
rpEntityConfiguration:
|
81
|
+
rpEntityConfiguration: RelyingPartyEntityConfiguration;
|
96
82
|
walletInstanceAttestation: string;
|
97
83
|
};
|
98
84
|
|
@@ -111,7 +97,7 @@ export const getRequestObject =
|
|
111
97
|
async (
|
112
98
|
walletInstanceAttestation: string,
|
113
99
|
requestUri: string,
|
114
|
-
rpEntityConfiguration:
|
100
|
+
rpEntityConfiguration: RelyingPartyEntityConfiguration
|
115
101
|
): Promise<RequestObjectConf> => {
|
116
102
|
const signedWalletInstanceDPoP = await createDPopToken(
|
117
103
|
{
|
package/src/rp/types.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import { JWK } from "../utils/jwk";
|
2
1
|
import { UnixTime } from "../sd-jwt/types";
|
3
2
|
import * as z from "zod";
|
4
|
-
import { EntityConfiguration } from "../trust/types";
|
5
3
|
|
6
4
|
export type RequestObject = z.infer<typeof RequestObject>;
|
7
5
|
export const RequestObject = z.object({
|
@@ -27,28 +25,6 @@ export const RequestObject = z.object({
|
|
27
25
|
}),
|
28
26
|
});
|
29
27
|
|
30
|
-
/**
|
31
|
-
* EntityConfiguration plus the metadata specific for a Relying Party entity.
|
32
|
-
*/
|
33
|
-
export type RpEntityConfiguration = z.infer<typeof RpEntityConfiguration>;
|
34
|
-
export const RpEntityConfiguration = EntityConfiguration.and(
|
35
|
-
z.object({
|
36
|
-
payload: z.object({
|
37
|
-
metadata: z.object({
|
38
|
-
wallet_relying_party: z
|
39
|
-
.object({
|
40
|
-
application_type: z.string().optional(),
|
41
|
-
client_id: z.string().optional(),
|
42
|
-
client_name: z.string().optional(),
|
43
|
-
jwks: z.array(JWK),
|
44
|
-
contacts: z.array(z.string()).optional(),
|
45
|
-
})
|
46
|
-
.passthrough(),
|
47
|
-
}),
|
48
|
-
}),
|
49
|
-
})
|
50
|
-
);
|
51
|
-
|
52
28
|
export type QRCodePayload = z.infer<typeof QRCodePayload>;
|
53
29
|
export const QRCodePayload = z.object({
|
54
30
|
protocol: z.string(),
|
package/src/trust/index.ts
CHANGED
@@ -1,27 +1,82 @@
|
|
1
1
|
import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
WalletProviderEntityConfiguration,
|
4
|
+
TrustAnchorEntityConfiguration,
|
5
|
+
CredentialIssuerEntityConfiguration,
|
6
|
+
RelyingPartyEntityConfiguration,
|
7
|
+
EntityConfiguration,
|
8
|
+
} from "./types";
|
3
9
|
import { IoWalletError } from "../utils/errors";
|
4
10
|
import { verifyTrustChain } from "./chain";
|
5
11
|
|
6
12
|
export { verifyTrustChain };
|
7
13
|
|
8
14
|
/**
|
9
|
-
* Fetch and parse
|
15
|
+
* Fetch and parse the entity configuration document for a given federation entity.
|
16
|
+
* This is an inner method to serve public interfaces.
|
17
|
+
*
|
18
|
+
* To add another entity configuration type (example: Foo entity type):
|
19
|
+
* - create its zod schema and type by inherit from the base type (example: FooEntityConfiguration = BaseEntityConfiguration.and(...))
|
20
|
+
* - add such type to EntityConfiguration union
|
21
|
+
* - add an overload to this function
|
22
|
+
* - create a public function which use such type (example: getFooEntityConfiguration = (url, options) => Promise<FooEntityConfiguration>)
|
10
23
|
*
|
11
24
|
* @param entityBaseUrl The base url of the entity.
|
25
|
+
* @param schema The expected schema of the entity configuration, according to the kind of entity we are fetching from.
|
12
26
|
* @param options.appFetch An optional instance of the http client to be used.
|
13
27
|
* @returns The parsed entity configuration object
|
14
28
|
* @throws {IoWalletError} If the http request fails
|
15
29
|
* @throws Parse error if the document is not in the expected shape.
|
16
30
|
*/
|
17
|
-
|
31
|
+
async function fetchAndParseEntityConfiguration(
|
32
|
+
entityBaseUrl: string,
|
33
|
+
schema: typeof WalletProviderEntityConfiguration,
|
34
|
+
options?: {
|
35
|
+
appFetch?: GlobalFetch["fetch"];
|
36
|
+
}
|
37
|
+
): Promise<WalletProviderEntityConfiguration>;
|
38
|
+
async function fetchAndParseEntityConfiguration(
|
39
|
+
entityBaseUrl: string,
|
40
|
+
schema: typeof RelyingPartyEntityConfiguration,
|
41
|
+
options?: {
|
42
|
+
appFetch?: GlobalFetch["fetch"];
|
43
|
+
}
|
44
|
+
): Promise<RelyingPartyEntityConfiguration>;
|
45
|
+
async function fetchAndParseEntityConfiguration(
|
46
|
+
entityBaseUrl: string,
|
47
|
+
schema: typeof TrustAnchorEntityConfiguration,
|
48
|
+
options?: {
|
49
|
+
appFetch?: GlobalFetch["fetch"];
|
50
|
+
}
|
51
|
+
): Promise<TrustAnchorEntityConfiguration>;
|
52
|
+
async function fetchAndParseEntityConfiguration(
|
53
|
+
entityBaseUrl: string,
|
54
|
+
schema: typeof CredentialIssuerEntityConfiguration,
|
55
|
+
options?: {
|
56
|
+
appFetch?: GlobalFetch["fetch"];
|
57
|
+
}
|
58
|
+
): Promise<CredentialIssuerEntityConfiguration>;
|
59
|
+
async function fetchAndParseEntityConfiguration(
|
18
60
|
entityBaseUrl: string,
|
61
|
+
schema: typeof EntityConfiguration,
|
62
|
+
options?: {
|
63
|
+
appFetch?: GlobalFetch["fetch"];
|
64
|
+
}
|
65
|
+
): Promise<EntityConfiguration>;
|
66
|
+
async function fetchAndParseEntityConfiguration(
|
67
|
+
entityBaseUrl: string,
|
68
|
+
schema: /* FIXME: why is it different from "typeof EntityConfiguration"? */
|
69
|
+
| typeof CredentialIssuerEntityConfiguration
|
70
|
+
| typeof WalletProviderEntityConfiguration
|
71
|
+
| typeof RelyingPartyEntityConfiguration
|
72
|
+
| typeof TrustAnchorEntityConfiguration
|
73
|
+
| typeof EntityConfiguration,
|
19
74
|
{
|
20
75
|
appFetch = fetch,
|
21
76
|
}: {
|
22
77
|
appFetch?: GlobalFetch["fetch"];
|
23
78
|
} = {}
|
24
|
-
)
|
79
|
+
) {
|
25
80
|
const wellKnownUrl = `${entityBaseUrl}/.well-known/openid-federation`;
|
26
81
|
|
27
82
|
const response = await appFetch(wellKnownUrl, {
|
@@ -31,7 +86,7 @@ export async function getEntityConfiguration(
|
|
31
86
|
if (response.status === 200) {
|
32
87
|
const responseText = await response.text();
|
33
88
|
const responseJwt = decodeJwt(responseText);
|
34
|
-
return
|
89
|
+
return schema.parse({
|
35
90
|
header: responseJwt.protectedHeader,
|
36
91
|
payload: responseJwt.payload,
|
37
92
|
});
|
@@ -41,3 +96,49 @@ export async function getEntityConfiguration(
|
|
41
96
|
`Unable to obtain Entity Configuration at ${wellKnownUrl}. Response code: ${response.status}`
|
42
97
|
);
|
43
98
|
}
|
99
|
+
|
100
|
+
export const getWalletProviderEntityConfiguration = (
|
101
|
+
entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0],
|
102
|
+
options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]
|
103
|
+
) =>
|
104
|
+
fetchAndParseEntityConfiguration(
|
105
|
+
entityBaseUrl,
|
106
|
+
WalletProviderEntityConfiguration,
|
107
|
+
options
|
108
|
+
);
|
109
|
+
|
110
|
+
export const getCredentialIssuerEntityConfiguration = (
|
111
|
+
entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0],
|
112
|
+
options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]
|
113
|
+
) =>
|
114
|
+
fetchAndParseEntityConfiguration(
|
115
|
+
entityBaseUrl,
|
116
|
+
CredentialIssuerEntityConfiguration,
|
117
|
+
options
|
118
|
+
);
|
119
|
+
|
120
|
+
export const getTrustAnchorEntityConfiguration = (
|
121
|
+
entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0],
|
122
|
+
options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]
|
123
|
+
) =>
|
124
|
+
fetchAndParseEntityConfiguration(
|
125
|
+
entityBaseUrl,
|
126
|
+
TrustAnchorEntityConfiguration,
|
127
|
+
options
|
128
|
+
);
|
129
|
+
|
130
|
+
export const getRelyingPartyEntityConfiguration = (
|
131
|
+
entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0],
|
132
|
+
options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]
|
133
|
+
) =>
|
134
|
+
fetchAndParseEntityConfiguration(
|
135
|
+
entityBaseUrl,
|
136
|
+
RelyingPartyEntityConfiguration,
|
137
|
+
options
|
138
|
+
);
|
139
|
+
|
140
|
+
export const getEntityConfiguration = (
|
141
|
+
entityBaseUrl: Parameters<typeof fetchAndParseEntityConfiguration>[0],
|
142
|
+
options?: Parameters<typeof fetchAndParseEntityConfiguration>[2]
|
143
|
+
) =>
|
144
|
+
fetchAndParseEntityConfiguration(entityBaseUrl, EntityConfiguration, options);
|
package/src/trust/types.ts
CHANGED
@@ -5,6 +5,29 @@ import * as z from "zod";
|
|
5
5
|
export const TrustMark = z.object({ id: z.string(), trust_mark: z.string() });
|
6
6
|
export type TrustMark = z.infer<typeof TrustMark>;
|
7
7
|
|
8
|
+
// Display metadata for a credential, used by the issuer to
|
9
|
+
// instruct the Wallet Solution on how to render the credential correctly
|
10
|
+
type CredentialDisplayMetadata = z.infer<typeof CredentialDisplayMetadata>;
|
11
|
+
const CredentialDisplayMetadata = z.object({
|
12
|
+
name: z.string(),
|
13
|
+
locale: z.string(),
|
14
|
+
logo: z.object({
|
15
|
+
url: z.string(),
|
16
|
+
alt_text: z.string(),
|
17
|
+
}),
|
18
|
+
background_color: z.string(),
|
19
|
+
text_color: z.string(),
|
20
|
+
});
|
21
|
+
|
22
|
+
// Metadata for a credentia which i supported by a Issuer
|
23
|
+
type SupportedCredentialMetadata = z.infer<typeof SupportedCredentialMetadata>;
|
24
|
+
const SupportedCredentialMetadata = z.object({
|
25
|
+
format: z.literal("vc+sd-jwt"),
|
26
|
+
cryptographic_binding_methods_supported: z.array(z.string()),
|
27
|
+
cryptographic_suites_supported: z.array(z.string()),
|
28
|
+
display: z.array(CredentialDisplayMetadata),
|
29
|
+
});
|
30
|
+
|
8
31
|
export type EntityStatement = z.infer<typeof EntityStatement>;
|
9
32
|
export const EntityStatement = z.object({
|
10
33
|
header: z.object({
|
@@ -31,8 +54,8 @@ export const EntityConfigurationHeader = z.object({
|
|
31
54
|
kid: z.string(),
|
32
55
|
});
|
33
56
|
|
34
|
-
|
35
|
-
|
57
|
+
// Structuire common to every Entity Configuration document
|
58
|
+
const BaseEntityConfiguration = z.object({
|
36
59
|
header: EntityConfigurationHeader,
|
37
60
|
payload: z
|
38
61
|
.object({
|
@@ -65,7 +88,95 @@ export const EntityConfiguration = z.object({
|
|
65
88
|
.passthrough(),
|
66
89
|
});
|
67
90
|
|
91
|
+
// Entity configuration for a Trust Anchor (it has no specific metadata section)
|
68
92
|
export type TrustAnchorEntityConfiguration = z.infer<
|
69
93
|
typeof TrustAnchorEntityConfiguration
|
70
94
|
>;
|
71
|
-
export const TrustAnchorEntityConfiguration =
|
95
|
+
export const TrustAnchorEntityConfiguration = BaseEntityConfiguration;
|
96
|
+
|
97
|
+
// Entity configuration for a Credential Issuer
|
98
|
+
export type CredentialIssuerEntityConfiguration = z.infer<
|
99
|
+
typeof CredentialIssuerEntityConfiguration
|
100
|
+
>;
|
101
|
+
export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(
|
102
|
+
z.object({
|
103
|
+
payload: z.object({
|
104
|
+
jwks: z.object({ keys: z.array(JWK) }),
|
105
|
+
metadata: z.object({
|
106
|
+
openid_credential_issuer: z.object({
|
107
|
+
credential_issuer: z.string(),
|
108
|
+
authorization_endpoint: z.string(),
|
109
|
+
token_endpoint: z.string(),
|
110
|
+
pushed_authorization_request_endpoint: z.string(),
|
111
|
+
dpop_signing_alg_values_supported: z.array(z.string()),
|
112
|
+
credential_endpoint: z.string(),
|
113
|
+
credentials_supported: z.array(SupportedCredentialMetadata),
|
114
|
+
jwks: z.object({ keys: z.array(JWK) }),
|
115
|
+
}),
|
116
|
+
}),
|
117
|
+
}),
|
118
|
+
})
|
119
|
+
);
|
120
|
+
|
121
|
+
// Entity configuration for a Wallet Provider
|
122
|
+
export type WalletProviderEntityConfiguration = z.infer<
|
123
|
+
typeof WalletProviderEntityConfiguration
|
124
|
+
>;
|
125
|
+
export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(
|
126
|
+
z.object({
|
127
|
+
payload: z.object({
|
128
|
+
metadata: z.object({
|
129
|
+
wallet_provider: z
|
130
|
+
.object({
|
131
|
+
token_endpoint: z.string(),
|
132
|
+
attested_security_context_values_supported: z
|
133
|
+
.array(z.string())
|
134
|
+
.optional(),
|
135
|
+
grant_types_supported: z.array(z.string()),
|
136
|
+
token_endpoint_auth_methods_supported: z.array(z.string()),
|
137
|
+
token_endpoint_auth_signing_alg_values_supported: z.array(
|
138
|
+
z.string()
|
139
|
+
),
|
140
|
+
jwks: z.object({ keys: z.array(JWK) }),
|
141
|
+
})
|
142
|
+
.passthrough(),
|
143
|
+
}),
|
144
|
+
}),
|
145
|
+
})
|
146
|
+
);
|
147
|
+
|
148
|
+
// Entity configuration for a Relying Party
|
149
|
+
export type RelyingPartyEntityConfiguration = z.infer<
|
150
|
+
typeof RelyingPartyEntityConfiguration
|
151
|
+
>;
|
152
|
+
export const RelyingPartyEntityConfiguration = BaseEntityConfiguration.and(
|
153
|
+
z.object({
|
154
|
+
payload: z.object({
|
155
|
+
metadata: z.object({
|
156
|
+
wallet_relying_party: z
|
157
|
+
.object({
|
158
|
+
application_type: z.string().optional(),
|
159
|
+
client_id: z.string().optional(),
|
160
|
+
client_name: z.string().optional(),
|
161
|
+
jwks: z.array(JWK),
|
162
|
+
contacts: z.array(z.string()).optional(),
|
163
|
+
})
|
164
|
+
.passthrough(),
|
165
|
+
}),
|
166
|
+
}),
|
167
|
+
})
|
168
|
+
);
|
169
|
+
|
170
|
+
// Maps any entity configuration by the union of every possible shapes
|
171
|
+
export type EntityConfiguration = z.infer<typeof EntityConfiguration>;
|
172
|
+
export const EntityConfiguration = z.union(
|
173
|
+
[
|
174
|
+
WalletProviderEntityConfiguration,
|
175
|
+
CredentialIssuerEntityConfiguration,
|
176
|
+
TrustAnchorEntityConfiguration,
|
177
|
+
RelyingPartyEntityConfiguration,
|
178
|
+
],
|
179
|
+
{
|
180
|
+
description: "Any kind of Entity Configuration allowed in the ecosystem",
|
181
|
+
}
|
182
|
+
);
|