@pagopa/io-react-native-wallet 2.0.0-next.0 → 2.0.0-next.2
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/credential/issuance/02-evaluate-issuer-trust.js +2 -2
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +2 -2
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/trust/README.md +147 -0
- package/lib/commonjs/trust/build-chain.js +252 -0
- package/lib/commonjs/trust/build-chain.js.map +1 -0
- package/lib/commonjs/trust/errors.js +24 -1
- package/lib/commonjs/trust/errors.js.map +1 -1
- package/lib/commonjs/trust/index.js +11 -276
- package/lib/commonjs/trust/index.js.map +1 -1
- package/lib/commonjs/trust/utils.js +30 -1
- package/lib/commonjs/trust/utils.js.map +1 -1
- package/lib/commonjs/trust/{chain.js → verify-chain.js} +87 -15
- package/lib/commonjs/trust/verify-chain.js.map +1 -0
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +1 -1
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/trust/README.md +147 -0
- package/lib/module/trust/build-chain.js +235 -0
- package/lib/module/trust/build-chain.js.map +1 -0
- package/lib/module/trust/errors.js +23 -2
- package/lib/module/trust/errors.js.map +1 -1
- package/lib/module/trust/index.js +5 -262
- package/lib/module/trust/index.js.map +1 -1
- package/lib/module/trust/utils.js +27 -0
- package/lib/module/trust/utils.js.map +1 -1
- package/lib/module/trust/{chain.js → verify-chain.js} +85 -14
- package/lib/module/trust/verify-chain.js.map +1 -0
- package/lib/module/utils/errors.js +1 -1
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +1 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +2 -2
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/status/types.d.ts +6 -6
- package/lib/typescript/sd-jwt/index.d.ts +12 -12
- package/lib/typescript/sd-jwt/types.d.ts +6 -6
- package/lib/typescript/trust/build-chain.d.ts +1284 -0
- package/lib/typescript/trust/build-chain.d.ts.map +1 -0
- package/lib/typescript/trust/errors.d.ts +22 -0
- package/lib/typescript/trust/errors.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +5 -1299
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +54 -54
- package/lib/typescript/trust/utils.d.ts +10 -0
- package/lib/typescript/trust/utils.d.ts.map +1 -1
- package/lib/typescript/trust/verify-chain.d.ts +39 -0
- package/lib/typescript/trust/verify-chain.d.ts.map +1 -0
- package/lib/typescript/utils/errors.d.ts +2 -2
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +21 -21
- package/package.json +2 -2
- package/src/credential/issuance/02-evaluate-issuer-trust.ts +1 -1
- package/src/credential/presentation/02-evaluate-rp-trust.ts +1 -1
- package/src/credential/presentation/05-verify-request-object.ts +1 -1
- package/src/credential/presentation/08-send-authorization-response.ts +4 -4
- package/src/trust/README.md +147 -0
- package/src/trust/build-chain.ts +395 -0
- package/src/trust/errors.ts +32 -1
- package/src/trust/index.ts +5 -435
- package/src/trust/utils.ts +35 -0
- package/src/trust/{chain.ts → verify-chain.ts} +132 -16
- package/src/utils/errors.ts +4 -4
- package/lib/commonjs/trust/chain.js.map +0 -1
- package/lib/module/trust/chain.js.map +0 -1
- package/lib/typescript/trust/chain.d.ts +0 -21
- package/lib/typescript/trust/chain.d.ts.map +0 -1
@@ -3,280 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
7
|
-
|
8
|
-
exports.
|
9
|
-
|
10
|
-
exports.
|
11
|
-
|
12
|
-
exports.
|
13
|
-
|
14
|
-
exports.
|
15
|
-
|
16
|
-
var
|
17
|
-
var _types = require("./types");
|
18
|
-
var _chain = require("./chain");
|
19
|
-
var _misc = require("../utils/misc");
|
20
|
-
var _errors = require("./errors");
|
21
|
-
/**
|
22
|
-
* Verify a given trust chain is actually valid.
|
23
|
-
* It can handle fast chain renewal, which means we try to fetch a fresh version of each statement.
|
24
|
-
*
|
25
|
-
* @param trustAnchorEntity The entity configuration of the known trust anchor
|
26
|
-
* @param chain The chain of statements to be validated
|
27
|
-
* @param renewOnFail Whether to renew the provided chain if the validation fails at first. Default: true
|
28
|
-
* @param appFetch Fetch api implementation. Default: the built-in implementation
|
29
|
-
* @returns The result of the chain validation
|
30
|
-
* @throws {FederationError} If the chain is not valid
|
31
|
-
*/
|
32
|
-
async function verifyTrustChain(trustAnchorEntity, chain) {
|
33
|
-
let {
|
34
|
-
appFetch = fetch,
|
35
|
-
renewOnFail = true
|
36
|
-
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
37
|
-
try {
|
38
|
-
return (0, _chain.validateTrustChain)(trustAnchorEntity, chain);
|
39
|
-
} catch (error) {
|
40
|
-
if (renewOnFail) {
|
41
|
-
const renewedChain = await (0, _chain.renewTrustChain)(chain, appFetch);
|
42
|
-
return (0, _chain.validateTrustChain)(trustAnchorEntity, renewedChain);
|
43
|
-
} else {
|
44
|
-
throw error;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
/**
|
50
|
-
* Fetch the signed entity configuration token for an entity
|
51
|
-
*
|
52
|
-
* @param entityBaseUrl The url of the entity to fetch
|
53
|
-
* @param appFetch (optional) fetch api implementation
|
54
|
-
* @returns The signed Entity Configuration token
|
55
|
-
*/
|
56
|
-
async function getSignedEntityConfiguration(entityBaseUrl) {
|
57
|
-
let {
|
58
|
-
appFetch = fetch
|
59
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
60
|
-
const wellKnownUrl = `${entityBaseUrl}/.well-known/openid-federation`;
|
61
|
-
return await appFetch(wellKnownUrl, {
|
62
|
-
method: "GET"
|
63
|
-
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.text());
|
64
|
-
}
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Fetch and parse the entity configuration document for a given federation entity.
|
68
|
-
* This is an inner method to serve public interfaces.
|
69
|
-
*
|
70
|
-
* To add another entity configuration type (example: Foo entity type):
|
71
|
-
* - create its zod schema and type by inherit from the base type (example: FooEntityConfiguration = BaseEntityConfiguration.and(...))
|
72
|
-
* - add such type to EntityConfiguration union
|
73
|
-
* - add an overload to this function
|
74
|
-
* - create a public function which use such type (example: getFooEntityConfiguration = (url, options) => Promise<FooEntityConfiguration>)
|
75
|
-
*
|
76
|
-
* @param entityBaseUrl The base url of the entity.
|
77
|
-
* @param schema The expected schema of the entity configuration, according to the kind of entity we are fetching from.
|
78
|
-
* @param options An optional object with additional options.
|
79
|
-
* @param options.appFetch An optional instance of the http client to be used.
|
80
|
-
* @returns The parsed entity configuration object
|
81
|
-
* @throws {IoWalletError} If the http request fails
|
82
|
-
* @throws Parse error if the document is not in the expected shape.
|
83
|
-
*/
|
84
|
-
|
85
|
-
async function fetchAndParseEntityConfiguration(entityBaseUrl, schema) {
|
86
|
-
let {
|
87
|
-
appFetch = fetch
|
88
|
-
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
89
|
-
const responseText = await getSignedEntityConfiguration(entityBaseUrl, {
|
90
|
-
appFetch
|
91
|
-
});
|
92
|
-
const responseJwt = (0, _ioReactNativeJwt.decode)(responseText);
|
93
|
-
return schema.parse({
|
94
|
-
header: responseJwt.protectedHeader,
|
95
|
-
payload: responseJwt.payload
|
96
|
-
});
|
97
|
-
}
|
98
|
-
const getWalletProviderEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.WalletProviderEntityConfiguration, options);
|
99
|
-
exports.getWalletProviderEntityConfiguration = getWalletProviderEntityConfiguration;
|
100
|
-
const getCredentialIssuerEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.CredentialIssuerEntityConfiguration, options);
|
101
|
-
exports.getCredentialIssuerEntityConfiguration = getCredentialIssuerEntityConfiguration;
|
102
|
-
const getTrustAnchorEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.TrustAnchorEntityConfiguration, options);
|
103
|
-
exports.getTrustAnchorEntityConfiguration = getTrustAnchorEntityConfiguration;
|
104
|
-
const getRelyingPartyEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.RelyingPartyEntityConfiguration, options);
|
105
|
-
exports.getRelyingPartyEntityConfiguration = getRelyingPartyEntityConfiguration;
|
106
|
-
const getEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, _types.EntityConfiguration, options);
|
107
|
-
|
108
|
-
/**
|
109
|
-
* Fetch and parse the entity statement document for a given federation entity.
|
110
|
-
*
|
111
|
-
* @param accreditationBodyBaseUrl The base url of the accreditation body which holds and signs the required entity statement
|
112
|
-
* @param subordinatedEntityBaseUrl The url that identifies the subordinate entity
|
113
|
-
* @param appFetch An optional instance of the http client to be used.
|
114
|
-
* @returns The parsed entity configuration object
|
115
|
-
* @throws {IoWalletError} If the http request fails
|
116
|
-
*/
|
117
|
-
exports.getEntityConfiguration = getEntityConfiguration;
|
118
|
-
async function getEntityStatement(accreditationBodyBaseUrl, subordinatedEntityBaseUrl) {
|
119
|
-
let {
|
120
|
-
appFetch = fetch
|
121
|
-
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
122
|
-
const responseText = await getSignedEntityStatement(accreditationBodyBaseUrl, subordinatedEntityBaseUrl, {
|
123
|
-
appFetch
|
124
|
-
});
|
125
|
-
const responseJwt = (0, _ioReactNativeJwt.decode)(responseText);
|
126
|
-
return _types.EntityStatement.parse({
|
127
|
-
header: responseJwt.protectedHeader,
|
128
|
-
payload: responseJwt.payload
|
129
|
-
});
|
130
|
-
}
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Fetch the entity statement document for a given federation entity.
|
134
|
-
*
|
135
|
-
* @param federationFetchEndpoint The exact endpoint provided by the parent EC's metadata.
|
136
|
-
* @param subordinatedEntityBaseUrl The url that identifies the subordinate entity.
|
137
|
-
* @param appFetch An optional instance of the http client to be used.
|
138
|
-
* @returns The signed entity statement token.
|
139
|
-
* @throws {IoWalletError} If the http request fails.
|
140
|
-
*/
|
141
|
-
async function getSignedEntityStatement(federationFetchEndpoint, subordinatedEntityBaseUrl) {
|
142
|
-
let {
|
143
|
-
appFetch = fetch
|
144
|
-
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
145
|
-
const url = new URL(federationFetchEndpoint);
|
146
|
-
url.searchParams.set("sub", subordinatedEntityBaseUrl);
|
147
|
-
return await appFetch(url.toString(), {
|
148
|
-
method: "GET"
|
149
|
-
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.text());
|
150
|
-
}
|
151
|
-
|
152
|
-
/**
|
153
|
-
* Fetch the federation list document from a given endpoint.
|
154
|
-
*
|
155
|
-
* @param federationListEndpoint The URL of the federation list endpoint.
|
156
|
-
* @param appFetch An optional instance of the http client to be used.
|
157
|
-
* @returns The federation list as an array of strings.
|
158
|
-
* @throws {IoWalletError} If the HTTP request fails.
|
159
|
-
* @throws {FederationError} If the result is not in the expected format.
|
160
|
-
*/
|
161
|
-
async function getFederationList(federationListEndpoint) {
|
162
|
-
let {
|
163
|
-
appFetch = fetch
|
164
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
165
|
-
return await appFetch(federationListEndpoint, {
|
166
|
-
method: "GET"
|
167
|
-
}).then((0, _misc.hasStatusOrThrow)(200)).then(res => res.json()).then(json => {
|
168
|
-
const result = _types.FederationListResponse.safeParse(json);
|
169
|
-
if (!result.success) {
|
170
|
-
throw new _errors.FederationListParseError(`Invalid federation list format received from ${federationListEndpoint}. Error: ${result.error.message}`, {
|
171
|
-
url: federationListEndpoint,
|
172
|
-
parseError: result.error.toString()
|
173
|
-
});
|
174
|
-
}
|
175
|
-
return result.data;
|
176
|
-
});
|
177
|
-
}
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Build a not-verified trust chain for a given Relying Party (RP) entity.
|
181
|
-
*
|
182
|
-
* @param relyingPartyEntityBaseUrl The base URL of the RP entity
|
183
|
-
* @param trustAnchorKey The public key of the Trust Anchor (TA) entity
|
184
|
-
* @param appFetch An optional instance of the http client to be used.
|
185
|
-
* @returns A list of signed tokens that represent the trust chain, in the order of the chain (from the RP to the Trust Anchor)
|
186
|
-
* @throws {FederationError} When an element of the chain fails to parse or other build steps fail.
|
187
|
-
*/
|
188
|
-
async function buildTrustChain(relyingPartyEntityBaseUrl, trustAnchorKey) {
|
189
|
-
let appFetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : fetch;
|
190
|
-
// 1: Recursively gather the trust chain from the RP up to the Trust Anchor
|
191
|
-
const trustChain = await gatherTrustChain(relyingPartyEntityBaseUrl, appFetch);
|
192
|
-
|
193
|
-
// 2: Trust Anchor signature verification
|
194
|
-
const trustAnchorJwt = trustChain[trustChain.length - 1];
|
195
|
-
if (!trustAnchorJwt) {
|
196
|
-
throw new _errors.BuildTrustChainError("Cannot verify trust anchor: missing entity configuration in gathered chain.", {
|
197
|
-
relyingPartyUrl: relyingPartyEntityBaseUrl
|
198
|
-
});
|
199
|
-
}
|
200
|
-
if (!trustAnchorKey.kid) {
|
201
|
-
throw new _errors.TrustAnchorKidMissingError();
|
202
|
-
}
|
203
|
-
await (0, _utils.verify)(trustAnchorJwt, trustAnchorKey.kid, [trustAnchorKey]);
|
204
|
-
|
205
|
-
// 3: Check the federation list
|
206
|
-
const trustAnchorConfig = _types.EntityConfiguration.parse((0, _utils.decode)(trustAnchorJwt));
|
207
|
-
const federationListEndpoint = trustAnchorConfig.payload.metadata.federation_entity.federation_list_endpoint;
|
208
|
-
if (federationListEndpoint) {
|
209
|
-
const federationList = await getFederationList(federationListEndpoint, {
|
210
|
-
appFetch
|
211
|
-
});
|
212
|
-
if (!federationList.includes(relyingPartyEntityBaseUrl)) {
|
213
|
-
throw new _errors.RelyingPartyNotAuthorizedError("Relying Party entity base URL is not authorized by the Trust Anchor's federation list.", {
|
214
|
-
relyingPartyUrl: relyingPartyEntityBaseUrl,
|
215
|
-
federationListEndpoint
|
216
|
-
});
|
217
|
-
}
|
218
|
-
}
|
219
|
-
return trustChain;
|
220
|
-
}
|
221
|
-
|
222
|
-
/**
|
223
|
-
* Recursively gather the trust chain for an entity and all its superiors.
|
224
|
-
* @param entityBaseUrl The base URL of the entity for which to gather the chain.
|
225
|
-
* @param appFetch An optional instance of the http client to be used.
|
226
|
-
* @param isLeaf Whether the current entity is the leaf of the chain.
|
227
|
-
* @returns A full ordered list of JWTs (ECs and ESs) forming the trust chain.
|
228
|
-
* @throws {FederationError} If any of the fetched documents fail to parse or other errors occur during the gathering process.
|
229
|
-
*/
|
230
|
-
async function gatherTrustChain(entityBaseUrl, appFetch) {
|
231
|
-
let isLeaf = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
232
|
-
const chain = [];
|
233
|
-
|
234
|
-
// Fetch self-signed EC (only needed for the leaf)
|
235
|
-
const entityECJwt = await getSignedEntityConfiguration(entityBaseUrl, {
|
236
|
-
appFetch
|
237
|
-
});
|
238
|
-
const entityEC = _types.EntityConfiguration.parse((0, _utils.decode)(entityECJwt));
|
239
|
-
if (isLeaf) {
|
240
|
-
// Only push EC for the leaf
|
241
|
-
chain.push(entityECJwt);
|
242
|
-
}
|
243
|
-
|
244
|
-
// Find authority_hints (parent, if any)
|
245
|
-
const authorityHints = entityEC.payload.authority_hints ?? [];
|
246
|
-
if (authorityHints.length === 0) {
|
247
|
-
// This is the Trust Anchor (no parent)
|
248
|
-
if (!isLeaf) {
|
249
|
-
chain.push(entityECJwt);
|
250
|
-
}
|
251
|
-
return chain;
|
252
|
-
}
|
253
|
-
const parentEntityBaseUrl = authorityHints[0];
|
254
|
-
|
255
|
-
// Fetch parent EC
|
256
|
-
const parentECJwt = await getSignedEntityConfiguration(parentEntityBaseUrl, {
|
257
|
-
appFetch
|
258
|
-
});
|
259
|
-
const parentEC = _types.EntityConfiguration.parse((0, _utils.decode)(parentECJwt));
|
260
|
-
|
261
|
-
// Fetch ES
|
262
|
-
const federationFetchEndpoint = parentEC.payload.metadata.federation_entity.federation_fetch_endpoint;
|
263
|
-
if (!federationFetchEndpoint) {
|
264
|
-
throw new _errors.MissingFederationFetchEndpointError(`Missing federation_fetch_endpoint in parent's (${parentEntityBaseUrl}) configuration when gathering chain for ${entityBaseUrl}.`, {
|
265
|
-
entityBaseUrl,
|
266
|
-
missingInEntityUrl: parentEntityBaseUrl
|
267
|
-
});
|
268
|
-
}
|
269
|
-
const entityStatementJwt = await getSignedEntityStatement(federationFetchEndpoint, entityBaseUrl, {
|
270
|
-
appFetch
|
271
|
-
});
|
272
|
-
// Validate the ES
|
273
|
-
_types.EntityStatement.parse((0, _utils.decode)(entityStatementJwt));
|
274
|
-
|
275
|
-
// Push this ES into the chain
|
276
|
-
chain.push(entityStatementJwt);
|
277
|
-
|
278
|
-
// Recurse into the parent
|
279
|
-
const parentChain = await gatherTrustChain(parentEntityBaseUrl, appFetch, false);
|
280
|
-
return chain.concat(parentChain);
|
281
|
-
}
|
6
|
+
exports.Verify = exports.Types = exports.Errors = exports.Build = void 0;
|
7
|
+
var Build = _interopRequireWildcard(require("./build-chain"));
|
8
|
+
exports.Build = Build;
|
9
|
+
var Verify = _interopRequireWildcard(require("./verify-chain"));
|
10
|
+
exports.Verify = Verify;
|
11
|
+
var Errors = _interopRequireWildcard(require("./errors"));
|
12
|
+
exports.Errors = Errors;
|
13
|
+
var Types = _interopRequireWildcard(require("./types"));
|
14
|
+
exports.Types = Types;
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
282
17
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["Build","_interopRequireWildcard","require","exports","Verify","Errors","Types","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../../src","sources":["trust/index.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuCC,OAAA,CAAAH,KAAA,GAAAA,KAAA;AACvC,IAAAI,MAAA,GAAAH,uBAAA,CAAAC,OAAA;AAAyCC,OAAA,CAAAC,MAAA,GAAAA,MAAA;AACzC,IAAAC,MAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAmCC,OAAA,CAAAE,MAAA,GAAAA,MAAA;AACnC,IAAAC,KAAA,GAAAL,uBAAA,CAAAC,OAAA;AAAiCC,OAAA,CAAAG,KAAA,GAAAA,KAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
@@ -3,8 +3,11 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.decode = void 0;
|
7
|
+
exports.getTrustAnchorX509Certificate = getTrustAnchorX509Certificate;
|
8
|
+
exports.verify = void 0;
|
7
9
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
10
|
+
var _errors = require("./errors");
|
8
11
|
// Verify a token signature
|
9
12
|
// The kid is extracted from the token header
|
10
13
|
const verify = async (token, kid, jwks) => {
|
@@ -37,5 +40,31 @@ const decode = token => {
|
|
37
40
|
payload
|
38
41
|
};
|
39
42
|
};
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Extracts the X.509 Trust Anchor certificate (Base64 encoded) from the
|
46
|
+
* Trust Anchor's Entity Configuration.
|
47
|
+
*
|
48
|
+
* @param trustAnchorEntity The entity configuration of the known trust anchor.
|
49
|
+
* @returns The Base64 encoded X.509 certificate string.
|
50
|
+
* @throws {FederationError} If the certificate cannot be derived.
|
51
|
+
*/
|
40
52
|
exports.decode = decode;
|
53
|
+
function getTrustAnchorX509Certificate(trustAnchorEntity) {
|
54
|
+
const taHeaderKid = trustAnchorEntity.header.kid;
|
55
|
+
const taSigningJwk = trustAnchorEntity.payload.jwks.keys.find(key => key.kid === taHeaderKid);
|
56
|
+
if (!taSigningJwk) {
|
57
|
+
throw new _errors.FederationError(`Cannot derive X.509 Trust Anchor certificate: JWK with kid '${taHeaderKid}' not found in Trust Anchor's JWKS.`, {
|
58
|
+
trustAnchorKid: taHeaderKid,
|
59
|
+
reason: "JWK not found for header kid"
|
60
|
+
});
|
61
|
+
}
|
62
|
+
if (taSigningJwk.x5c && taSigningJwk.x5c.length > 0 && taSigningJwk.x5c[0]) {
|
63
|
+
return taSigningJwk.x5c[0];
|
64
|
+
}
|
65
|
+
throw new _errors.FederationError(`Cannot derive X.509 Trust Anchor certificate: JWK with kid '${taHeaderKid}' does not contain a valid 'x5c' certificate array.`, {
|
66
|
+
trustAnchorKid: taHeaderKid,
|
67
|
+
reason: "Missing or empty x5c in JWK"
|
68
|
+
});
|
69
|
+
}
|
41
70
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","verify","token","kid","jwks","jwk","find","k","Error","protectedHeader","header","payload","verifyJwt","exports","decode","decodeJwt"],"sourceRoot":"../../../src","sources":["trust/utils.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_errors","verify","token","kid","jwks","jwk","find","k","Error","protectedHeader","header","payload","verifyJwt","exports","decode","decodeJwt","getTrustAnchorX509Certificate","trustAnchorEntity","taHeaderKid","taSigningJwk","keys","key","FederationError","trustAnchorKid","reason","x5c","length"],"sourceRoot":"../../../src","sources":["trust/utils.ts"],"mappings":";;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,OAAA,GAAAD,OAAA;AAQA;AACA;AACO,MAAME,MAAM,GAAG,MAAAA,CACpBC,KAAa,EACbC,GAAW,EACXC,IAAW,KACc;EACzB,MAAMC,GAAG,GAAGD,IAAI,CAACE,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACJ,GAAG,KAAKA,GAAG,CAAC;EAC3C,IAAI,CAACE,GAAG,EAAE;IACR,MAAM,IAAIG,KAAK,CAAE,gBAAeL,GAAI,YAAWD,KAAM,EAAC,CAAC;EACzD;EACA,MAAM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AACH"}
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.renewTrustChain = renewTrustChain;
|
7
7
|
exports.validateTrustChain = validateTrustChain;
|
8
|
+
exports.verifyTrustChain = verifyTrustChain;
|
8
9
|
var _types = require("./types");
|
9
10
|
var z = _interopRequireWildcard(require("zod"));
|
10
|
-
var _ = require(".");
|
11
11
|
var _utils = require("./utils");
|
12
12
|
var _errors = require("./errors");
|
13
|
+
var _ioReactNativeCrypto = require("@pagopa/io-react-native-crypto");
|
14
|
+
var _buildChain = require("./build-chain");
|
13
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
14
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
15
17
|
// The first element of the chain is supposed to be the Entity Configuration for the document issuer
|
@@ -21,14 +23,15 @@ const MiddleElementShape = _types.EntityStatement;
|
|
21
23
|
const LastElementShape = z.union([_types.EntityStatement, _types.TrustAnchorEntityConfiguration]);
|
22
24
|
|
23
25
|
/**
|
24
|
-
* Validates a provided trust chain against a known trust
|
26
|
+
* Validates a provided trust chain against a known trust anchor, including X.509 certificate checks.
|
25
27
|
*
|
26
|
-
* @param trustAnchorEntity The entity configuration of the known trust anchor
|
27
|
-
* @param chain The chain of statements to be validated
|
28
|
-
* @
|
29
|
-
* @
|
28
|
+
* @param trustAnchorEntity The entity configuration of the known trust anchor (for JWT validation).
|
29
|
+
* @param chain The chain of statements to be validated.
|
30
|
+
* @param x509Options Options for X.509 certificate validation.
|
31
|
+
* @returns The list of parsed tokens representing the chain.
|
32
|
+
* @throws {FederationError} If the chain is not valid (JWT or X.509). Specific errors like TrustChainEmptyError, X509ValidationError may be thrown.
|
30
33
|
*/
|
31
|
-
async function validateTrustChain(trustAnchorEntity, chain) {
|
34
|
+
async function validateTrustChain(trustAnchorEntity, chain, x509Options) {
|
32
35
|
// If the chain is empty, fail
|
33
36
|
if (chain.length === 0) {
|
34
37
|
throw new _errors.TrustChainEmptyError("Cannot verify empty trust chain.");
|
@@ -37,7 +40,7 @@ async function validateTrustChain(trustAnchorEntity, chain) {
|
|
37
40
|
// Select the expected token shape
|
38
41
|
const selectTokenShape = elementIndex => elementIndex === 0 ? FirstElementShape : elementIndex === chain.length - 1 ? LastElementShape : MiddleElementShape;
|
39
42
|
|
40
|
-
//
|
43
|
+
// Select the kid from the current index
|
41
44
|
const selectKid = currentIndex => {
|
42
45
|
const token = chain[currentIndex];
|
43
46
|
if (!token) {
|
@@ -49,8 +52,8 @@ async function validateTrustChain(trustAnchorEntity, chain) {
|
|
49
52
|
return shape.parse((0, _utils.decode)(token)).header.kid;
|
50
53
|
};
|
51
54
|
|
52
|
-
//
|
53
|
-
//
|
55
|
+
// Select keys from the next token
|
56
|
+
// If the current token is the last, keys from trust anchor will be used
|
54
57
|
const selectKeys = currentIndex => {
|
55
58
|
if (currentIndex === chain.length - 1) {
|
56
59
|
return trustAnchorEntity.payload.jwks.keys;
|
@@ -65,10 +68,45 @@ async function validateTrustChain(trustAnchorEntity, chain) {
|
|
65
68
|
const shape = selectTokenShape(nextIndex);
|
66
69
|
return shape.parse((0, _utils.decode)(nextToken)).payload.jwks.keys;
|
67
70
|
};
|
71
|
+
const x509TrustAnchorCertBase64 = (0, _utils.getTrustAnchorX509Certificate)(trustAnchorEntity);
|
68
72
|
|
69
73
|
// Iterate the chain and validate each element's signature against the public keys of its next
|
70
74
|
// If there is no next, hence it's the end of the chain, and it must be verified by the Trust Anchor
|
71
|
-
|
75
|
+
const validationPromises = chain.map(async (tokenString, i) => {
|
76
|
+
const kidFromTokenHeader = selectKid(i);
|
77
|
+
const signerJwks = selectKeys(i);
|
78
|
+
|
79
|
+
// Step 1: Verify JWT signature
|
80
|
+
const parsedToken = await (0, _utils.verify)(tokenString, kidFromTokenHeader, signerJwks);
|
81
|
+
|
82
|
+
// Step 2: X.509 Certificate Chain Validation
|
83
|
+
const jwkUsedForVerification = signerJwks.find(k => k.kid === kidFromTokenHeader);
|
84
|
+
if (!jwkUsedForVerification) {
|
85
|
+
throw new _errors.FederationError(`JWK with kid '${kidFromTokenHeader}' was not found in signer's JWKS for token at index ${i}, though JWT verification passed.`, {
|
86
|
+
tokenIndex: i,
|
87
|
+
kid: kidFromTokenHeader
|
88
|
+
});
|
89
|
+
}
|
90
|
+
if (!jwkUsedForVerification.x5c || jwkUsedForVerification.x5c.length === 0) {
|
91
|
+
throw new _errors.MissingX509CertsError(`JWK with kid '${kidFromTokenHeader}' does not contain an X.509 certificate chain (x5c) for token at index ${i}.`);
|
92
|
+
}
|
93
|
+
|
94
|
+
// If the chain has more than one certificate AND
|
95
|
+
// the last certificate in the x5c chain is the same as the trust anchor,
|
96
|
+
// remove the anchor from the chain being passed, as it's supplied separately.
|
97
|
+
const certChainBase64 = jwkUsedForVerification.x5c.length > 1 && jwkUsedForVerification.x5c.at(-1) === x509TrustAnchorCertBase64 ? jwkUsedForVerification.x5c.slice(0, -1) : jwkUsedForVerification.x5c;
|
98
|
+
const x509ValidationResult = await (0, _ioReactNativeCrypto.verifyCertificateChain)(certChainBase64, x509TrustAnchorCertBase64, x509Options);
|
99
|
+
if (!x509ValidationResult.isValid) {
|
100
|
+
throw new _errors.X509ValidationError(`X.509 certificate chain validation failed for token at index ${i} (kid: ${kidFromTokenHeader}). Status: ${x509ValidationResult.validationStatus}. Error: ${x509ValidationResult.errorMessage}`, {
|
101
|
+
tokenIndex: i,
|
102
|
+
kid: kidFromTokenHeader,
|
103
|
+
x509ValidationStatus: x509ValidationResult.validationStatus,
|
104
|
+
x509ErrorMessage: x509ValidationResult.errorMessage
|
105
|
+
});
|
106
|
+
}
|
107
|
+
return parsedToken;
|
108
|
+
});
|
109
|
+
return Promise.all(validationPromises);
|
72
110
|
}
|
73
111
|
|
74
112
|
/**
|
@@ -86,14 +124,14 @@ async function renewTrustChain(chain) {
|
|
86
124
|
const entityStatementResult = _types.EntityStatement.safeParse(decoded);
|
87
125
|
const entityConfigurationResult = _types.EntityConfiguration.safeParse(decoded);
|
88
126
|
if (entityConfigurationResult.success) {
|
89
|
-
return (0,
|
127
|
+
return (0, _buildChain.getSignedEntityConfiguration)(entityConfigurationResult.data.payload.iss, {
|
90
128
|
appFetch
|
91
129
|
});
|
92
130
|
}
|
93
131
|
if (entityStatementResult.success) {
|
94
132
|
const entityStatement = entityStatementResult.data;
|
95
133
|
const parentBaseUrl = entityStatement.payload.iss;
|
96
|
-
const parentECJwt = await (0,
|
134
|
+
const parentECJwt = await (0, _buildChain.getSignedEntityConfiguration)(parentBaseUrl, {
|
97
135
|
appFetch
|
98
136
|
});
|
99
137
|
const parentEC = _types.EntityConfiguration.parse((0, _utils.decode)(parentECJwt));
|
@@ -104,7 +142,7 @@ async function renewTrustChain(chain) {
|
|
104
142
|
missingInEntityUrl: parentBaseUrl
|
105
143
|
});
|
106
144
|
}
|
107
|
-
return (0,
|
145
|
+
return (0, _buildChain.getSignedEntityStatement)(federationFetchEndpoint, entityStatement.payload.sub, {
|
108
146
|
appFetch
|
109
147
|
});
|
110
148
|
}
|
@@ -113,4 +151,38 @@ async function renewTrustChain(chain) {
|
|
113
151
|
});
|
114
152
|
}));
|
115
153
|
}
|
116
|
-
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Verify a given trust chain is actually valid.
|
157
|
+
* It can handle fast chain renewal, which means we try to fetch a fresh version of each statement.
|
158
|
+
*
|
159
|
+
* @param trustAnchorEntity The entity configuration of the known trust anchor
|
160
|
+
* @param chain The chain of statements to be validated
|
161
|
+
* @param x509Options Options for the verification process
|
162
|
+
* @param appFetch (optional) fetch api implementation
|
163
|
+
* @param renewOnFail Whether to attempt to renew the trust chain if the initial validation fails
|
164
|
+
* @returns The result of the chain validation
|
165
|
+
* @throws {FederationError} If the chain is not valid
|
166
|
+
*/
|
167
|
+
async function verifyTrustChain(trustAnchorEntity, chain) {
|
168
|
+
let x509Options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
169
|
+
connectTimeout: 10000,
|
170
|
+
readTimeout: 10000,
|
171
|
+
requireCrl: true
|
172
|
+
};
|
173
|
+
let {
|
174
|
+
appFetch = fetch,
|
175
|
+
renewOnFail = true
|
176
|
+
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
177
|
+
try {
|
178
|
+
return validateTrustChain(trustAnchorEntity, chain, x509Options);
|
179
|
+
} catch (error) {
|
180
|
+
if (renewOnFail) {
|
181
|
+
const renewedChain = await renewTrustChain(chain, appFetch);
|
182
|
+
return validateTrustChain(trustAnchorEntity, renewedChain, x509Options);
|
183
|
+
} else {
|
184
|
+
throw error;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
188
|
+
//# sourceMappingURL=verify-chain.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_types","require","z","_interopRequireWildcard","_utils","_errors","_ioReactNativeCrypto","_buildChain","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","FirstElementShape","EntityConfiguration","MiddleElementShape","EntityStatement","LastElementShape","union","TrustAnchorEntityConfiguration","validateTrustChain","trustAnchorEntity","chain","x509Options","length","TrustChainEmptyError","selectTokenShape","elementIndex","selectKid","currentIndex","token","TrustChainTokenMissingError","index","shape","parse","decode","header","kid","selectKeys","payload","jwks","keys","nextIndex","nextToken","x509TrustAnchorCertBase64","getTrustAnchorX509Certificate","validationPromises","map","tokenString","i","kidFromTokenHeader","signerJwks","parsedToken","verify","jwkUsedForVerification","find","k","FederationError","tokenIndex","x5c","MissingX509CertsError","certChainBase64","at","slice","x509ValidationResult","verifyCertificateChain","isValid","X509ValidationError","validationStatus","errorMessage","x509ValidationStatus","x509ErrorMessage","Promise","all","renewTrustChain","appFetch","arguments","undefined","fetch","decoded","entityStatementResult","safeParse","entityConfigurationResult","success","getSignedEntityConfiguration","data","iss","entityStatement","parentBaseUrl","parentECJwt","parentEC","federationFetchEndpoint","metadata","federation_entity","federation_fetch_endpoint","MissingFederationFetchEndpointError","sub","entityBaseUrl","missingInEntityUrl","getSignedEntityStatement","TrustChainRenewalError","originalChain","verifyTrustChain","connectTimeout","readTimeout","requireCrl","renewOnFail","error","renewedChain"],"sourceRoot":"../../../src","sources":["trust/verify-chain.ts"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAJ,OAAA;AASA,IAAAK,oBAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAGuB,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA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W,CAAC;EAClE,CAAC,CAAC,OAAOoF,KAAK,EAAE;IACd,IAAID,WAAW,EAAE;MACf,MAAME,YAAY,GAAG,MAAMlC,eAAe,CAACpD,KAAK,EAAEqD,QAAQ,CAAC;MAC3D,OAAOvD,kBAAkB,CAACC,iBAAiB,EAAEuF,YAAY,EAAErF,WAAW,CAAC;IACzE,CAAC,MAAM;MACL,MAAMoF,KAAK;IACb;EACF;AACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_errorCodes","require","serializeAttrs","attrs","Object","entries","filter","_ref","v","undefined","map","_ref2","k","Array","isArray","join","JSON","stringify","_","exports","IoWalletError","Error","code","constructor","message","name","ValidationFailed","_ref3","claim","reason","UnexpectedStatusCodeError","_ref4","statusCode","IssuerResponseError","params","IssuerResponseErrorCodes","IssuerGenericError","WalletProviderResponseError","WalletProviderResponseErrorCodes","WalletProviderGenericError","RelyingPartyResponseError","RelyingPartyResponseErrorCodes","RelyingPartyGenericError","extractErrorMessageFromIssuerConf","errorCode","_ref5","issuerConf","credentialType","credentialConfiguration","openid_credential_issuer","credential_configurations_supported","issuance_errors_supported","localesList","display","reduce","acc","_ref6","locale","rest","makeErrorTypeGuard","ErrorClass","error","isIssuerResponseError","isWalletProviderResponseError","isRelyingPartyResponseError","ResponseErrorBuilder","errorCases","handle","status","buildFrom","originalError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"names":["_errorCodes","require","serializeAttrs","attrs","Object","entries","filter","_ref","v","undefined","map","_ref2","k","Array","isArray","join","JSON","stringify","_","exports","IoWalletError","Error","code","constructor","message","name","ValidationFailed","_ref3","claim","reason","UnexpectedStatusCodeError","_ref4","statusCode","IssuerResponseError","params","IssuerResponseErrorCodes","IssuerGenericError","WalletProviderResponseError","WalletProviderResponseErrorCodes","WalletProviderGenericError","RelyingPartyResponseError","RelyingPartyResponseErrorCodes","RelyingPartyGenericError","extractErrorMessageFromIssuerConf","errorCode","_ref5","issuerConf","credentialType","credentialConfiguration","openid_credential_issuer","credential_configurations_supported","issuance_errors_supported","localesList","display","reduce","acc","_ref6","locale","rest","makeErrorTypeGuard","ErrorClass","error","isIssuerResponseError","isWalletProviderResponseError","isRelyingPartyResponseError","ResponseErrorBuilder","errorCases","handle","status","buildFrom","originalError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAgBA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,GACzBC,KAA8E,IAE9EC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,MAAM,CAACC,IAAA;EAAA,IAAC,GAAGC,CAAC,CAAC,GAAAD,IAAA;EAAA,OAAKC,CAAC,KAAKC,SAAS;AAAA,EAAC,CAClCC,GAAG,CAACC,KAAA,IAAY;EAAA,IAAX,CAACC,CAAC,EAAEJ,CAAC,CAAC,GAAAG,KAAA;EACV,IAAIE,KAAK,CAACC,OAAO,CAACN,CAAC,CAAC,EAAE,OAAO,CAACI,CAAC,EAAG,IAAGJ,CAAC,CAACO,IAAI,CAAC,IAAI,CAAE,GAAE,CAAC;EACrD,IAAI,OAAOP,CAAC,KAAK,QAAQ,EAAE,OAAO,CAACI,CAAC,EAAEI,IAAI,CAACC,SAAS,CAACT,CAAC,CAAC,CAAC;EACxD,OAAO,CAACI,CAAC,EAAEJ,CAAC,CAAC;AACf,CAAC,CAAC,CACDE,GAAG,CAAEQ,CAAC,IAAKA,CAAC,CAACH,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAI,OAAA,CAAAjB,cAAA,GAAAA,cAAA;AAWO,MAAMkB,aAAa,SAASC,KAAK,CAAC;EACvC;EACAC,IA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,MAAM,EAAE;MACV,OAAO,IAAI,IAAI,CAAC0B,UAAU,CAAC;QAAE,GAAGU,aAAa;QAAE,GAAGpC;MAAO,CAAC,CAAC;IAC7D;IAEA,OAAOoC,aAAa;EACtB;AACF;AAACnD,OAAA,CAAA8C,oBAAA,GAAAA,oBAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getCredentialIssuerEntityConfiguration } from "../../trust";
|
1
|
+
import { getCredentialIssuerEntityConfiguration } from "../../trust/build-chain";
|
2
2
|
/**
|
3
3
|
* WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
|
4
4
|
* The Issuer trust evaluation phase.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getCredentialIssuerEntityConfiguration","evaluateIssuerTrust","issuerUrl","context","arguments","length","undefined","issuerConf","appFetch","then","_","payload","metadata"],"sourceRoot":"../../../../src","sources":["credential/issuance/02-evaluate-issuer-trust.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["getCredentialIssuerEntityConfiguration","evaluateIssuerTrust","issuerUrl","context","arguments","length","undefined","issuerConf","appFetch","then","_","payload","metadata"],"sourceRoot":"../../../../src","sources":["credential/issuance/02-evaluate-issuer-trust.ts"],"mappings":"AAGA,SAASA,sCAAsC,QAAQ,yBAAyB;AAWhF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAwC,GAAG,eAAAA,CACtDC,SAAS,EAEN;EAAA,IADHC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEZ,MAAMG,UAAU,GAAG,MAAMP,sCAAsC,CAACE,SAAS,EAAE;IACzEM,QAAQ,EAAEL,OAAO,CAACK;EACpB,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,CAACC,QAAQ,CAAC;EAClC,OAAO;IAAEL;EAAW,CAAC;AACvB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getRelyingPartyEntityConfiguration","evaluateRelyingPartyTrust","rpUrl","appFetch","fetch","arguments","length","undefined","payload","metadata","rpConf","sub","subject"],"sourceRoot":"../../../../src","sources":["credential/presentation/02-evaluate-rp-trust.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["getRelyingPartyEntityConfiguration","evaluateRelyingPartyTrust","rpUrl","appFetch","fetch","arguments","length","undefined","payload","metadata","rpConf","sub","subject"],"sourceRoot":"../../../../src","sources":["credential/presentation/02-evaluate-rp-trust.ts"],"mappings":"AAGA,SAASA,kCAAkC,QAAQ,yBAAyB;AAY5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAoD,GAAG,eAAAA,CAClEC,KAAK,EAEF;EAAA,IADH;IAAEC,QAAQ,GAAGC;EAAM,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEzB,MAAM;IACJG,OAAO,EAAE;MAAEC,QAAQ,EAAEC,MAAM;MAAEC;IAAI;EACnC,CAAC,GAAG,MAAMX,kCAAkC,CAACE,KAAK,EAAE;IAClDC;EACF,CAAC,CAAC;EACF,OAAO;IAAEO,MAAM;IAAEE,OAAO,EAAED;EAAI,CAAC;AACjC,CAAC"}
|