@pagopa/io-react-native-wallet 0.6.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/pid/issuing.js +58 -12
- package/lib/commonjs/pid/issuing.js.map +1 -1
- package/lib/commonjs/rp/__test__/index.test.js +20 -18
- package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
- package/lib/commonjs/rp/index.js +2 -2
- package/lib/commonjs/rp/index.js.map +1 -1
- package/lib/commonjs/trust/types.js +3 -1
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/decoder.js +46 -0
- package/lib/commonjs/utils/decoder.js.map +1 -0
- package/lib/commonjs/wallet-instance-attestation/issuing.js +35 -3
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/pid/issuing.js +59 -12
- package/lib/module/pid/issuing.js.map +1 -1
- package/lib/module/rp/__test__/index.test.js +20 -18
- package/lib/module/rp/__test__/index.test.js.map +1 -1
- package/lib/module/rp/index.js +2 -2
- package/lib/module/rp/index.js.map +1 -1
- package/lib/module/trust/types.js +3 -1
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/decoder.js +40 -0
- package/lib/module/utils/decoder.js.map +1 -0
- package/lib/module/wallet-instance-attestation/issuing.js +35 -3
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/typescript/pid/issuing.d.ts +4 -4
- package/lib/typescript/pid/issuing.d.ts.map +1 -1
- package/lib/typescript/rp/types.d.ts +4 -4
- package/lib/typescript/trust/index.d.ts +50 -46
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +1020 -684
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/decoder.d.ts +6 -0
- package/lib/typescript/utils/decoder.d.ts.map +1 -0
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/pid/issuing.ts +75 -8
- package/src/rp/__test__/index.test.ts +23 -21
- package/src/rp/index.ts +2 -2
- package/src/trust/types.ts +1 -1
- package/src/utils/decoder.ts +44 -0
- package/src/wallet-instance-attestation/issuing.ts +46 -5
@@ -13,11 +13,19 @@ var WalletInstanceAttestation = _interopRequireWildcard(require("../wallet-insta
|
|
13
13
|
var _ioReactNativeCrypto = require("@pagopa/io-react-native-crypto");
|
14
14
|
var _2 = require(".");
|
15
15
|
var _crypto = require("../utils/crypto");
|
16
|
+
var z = _interopRequireWildcard(require("zod"));
|
17
|
+
var _decoder = require("../utils/decoder");
|
16
18
|
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); }
|
17
19
|
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; }
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
21
|
// This is a temporary type that will be used for demo purposes only
|
20
22
|
|
23
|
+
const AuthenticationRequestResponse = z.object({
|
24
|
+
code: z.string(),
|
25
|
+
state: z.string(),
|
26
|
+
// TODO: refine to known paths using literals
|
27
|
+
iss: z.string()
|
28
|
+
});
|
21
29
|
const assertionType = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
22
30
|
|
23
31
|
/**
|
@@ -83,31 +91,71 @@ const getPar = _ref => {
|
|
83
91
|
};
|
84
92
|
};
|
85
93
|
|
94
|
+
/**
|
95
|
+
* Make an authorization request
|
96
|
+
*/
|
97
|
+
const getAuthenticationRequest = _ref2 => {
|
98
|
+
let {
|
99
|
+
appFetch = fetch
|
100
|
+
} = _ref2;
|
101
|
+
return async (clientId, requestUri, pidProviderEntityConfiguration, cieData) => {
|
102
|
+
const authzRequestEndpoint = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.authorization_endpoint;
|
103
|
+
|
104
|
+
/* User's personal data is not supposed to transit in this flow,
|
105
|
+
* but to be provided to the PID issuer directly by its chosen authentication method (CIE).
|
106
|
+
* Being the project in an initial phase, and being we were still unable to fully comply with authentication,
|
107
|
+
* we temporarily provide data from the App's logged user.
|
108
|
+
* */
|
109
|
+
const params = new URLSearchParams({
|
110
|
+
client_id: clientId,
|
111
|
+
request_uri: requestUri,
|
112
|
+
name: cieData.name,
|
113
|
+
surname: cieData.surname,
|
114
|
+
birth_date: cieData.birthDate,
|
115
|
+
fiscal_code: cieData.fiscalCode
|
116
|
+
});
|
117
|
+
const response = await appFetch(authzRequestEndpoint + "?" + params, {
|
118
|
+
method: "GET"
|
119
|
+
});
|
120
|
+
if (response.status === 200) {
|
121
|
+
const formData = await response.text();
|
122
|
+
const {
|
123
|
+
decodedJwt
|
124
|
+
} = await (0, _decoder.getJwtFromFormPost)(formData);
|
125
|
+
const parsed = AuthenticationRequestResponse.parse(decodedJwt.payload);
|
126
|
+
return parsed;
|
127
|
+
}
|
128
|
+
throw new _errors.PidIssuingError(`Unable to obtain Authorization Request. Response code: ${await response.text()}`);
|
129
|
+
};
|
130
|
+
};
|
131
|
+
|
86
132
|
/**
|
87
133
|
* Start the issuing flow by generating an authorization request to the PID Provider. Obtain from the PID Provider an access token to be used to complete the issuing flow.
|
88
134
|
*
|
89
135
|
* @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
|
90
136
|
* @param params.appFetch (optional) Http client
|
91
137
|
* @param walletInstanceAttestation Wallet Instance Attestation token.
|
92
|
-
* @param walletProviderBaseUrl Base url for the Wallet Provider
|
138
|
+
* @param walletProviderBaseUrl Base url for the Wallet Provider.
|
93
139
|
* @param pidProviderEntityConfiguration The Entity Configuration of the PID Provider, from which discover public endooints.
|
140
|
+
* @param cieData Data red from the CIE login process
|
94
141
|
* @returns The access token along with the values that identify the issuing session.
|
95
142
|
*/
|
96
|
-
const authorizeIssuing =
|
143
|
+
const authorizeIssuing = _ref3 => {
|
97
144
|
let {
|
98
145
|
wiaCryptoContext,
|
99
146
|
appFetch = fetch
|
100
|
-
} =
|
101
|
-
return async (walletInstanceAttestation, walletProviderBaseUrl, pidProviderEntityConfiguration) => {
|
147
|
+
} = _ref3;
|
148
|
+
return async (walletInstanceAttestation, walletProviderBaseUrl, pidProviderEntityConfiguration, cieData) => {
|
102
149
|
// FIXME: do better
|
103
150
|
const clientId = await wiaCryptoContext.getPublicKey().then(_ => _.kid);
|
104
151
|
const codeVerifier = `${_reactNativeUuid.default.v4()}`;
|
105
|
-
const authorizationCode = `${_reactNativeUuid.default.v4()}`;
|
106
152
|
const tokenUrl = pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.token_endpoint;
|
107
|
-
await getPar({
|
153
|
+
const requestUri = await getPar({
|
108
154
|
wiaCryptoContext,
|
109
155
|
appFetch
|
110
156
|
})(clientId, codeVerifier, walletProviderBaseUrl, pidProviderEntityConfiguration, walletInstanceAttestation);
|
157
|
+
const authenticationRequest = await getAuthenticationRequest({})(clientId, requestUri, pidProviderEntityConfiguration, cieData);
|
158
|
+
const authorizationCode = authenticationRequest.code;
|
111
159
|
|
112
160
|
// Use an ephemeral key to be destroyed after use
|
113
161
|
const keytag = `ephemeral-${_reactNativeUuid.default.v4()}`;
|
@@ -174,21 +222,20 @@ const createNonceProof = async (nonce, issuer, audience, ctx) => {
|
|
174
222
|
* @param params.pidCryptoContext The key pair associated with the PID. Will be use to prove the ownership of the credential.
|
175
223
|
* @param params.appFetch (optional) Http client
|
176
224
|
* @param authConf The authorization configuration retrieved with the access token
|
177
|
-
* @param cieData Data red from the CIE login process
|
178
225
|
* @returns The PID credential token
|
179
226
|
*/
|
180
|
-
const getCredential =
|
227
|
+
const getCredential = _ref4 => {
|
181
228
|
let {
|
182
229
|
pidCryptoContext,
|
183
230
|
appFetch = fetch
|
184
|
-
} =
|
185
|
-
return async (
|
231
|
+
} = _ref4;
|
232
|
+
return async (_ref5, pidProviderEntityConfiguration) => {
|
186
233
|
let {
|
187
234
|
nonce,
|
188
235
|
accessToken,
|
189
236
|
clientId,
|
190
237
|
walletProviderBaseUrl
|
191
|
-
} =
|
238
|
+
} = _ref5;
|
192
239
|
const signedDPopForPid = await (0, _dpop.createDPopToken)({
|
193
240
|
htm: "POST",
|
194
241
|
htu: pidProviderEntityConfiguration.payload.metadata.openid_credential_issuer.token_endpoint,
|
@@ -203,7 +250,6 @@ const getCredential = _ref3 => {
|
|
203
250
|
format: "vc+sd-jwt",
|
204
251
|
proof: JSON.stringify({
|
205
252
|
jwt: signedNonceProof,
|
206
|
-
cieData,
|
207
253
|
proof_type: "jwt"
|
208
254
|
})
|
209
255
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_jwk","_reactNativeUuid","_interopRequireDefault","_errors","_dpop","WalletInstanceAttestation","_interopRequireWildcard","_ioReactNativeCrypto","_2","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","assertionType","getPar","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","pidProviderEntityConfiguration","walletInstanceAttestation","keyThumbprint","getPublicKey","then","JWK","parse","thumbprint","iss","decode","payload","cnf","jwk","kid","codeChallenge","sha256ToBase64","signedJwtForPar","SignJWT","setProtectedHeader","setPayload","aud","jti","uuid","v4","client_assertion_type","authorization_details","credential_definition","type","format","response_type","code_challenge_method","redirect_uri","state","client_id","code_challenge","setIssuedAt","setExpirationTime","sign","parUrl","metadata","openid_credential_issuer","pushed_authorization_request_endpoint","requestBody","client_assertion","request","formBody","URLSearchParams","response","method","headers","body","toString","status","result","json","request_uri","PidIssuingError","text","authorizeIssuing","_ref2","_","authorizationCode","tokenUrl","token_endpoint","keytag","generate","ephemeralContext","createCryptoContextFor","signedDPop","createDPopToken","htm","htu","deleteKey","grant_type","code","code_verifier","DPoP","c_nonce","access_token","accessToken","nonce","exports","createNonceProof","issuer","audience","ctx","setAudience","setIssuer","getCredential","_ref3","pidCryptoContext","_ref4","cieData","signedDPopForPid","signedNonceProof","credentialUrl","credential_endpoint","JSON","stringify","proof","jwt","proof_type","Authorization","pidResponse","validatePid","credential","pidJwt","decoded","SdJwt","pidKey","holderBindedKey","sdJwt"],"sourceRoot":"../../../src","sources":["pid/issuing.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAEA,IAAAM,yBAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AACA,IAAAS,EAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAAyD,SAAAW,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,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,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Q,CAACK,MACV,SAAQ,MAAML,QAAQ,CAACU,IAAI,CAAC,CAAE,EACjC,CAAC;EACH,CAAC;AAAA;AAACwB,OAAA,CAAAO,aAAA,GAAAA,aAAA;AAEJ,MAAMgB,WAAW,GAAG,MAAAA,CAAOE,MAAc,EAAEhB,gBAA+B,KAAK;EAC7E,MAAMiB,OAAO,GAAGC,QAAK,CAACnG,MAAM,CAACiG,MAAM,CAAC;EACpC,MAAMG,MAAM,GAAG,MAAMnB,gBAAgB,CAACvF,YAAY,CAAC,CAAC;EACpD,MAAM2G,eAAe,GAAGH,OAAO,CAACI,KAAK,CAACrG,OAAO,CAACC,GAAG,CAACC,GAAG;EAErD,IAAI,CAAC,MAAM,IAAAL,4BAAU,EAACsG,MAAM,CAAC,OAAO,MAAM,IAAAtG,4BAAU,EAACuG,eAAe,CAAC,CAAC,EAAE;IACtE,MAAM,IAAItD,uBAAe,CACtB,uGAAsGyC,IAAI,CAACC,SAAS,CACnHW,MACF,CAAE,kCAAiCZ,IAAI,CAACC,SAAS,CAACY,eAAe,CAAE,EACrE,CAAC;EACH;AACF,CAAC"}
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_jwk","_reactNativeUuid","_interopRequireDefault","_errors","_dpop","WalletInstanceAttestation","_interopRequireWildcard","_ioReactNativeCrypto","_2","_crypto","z","_decoder","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthenticationRequestResponse","object","code","string","state","iss","assertionType","getPar","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","pidProviderEntityConfiguration","walletInstanceAttestation","keyThumbprint","getPublicKey","then","JWK","parse","thumbprint","decode","payload","cnf","jwk","kid","codeChallenge","sha256ToBase64","signedJwtForPar","SignJWT","setProtectedHeader","setPayload","aud","jti","uuid","v4","client_assertion_type","authorization_details","credential_definition","type","format","response_type","code_challenge_method","redirect_uri","client_id","code_challenge","setIssuedAt","setExpirationTime","sign","parUrl","metadata","openid_credential_issuer","pushed_authorization_request_endpoint","requestBody","client_assertion","request","formBody","URLSearchParams","response","method","headers","body","toString","status","result","json","request_uri","PidIssuingError","text","getAuthenticationRequest","_ref2","requestUri","cieData","authzRequestEndpoint","authorization_endpoint","params","name","surname","birth_date","birthDate","fiscal_code","fiscalCode","formData","decodedJwt","getJwtFromFormPost","parsed","authorizeIssuing","_ref3","_","tokenUrl","token_endpoint","authenticationRequest","authorizationCode","keytag","generate","ephemeralContext","createCryptoContextFor","signedDPop","createDPopToken","htm","htu","deleteKey","grant_type","code_verifier","DPoP","c_nonce","access_token","accessToken","nonce","exports","createNonceProof","issuer","audience","ctx","setAudience","setIssuer","getCredential","_ref4","pidCryptoContext","_ref5","signedDPopForPid","signedNonceProof","credentialUrl","credential_endpoint","JSON","stringify","proof","jwt","proof_type","Authorization","pidResponse","validatePid","credential","pidJwt","decoded","SdJwt","pidKey","holderBindedKey","sdJwt"],"sourceRoot":"../../../src","sources":["pid/issuing.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAOA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAEA,IAAAM,yBAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AACA,IAAAS,EAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAEA,IAAAW,CAAA,GAAAJ,uBAAA,CAAAP,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AAAsD,SAAAa,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,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
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
140
|
+
jwks: {
|
141
|
+
keys: [{
|
142
|
+
crv: "P-256",
|
143
|
+
d: "KzQBowMMoPmSZe7G8QsdEWc1IvR2nsgE8qTOYmMcLtc",
|
144
|
+
kid: "dDwPWXz5sCtczj7CJbqgPGJ2qQ83gZ9Sfs-tJyULi6s",
|
145
|
+
use: "sig",
|
146
|
+
kty: "EC",
|
147
|
+
x: "TSO-KOqdnUj5SUuasdlRB2VVFSqtJOxuR5GftUTuBdk",
|
148
|
+
y: "ByWgQt1wGBSnF56jQqLdoO1xKUynMY-BHIDB3eXlR7"
|
149
|
+
}, {
|
150
|
+
kty: "RSA",
|
151
|
+
d: "QUZsh1NqvpueootsdSjFQz-BUvxwd3Qnzm5qNb-WeOsvt3rWMEv0Q8CZrla2tndHTJhwioo1U4NuQey7znijhZ177bUwPPxSW1r68dEnL2U74nKwwoYeeMdEXnUfZSPxzs7nY6b7vtyCoA-AjiVYFOlgKNAItspv1HxeyGCLhLYhKvS_YoTdAeLuegETU5D6K1xGQIuw0nS13Icjz79Y8jC10TX4FdZwdX-NmuIEDP5-s95V9DMENtVqJAVE3L-wO-NdDilyjyOmAbntgsCzYVGH9U3W_djh4t3qVFCv3r0S-DA2FD3THvlrFi655L0QHR3gu_Fbj3b9Ybtajpue_Q",
|
152
|
+
e: "AQAB",
|
153
|
+
use: "enc",
|
154
|
+
kid: "9Cquk0X-fNPSdePQIgQcQZtD6J0IjIRrFigW2PPK_-w",
|
155
|
+
n: "utqtxbs-jnK0cPsV7aRkkZKA9t4S-WSZa3nCZtYIKDpgLnR_qcpeF0diJZvKOqXmj2cXaKFUE-8uHKAHo7BL7T-Rj2x3vGESh7SG1pE0thDGlXj4yNsg0qNvCXtk703L2H3i1UXwx6nq1uFxD2EcOE4a6qDYBI16Zl71TUZktJwmOejoHl16CPWqDLGo9GUSk_MmHOV20m4wXWkB4qbvpWVY8H6b2a0rB1B1YPOs5ZLYarSYZgjDEg6DMtZ4NgiwZ-4N1aaLwyO-GLwt9Vf-NBKwoxeRyD3zWE2FXRFBbhKGksMrCGnFDsNl5JTlPjaM3kYyImE941ggcuc495m-Fw",
|
156
|
+
p: "2zmGXIMCEHPphw778YjVTar1eycih6fFSJ4I4bl1iq167GqO0PjlOx6CZ1-OdBTVU7HfrYRiUK_BnGRdPDn-DQghwwkB79ZdHWL14wXnpB5y-boHz_LxvjsEqXtuQYcIkidOGaMG68XNT1nM4F9a8UKFr5hHYT5_UIQSwsxlRQ0",
|
157
|
+
q: "2jMFt2iFrdaYabdXuB4QMboVjPvbLA-IVb6_0hSG_-EueGBvgcBxdFGIZaG6kqHqlB7qMsSzdptU0vn6IgmCZnX-Hlt6c5X7JB_q91PZMLTO01pbZ2Bk58GloalCHnw_mjPh0YPviH5jGoWM5RHyl_HDDMI-UeLkzP7ImxGizrM"
|
158
|
+
}]
|
159
|
+
}
|
158
160
|
}
|
159
161
|
},
|
160
162
|
authority_hints: ["https://demo.federation.eudi.wallet.developers.italia.it"]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_types","require","RelyingPartySolution","_interopRequireWildcard","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","describe","it","qrcode","result","decodeAuthRequestQR","expect","requestURI","toEqual","toThrowError","AuthRequestDecodeError","pp","header","alg","kid","typ","payload","exp","iat","iss","sub","jwks","keys","kty","e","n","metadata","federation_entity","organization_name","homepage_uri","policy_uri","logo_uri","contacts","wallet_relying_party","application_type","authorization_encrypted_response_alg","authorization_encrypted_response_enc","authorization_signed_response_alg","client_id","client_name","default_acr_values","default_max_age","id_token_encrypted_response_alg","id_token_encrypted_response_enc","id_token_signed_response_alg","presentation_definitions","id","input_descriptors","format","constraints","fields","filter","const","type","path","intent_to_retain","limit_disclosure","jwt","mso_mdoc","redirect_uris","request_uris","require_auth_time","subject_type","vp_formats","jwt_vp_json","crv","d","use","x","y","p","q","authority_hints","RelyingPartyEntityConfiguration","safeParse","success","error","toBe"],"sourceRoot":"../../../../src","sources":["rp/__test__/index.test.ts"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA4D,SAAAI,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,SAAAH,wBAAAO,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,CAA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AQ,EAAE;oBACR7C,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO;kBACxB;gBACF,CAAC;gBACDiC,EAAE,EAAE;cACN,CAAC;YAEL,CAAC,CACF;YACDa,aAAa,EAAE,CACb,4EAA4E,CAC7E;YACDC,YAAY,EAAE,CACZ,2EAA2E,CAC5E;YACDC,iBAAiB,EAAE,IAAI;YACvBC,YAAY,EAAE,UAAU;YACxBC,UAAU,EAAE;cACVC,WAAW,EAAE;gBACXnD,GAAG,EAAE,CAAC,OAAO,EAAE,QAAQ;cACzB;YACF,CAAC;YACDQ,IAAI,EAAE,CACJ;
|
1
|
+
{"version":3,"names":["_types","require","RelyingPartySolution","_interopRequireWildcard","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","describe","it","qrcode","result","decodeAuthRequestQR","expect","requestURI","toEqual","toThrowError","AuthRequestDecodeError","pp","header","alg","kid","typ","payload","exp","iat","iss","sub","jwks","keys","kty","e","n","metadata","federation_entity","organization_name","homepage_uri","policy_uri","logo_uri","contacts","wallet_relying_party","application_type","authorization_encrypted_response_alg","authorization_encrypted_response_enc","authorization_signed_response_alg","client_id","client_name","default_acr_values","default_max_age","id_token_encrypted_response_alg","id_token_encrypted_response_enc","id_token_signed_response_alg","presentation_definitions","id","input_descriptors","format","constraints","fields","filter","const","type","path","intent_to_retain","limit_disclosure","jwt","mso_mdoc","redirect_uris","request_uris","require_auth_time","subject_type","vp_formats","jwt_vp_json","crv","d","use","x","y","p","q","authority_hints","RelyingPartyEntityConfiguration","safeParse","success","error","toBe"],"sourceRoot":"../../../../src","sources":["rp/__test__/index.test.ts"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AA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J;gBACE2C,GAAG,EAAE,OAAO;gBACZC,CAAC,EAAE,6CAA6C;gBAChDpD,GAAG,EAAE,6CAA6C;gBAClDqD,GAAG,EAAE,KAAK;gBACV5C,GAAG,EAAE,IAAI;gBACT6C,CAAC,EAAE,6CAA6C;gBAChDC,CAAC,EAAE;cACL,CAAC,EACD;gBACE9C,GAAG,EAAE,KAAK;gBACV2C,CAAC,EAAE,wVAAwV;gBAC3V1C,CAAC,EAAE,MAAM;gBACT2C,GAAG,EAAE,KAAK;gBACVrD,GAAG,EAAE,6CAA6C;gBAClDW,CAAC,EAAE,wVAAwV;gBAC3V6C,CAAC,EAAE,6KAA6K;gBAChLC,CAAC,EAAE;cACL,CAAC;YAEL;UACF;QACF,CAAC;QACDC,eAAe,EAAE,CACf,0DAA0D;MAE9D;IACF,CAAC;IACD,MAAMpE,MAAM,GAAGqE,sCAA+B,CAACC,SAAS,CAAC/D,EAAE,CAAC;IAC5D,IAAIP,MAAM,CAACuE,OAAO,KAAK,KAAK,EAAE;MAC5B,MAAMvE,MAAM,CAACwE,KAAK;IACpB;IACAtE,MAAM,CAACF,MAAM,CAACuE,OAAO,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;EACnC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/commonjs/rp/index.js
CHANGED
@@ -22,7 +22,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
22
22
|
* @throws {NoSuitableKeysFoundInEntityConfiguration} If entity do not contain any public key suitable for encrypting
|
23
23
|
*/
|
24
24
|
const chooseRSAPublicKeyToEncrypt = entity => {
|
25
|
-
const [usingRsa256] = entity.payload.metadata.wallet_relying_party.jwks.filter(jwk => jwk.use === "enc" && jwk.kty === "RSA");
|
25
|
+
const [usingRsa256] = entity.payload.metadata.wallet_relying_party.jwks.keys.filter(jwk => jwk.use === "enc" && jwk.kty === "RSA");
|
26
26
|
if (usingRsa256) {
|
27
27
|
return usingRsa256;
|
28
28
|
}
|
@@ -90,7 +90,7 @@ const getRequestObject = _ref => {
|
|
90
90
|
// verify token signature according to RP's entity configuration
|
91
91
|
// to ensure the request object is authentic
|
92
92
|
{
|
93
|
-
const pubKey = rpEntityConfiguration.payload.metadata.wallet_relying_party.jwks.find(_ref2 => {
|
93
|
+
const pubKey = rpEntityConfiguration.payload.metadata.wallet_relying_party.jwks.keys.find(_ref2 => {
|
94
94
|
let {
|
95
95
|
kid
|
96
96
|
} = _ref2;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_errors","require","_ioReactNativeJwt","_types","_reactNativeUuid","_interopRequireDefault","_sdJwt","_dpop","WalletInstanceAttestation","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","payload","metadata","wallet_relying_party","jwks","filter","jwk","use","kty","NoSuitableKeysFoundInEntityConfiguration","decodeAuthRequestQR","qrcode","decoded","decodeBase64","decodedUrl","URL","protocol","resource","hostname","requestURI","searchParams","clientId","result","QRCodePayload","safeParse","success","data","AuthRequestDecodeError","error","message","exports","getRequestObject","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","requestUri","rpEntityConfiguration","signedWalletInstanceDPoP","createDPopToken","jti","uuid","v4","htm","htu","ath","sha256ToBase64","response","method","headers","Authorization","DPoP","status","responseJson","json","responseEncodedJwt","responseJwt","decodeJwt","pubKey","find","_ref2","kid","protectedHeader","verify","requestObject","RequestObject","parse","header","IoWalletError","text","prepareVpToken","_ref3","pidCryptoContext","_ref4","_ref5","vc","claims","token","vp","paths","disclose","iss","decode","pidKid","getPublicKey","then","_","vp_token","SignJWT","setProtectedHeader","typ","setPayload","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","_ref6","_ref7","presentation","authzResponsePayload","JSON","stringify","state","encrypted","EncryptJwe","alg","enc","encrypt","formBody","URLSearchParams","body","toString"],"sourceRoot":"../../../src","sources":["rp/index.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,yBAAA,GAAAC,uBAAA,CAAAR,OAAA;AAA4E,SAAAS,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,SAAAF,wBAAAM,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;AAAA,SAAAhB,uBAAAU,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,2BAA2B,GAC/BC,MAAuC,IAC/B;EACR,MAAM,CAACC,WAAW,CAAC,GACjBD,MAAM,CAACE,OAAO,CAACC,QAAQ,CAACC,oBAAoB,CAACC,IAAI,CAACC,MAAM,
|
1
|
+
{"version":3,"names":["_errors","require","_ioReactNativeJwt","_types","_reactNativeUuid","_interopRequireDefault","_sdJwt","_dpop","WalletInstanceAttestation","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","payload","metadata","wallet_relying_party","jwks","keys","filter","jwk","use","kty","NoSuitableKeysFoundInEntityConfiguration","decodeAuthRequestQR","qrcode","decoded","decodeBase64","decodedUrl","URL","protocol","resource","hostname","requestURI","searchParams","clientId","result","QRCodePayload","safeParse","success","data","AuthRequestDecodeError","error","message","exports","getRequestObject","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","requestUri","rpEntityConfiguration","signedWalletInstanceDPoP","createDPopToken","jti","uuid","v4","htm","htu","ath","sha256ToBase64","response","method","headers","Authorization","DPoP","status","responseJson","json","responseEncodedJwt","responseJwt","decodeJwt","pubKey","find","_ref2","kid","protectedHeader","verify","requestObject","RequestObject","parse","header","IoWalletError","text","prepareVpToken","_ref3","pidCryptoContext","_ref4","_ref5","vc","claims","token","vp","paths","disclose","iss","decode","pidKid","getPublicKey","then","_","vp_token","SignJWT","setProtectedHeader","typ","setPayload","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","_ref6","_ref7","presentation","authzResponsePayload","JSON","stringify","state","encrypted","EncryptJwe","alg","enc","encrypt","formBody","URLSearchParams","body","toString"],"sourceRoot":"../../../src","sources":["rp/index.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,yBAAA,GAAAC,uBAAA,CAAAR,OAAA;AAA4E,SAAAS,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,SAAAF,wBAAAM,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,CA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,GAAGF,QAAQ,CAACG,QAAQ,CAAC,CAAC;IAEhC,MAAM7E,QAAQ,GAAG,MAAMd,QAAQ,CAAC+B,aAAa,CAACjE,OAAO,CAAC+F,YAAY,EAAE;MAClE9C,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACD0E;IACF,CAAC,CAAC;IAEF,IAAI5E,QAAQ,CAACK,MAAM,KAAK,GAAG,EAAE;MAC3B,OAAO,MAAML,QAAQ,CAACO,IAAI,CAAC,CAAC;IAC9B;IAEA,MAAM,IAAIc,qBAAa,CACpB,oDAAmD,MAAMrB,QAAQ,CAACsB,IAAI,CAAC,CAAE,eACxEtB,QAAQ,CAACK,MACV,EACH,CAAC;EACH,CAAC;AAAA;AAACvB,OAAA,CAAA+E,yBAAA,GAAAA,yBAAA"}
|
@@ -145,7 +145,9 @@ const RelyingPartyEntityConfiguration = BaseEntityConfiguration.and(z.object({
|
|
145
145
|
application_type: z.string().optional(),
|
146
146
|
client_id: z.string().optional(),
|
147
147
|
client_name: z.string().optional(),
|
148
|
-
jwks: z.
|
148
|
+
jwks: z.object({
|
149
|
+
keys: z.array(_jwk.JWK)
|
150
|
+
}),
|
149
151
|
contacts: z.array(z.string()).optional()
|
150
152
|
}).passthrough()
|
151
153
|
})
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","array","cryptographic_suites_supported","display","EntityStatement","header","typ","alg","kid","payload","iss","sub","jwks","keys","JWK","trust_marks","iat","number","exp","EntityConfigurationHeader","BaseEntityConfiguration","UnixTime","metadata","federation_entity","federation_fetch_endpoint","optional","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","contacts","passthrough","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","RelyingPartyEntityConfiguration","wallet_relying_party","application_type","client_id","client_name","EntityConfiguration","union","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,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,SAAAF,wBAAAM,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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AAA,GAAAA,iCAAA;AAIO,MAAMM,+BAA+B,GAAGjC,uBAAuB,CAACkB,GAAG,CACxE/E,CAAC,CAACyB,MAAM,CAAC;EACPyB,OAAO,EAAElD,CAAC,CAACyB,MAAM,CAAC;IAChBsC,QAAQ,EAAE/D,CAAC,CAACyB,MAAM,CAAC;MACjBsE,oBAAoB,EAAE/F,CAAC,CACpByB,MAAM,CAAC;QACNuE,gBAAgB,EAAEhG,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACuC,QAAQ,CAAC,CAAC;QACvC+B,SAAS,EAAEjG,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACuC,QAAQ,CAAC,CAAC;QAChCgC,WAAW,EAAElG,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACuC,QAAQ,CAAC,CAAC;QAClCb,IAAI,EAAErD,CAAC,CAAC0C,KAAK,CAACa,QAAG,CAAC;
|
1
|
+
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","array","cryptographic_suites_supported","display","EntityStatement","header","typ","alg","kid","payload","iss","sub","jwks","keys","JWK","trust_marks","iat","number","exp","EntityConfigurationHeader","BaseEntityConfiguration","UnixTime","metadata","federation_entity","federation_fetch_endpoint","optional","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","contacts","passthrough","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","RelyingPartyEntityConfiguration","wallet_relying_party","application_type","client_id","client_name","EntityConfiguration","union","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,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,SAAAF,wBAAAM,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,GA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hG,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACuC,QAAQ,CAAC,CAAC;QACvC+B,SAAS,EAAEjG,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACuC,QAAQ,CAAC,CAAC;QAChCgC,WAAW,EAAElG,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACuC,QAAQ,CAAC,CAAC;QAClCb,IAAI,EAAErD,CAAC,CAACyB,MAAM,CAAC;UAAE6B,IAAI,EAAEtD,CAAC,CAAC0C,KAAK,CAACa,QAAG;QAAE,CAAC,CAAC;QACtCmB,QAAQ,EAAE1E,CAAC,CAAC0C,KAAK,CAAC1C,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAACuC,QAAQ,CAAC;MACzC,CAAC,CAAC,CACDS,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;AAAA9C,OAAA,CAAAiE,+BAAA,GAAAA,+BAAA;AAEO,MAAMK,mBAAmB,GAAGnG,CAAC,CAACoG,KAAK,CACxC,CACEZ,iCAAiC,EACjCV,mCAAmC,EACnCD,8BAA8B,EAC9BiB,+BAA+B,CAChC,EACD;EACEO,WAAW,EAAE;AACf,CACF,CAAC;AAACxE,OAAA,CAAAsE,mBAAA,GAAAA,mBAAA"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getJwtFromFormPost = void 0;
|
7
|
+
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
8
|
+
var _errors = require("./errors");
|
9
|
+
/*
|
10
|
+
* Decode a form_post.jwt and return the final JWT.
|
11
|
+
* The formData here is in form_post.jwt format as defined in
|
12
|
+
* JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)
|
13
|
+
* HTTP/1.1 200 OK
|
14
|
+
* Content-Type: text/html;charset=UTF-8
|
15
|
+
* Cache-Control: no-cache, no-store
|
16
|
+
* Pragma: no-cache
|
17
|
+
*
|
18
|
+
* <html>
|
19
|
+
* <head><title>Submit This Form</title></head>
|
20
|
+
* <body onload="javascript:document.forms[0].submit()">
|
21
|
+
* <form method="post" action="https://client.example.com/cb">
|
22
|
+
* <input type="hidden" name="response"
|
23
|
+
* value="eyJhbGciOiJSUz....."/>
|
24
|
+
* </form>
|
25
|
+
* </body>
|
26
|
+
* </html>
|
27
|
+
*/
|
28
|
+
const getJwtFromFormPost = async formData => {
|
29
|
+
const formPostRegex = /<input(.|\n)*value\s*=\s*"((.|\n)*)"(.|\n)*>/gm;
|
30
|
+
const lineExpressionRegex = /\r\n|\n\r|\n|\r|\s+/g;
|
31
|
+
const matches = formPostRegex.exec(formData);
|
32
|
+
if (matches && matches.length >= 2) {
|
33
|
+
const responseJwt = matches[2];
|
34
|
+
if (responseJwt) {
|
35
|
+
const jwt = responseJwt.replace(lineExpressionRegex, "");
|
36
|
+
const decodedJwt = await (0, _ioReactNativeJwt.decode)(jwt);
|
37
|
+
return {
|
38
|
+
jwt,
|
39
|
+
decodedJwt
|
40
|
+
};
|
41
|
+
}
|
42
|
+
}
|
43
|
+
throw new _errors.ValidationFailed(`Unable to obtain JWT from form_post.jwt. Form data: ${formData}`);
|
44
|
+
};
|
45
|
+
exports.getJwtFromFormPost = getJwtFromFormPost;
|
46
|
+
//# sourceMappingURL=decoder.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_errors","getJwtFromFormPost","formData","formPostRegex","lineExpressionRegex","matches","exec","length","responseJwt","jwt","replace","decodedJwt","decodeJwt","ValidationFailed","exports"],"sourceRoot":"../../../src","sources":["utils/decoder.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,kBAAkB,GAAG,MAChCC,QAAgB,IAC0C;EAC1D,MAAMC,aAAa,GAAG,gDAAgD;EACtE,MAAMC,mBAAmB,GAAG,sBAAsB;EAElD,MAAMC,OAAO,GAAGF,aAAa,CAACG,IAAI,CAACJ,QAAQ,CAAC;EAC5C,IAAIG,OAAO,IAAIA,OAAO,CAACE,MAAM,IAAI,CAAC,EAAE;IAClC,MAAMC,WAAW,GAAGH,OAAO,CAAC,CAAC,CAAC;IAE9B,IAAIG,WAAW,EAAE;MACf,MAAMC,GAAG,GAAGD,WAAW,CAACE,OAAO,CAACN,mBAAmB,EAAE,EAAE,CAAC;MACxD,MAAMO,UAAU,GAAG,MAAM,IAAAC,wBAAS,EAACH,GAAG,CAAC;MACvC,OAAO;QAAEA,GAAG;QAAEE;MAAW,CAAC;IAC5B;EACF;EAEA,MAAM,IAAIE,wBAAgB,CACvB,uDAAsDX,QAAS,EAClE,CAAC;AACH,CAAC;AAACY,OAAA,CAAAb,kBAAA,GAAAA,kBAAA"}
|
@@ -32,6 +32,36 @@ async function getAttestationRequest(wiaCryptoContext, walletProviderEntityConfi
|
|
32
32
|
}).setIssuedAt().setExpirationTime("1h").sign();
|
33
33
|
}
|
34
34
|
|
35
|
+
/**
|
36
|
+
* Validate a Wallet Instance Attestation token.
|
37
|
+
* Either return true or throw an exception.
|
38
|
+
*
|
39
|
+
* @param wia Signed Wallet Instance Attestation token
|
40
|
+
* @param walletProviderEntityConfiguration Entity Configuration object for the issuing Wallet Provider
|
41
|
+
* @returns The token is valid
|
42
|
+
* @throws {WalletInstanceAttestationIssuingError} When the received token fails to validate. This can happen due to invalid signature, expired token or malformed JWT token.
|
43
|
+
*/
|
44
|
+
async function verifyWalletInstanceAttestation(wia, walletProviderEntityConfiguration) {
|
45
|
+
const {
|
46
|
+
payload: {
|
47
|
+
sub,
|
48
|
+
metadata: {
|
49
|
+
wallet_provider: {
|
50
|
+
jwks: {
|
51
|
+
keys
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
} = walletProviderEntityConfiguration;
|
57
|
+
return (0, _ioReactNativeJwt.verify)(wia, keys, {
|
58
|
+
issuer: sub
|
59
|
+
}).then(_ => true).catch(ex => {
|
60
|
+
const reason = ex && ex instanceof Error ? ex.message : "unknown reason";
|
61
|
+
throw new _errors.WalletInstanceAttestationIssuingError("Unable to validate received wallet instance attestation", reason);
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
35
65
|
/**
|
36
66
|
* Request a Wallet Instance Attestation (WIA) to the Wallet provider
|
37
67
|
*
|
@@ -66,10 +96,12 @@ const getAttestation = _ref => {
|
|
66
96
|
},
|
67
97
|
body: JSON.stringify(requestBody)
|
68
98
|
});
|
69
|
-
if (response.status
|
70
|
-
|
99
|
+
if (response.status !== 201) {
|
100
|
+
throw new _errors.WalletInstanceAttestationIssuingError("Unable to obtain wallet instance attestation from wallet provider", `Response code: ${response.status}`);
|
71
101
|
}
|
72
|
-
|
102
|
+
const wia = await response.text();
|
103
|
+
await verifyWalletInstanceAttestation(wia, walletProviderEntityConfiguration);
|
104
|
+
return wia;
|
73
105
|
};
|
74
106
|
};
|
75
107
|
exports.getAttestation = getAttestation;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_jwk","_types","_reactNativeUuid","_interopRequireDefault","_errors","obj","__esModule","default","getAttestationRequest","wiaCryptoContext","walletProviderEntityConfiguration","jwk","getPublicKey","parsedJwk","JWK","parse","keyThumbprint","thumbprint","publicKey","kid","SignJWT","setPayload","iss","aud","payload","jti","uuid","v4","nonce","cnf","fixBase64EncodingOnKey","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","decodeJwt","parsedRequest","WalletInstanceAttestationRequestJwt","header","protectedHeader","
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_jwk","_types","_reactNativeUuid","_interopRequireDefault","_errors","obj","__esModule","default","getAttestationRequest","wiaCryptoContext","walletProviderEntityConfiguration","jwk","getPublicKey","parsedJwk","JWK","parse","keyThumbprint","thumbprint","publicKey","kid","SignJWT","setPayload","iss","aud","payload","jti","uuid","v4","nonce","cnf","fixBase64EncodingOnKey","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","verifyWalletInstanceAttestation","wia","sub","metadata","wallet_provider","jwks","keys","verifyJwt","issuer","then","_","catch","ex","reason","Error","message","WalletInstanceAttestationIssuingError","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","decodeJwt","parsedRequest","WalletInstanceAttestationRequestJwt","header","protectedHeader","tokenUrl","token_endpoint","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text","exports"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAAwE,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGxE,eAAeG,qBAAqBA,CAClCC,gBAA+B,EAC/BC,iCAAoE,EACnD;EACjB,MAAMC,GAAG,GAAG,MAAMF,gBAAgB,CAACG,YAAY,CAAC,CAAC;EACjD,MAAMC,SAAS,GAAGC,QAAG,CAACC,KAAK,CAACJ,GAAG,CAAC;EAChC,MAAMK,aAAa,GAAG,MAAM,IAAAC,4BAAU,EAACJ,SAAS,CAAC;EACjD,MAAMK,SAAS,GAAG;IAAE,GAAGL,SAAS;IAAEM,GAAG,EAAEH;EAAc,CAAC;EAEtD,OAAO,IAAII,yBAAO,CAACX,gBAAgB,CAAC,CACjCY,UAAU,CAAC;IACVC,GAAG,EAAEN,aAAa;IAClBO,GAAG,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