@pagopa/io-react-native-wallet 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/lib/commonjs/cie/manager.js +4 -4
  2. package/lib/commonjs/cie/manager.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +142 -21
  4. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +12 -4
  6. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/index.js +14 -2
  8. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/types.js +9 -1
  10. package/lib/commonjs/credential/issuance/types.js.map +1 -1
  11. package/lib/commonjs/trust/types.js +5 -3
  12. package/lib/commonjs/trust/types.js.map +1 -1
  13. package/lib/commonjs/utils/decoder.js +28 -19
  14. package/lib/commonjs/utils/decoder.js.map +1 -1
  15. package/lib/module/cie/manager.js +4 -4
  16. package/lib/module/cie/manager.js.map +1 -1
  17. package/lib/module/credential/issuance/04-complete-user-authorization.js +140 -20
  18. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  19. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +12 -4
  20. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  21. package/lib/module/credential/issuance/index.js +2 -2
  22. package/lib/module/credential/issuance/index.js.map +1 -1
  23. package/lib/module/credential/issuance/types.js +7 -0
  24. package/lib/module/credential/issuance/types.js.map +1 -1
  25. package/lib/module/trust/types.js +5 -3
  26. package/lib/module/trust/types.js.map +1 -1
  27. package/lib/module/utils/decoder.js +28 -19
  28. package/lib/module/utils/decoder.js.map +1 -1
  29. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +48 -6
  30. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  31. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +1 -0
  32. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  33. package/lib/typescript/credential/issuance/index.d.ts +3 -3
  34. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  35. package/lib/typescript/credential/issuance/types.d.ts +10 -0
  36. package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
  37. package/lib/typescript/trust/index.d.ts +14 -14
  38. package/lib/typescript/trust/types.d.ts +142 -142
  39. package/lib/typescript/trust/types.d.ts.map +1 -1
  40. package/lib/typescript/utils/decoder.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/cie/manager.ts +4 -4
  43. package/src/credential/issuance/04-complete-user-authorization.ts +212 -20
  44. package/src/credential/issuance/07-verify-and-parse-credential.ts +14 -6
  45. package/src/credential/issuance/index.ts +10 -2
  46. package/src/credential/issuance/types.ts +7 -0
  47. package/src/trust/types.ts +8 -6
  48. package/src/utils/decoder.ts +28 -19
@@ -22,9 +22,9 @@ export const startCieAndroid = (useCieUat, ciePin, onError, onEvent, cieAuthoriz
22
22
  await cieManager.startListeningNFC();
23
23
  onEvent(CieEvent.waiting_card);
24
24
  }).catch(onError);
25
- } catch {
25
+ } catch (e) {
26
26
  onError(new CieError({
27
- message: "Unable to start CIE NFC manager on iOS",
27
+ message: `Unable to start CIE NFC manager on Android: ${e}`,
28
28
  type: CieErrorType.NFC_ERROR
29
29
  }));
30
30
  }
@@ -45,9 +45,9 @@ export const startCieiOS = async (useCieUat, ciePin, onError, onEvent, cieAuthor
45
45
  await cieManager.startListeningNFC();
46
46
  onEvent(CieEvent.waiting_card);
47
47
  }).catch(onError);
48
- } catch {
48
+ } catch (e) {
49
49
  onError(new CieError({
50
- message: "Unable to start CIE NFC manager on Android",
50
+ message: `Unable to start CIE NFC manager on iOS: ${e}`,
51
51
  type: CieErrorType.NFC_ERROR
52
52
  }));
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"names":["cieManager","Platform","CieEvent","CieError","CieErrorType","BASE_UAT_URL","startCieAndroid","useCieUat","ciePin","onError","onEvent","cieAuthorizationUri","continueWithUrl","removeAllListeners","start","then","handleCieEvent","e","console","error","message","onSuccess","handleCieSuccess","setPin","setAuthenticationUrl","enableLog","setCustomIdpUrl","getCieUatEndpoint","startListeningNFC","waiting_card","catch","type","NFC_ERROR","startCieiOS","event","reading","TAG_NOT_VALID","AUTHENTICATION_ERROR","PIN_LOCKED","PIN_ERROR","attemptsLeft","CERTIFICATE_ERROR","url","decodeURIComponent","select","ios","android","default"],"sourceRoot":"../../../src","sources":["cie/manager.ts"],"mappings":"AAAA,OAAOA,UAAU,MAAgC,0BAA0B;AAC3E,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,QAAQ,QAAuC,aAAa;AACrE,SAASC,QAAQ,EAAEC,YAAY,QAAQ,SAAS;AAEhD,MAAMC,YAAY,GAAG,0DAA0D;AAI/E,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,SAAkB,EAClBC,MAAc,EACdC,OAAgB,EAChBC,OAAmB,EACnBC,mBAA2B,EAC3BC,eAAgC,KAC7B;EACH,IAAI;IACFZ,UAAU,CAACa,kBAAkB,CAAC,CAAC;IAC/Bb,UAAU,CACPc,KAAK,CAAC,CAAC,CACPC,IAAI,CAAC,YAAY;MAChBf,UAAU,CAACU,OAAO,CAACM,cAAc,CAACP,OAAO,EAAEC,OAAO,CAAC,CAAC;MACpDV,UAAU,CAACS,OAAO,CAAEQ,CAAQ,IAAK;QAC/BC,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;QAChB,OAAOR,OAAO,CAAC,IAAIN,QAAQ,CAAC;UAAEiB,OAAO,EAAEH,CAAC,CAACG;QAAQ,CAAC,CAAC,CAAC;MACtD,CAAC,CAAC;MACFpB,UAAU,CAACqB,SAAS,CAACC,gBAAgB,CAACV,eAAe,CAAC,CAAC;MACvD,MAAMZ,UAAU,CAACuB,MAAM,CAACf,MAAM,CAAC;MAC/BR,UAAU,CAACwB,oBAAoB,CAACb,mBAAmB,CA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,KAAK,oBAAoB;MACvBvB,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,YAAW;QACrBW,IAAI,EAAE3B,YAAY,CAACkC;MACrB,CAAC,CACH,CAAC;MACD;IACF,KAAK,cAAc;MACjB7B,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,YAAW;QACrBW,IAAI,EAAE3B,YAAY,CAACmC,SAAS;QAC5BC,YAAY,EAAEN,KAAK,CAACM;MACtB,CAAC,CACH,CAAC;MACD;;IAEF;IACA,KAAK,qBAAqB;MACxB/B,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,qBAAoB;QAC9BW,IAAI,EAAE3B,YAAY,CAACqC;MACrB,CAAC,CACH,CAAC;MACD;IACF,KAAK,qBAAqB;MACxBhC,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,qBAAoB;QAC9BW,IAAI,EAAE3B,YAAY,CAACqC;MACrB,CAAC,CACH,CAAC;MAED;IAEF;MACE;EACJ;AACF,CAAC;AAEH,MAAMnB,gBAAgB,GACnBV,eAAgC,IAAM8B,GAAW,IAAK;EACrD9B,eAAe,CAAC+B,kBAAkB,CAACD,GAAG,CAAC,CAAC;AAC1C,CAAC;AAEH,MAAMf,iBAAiB,GAAGA,CAAA,KACxB1B,QAAQ,CAAC2C,MAAM,CAAC;EACdC,GAAG,EAAG,GAAExC,YAAa,kBAAiB;EACtCyC,OAAO,EAAEzC,YAAY;EACrB0C,OAAO,EAAE;AACX,CAAC,CAAC"}
1
+ {"version":3,"names":["cieManager","Platform","CieEvent","CieError","CieErrorType","BASE_UAT_URL","startCieAndroid","useCieUat","ciePin","onError","onEvent","cieAuthorizationUri","continueWithUrl","removeAllListeners","start","then","handleCieEvent","e","console","error","message","onSuccess","handleCieSuccess","setPin","setAuthenticationUrl","enableLog","setCustomIdpUrl","getCieUatEndpoint","startListeningNFC","waiting_card","catch","type","NFC_ERROR","startCieiOS","event","reading","TAG_NOT_VALID","AUTHENTICATION_ERROR","PIN_LOCKED","PIN_ERROR","attemptsLeft","CERTIFICATE_ERROR","url","decodeURIComponent","select","ios","android","default"],"sourceRoot":"../../../src","sources":["cie/manager.ts"],"mappings":"AAAA,OAAOA,UAAU,MAAgC,0BAA0B;AAC3E,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,QAAQ,QAAuC,aAAa;AACrE,SAASC,QAAQ,EAAEC,YAAY,QAAQ,SAAS;AAEhD,MAAMC,YAAY,GAAG,0DAA0D;AAI/E,OAAO,MAAMC,eAAe,GAAGA,CAC7BC,SAAkB,EAClBC,MAAc,EACdC,OAAgB,EAChBC,OAAmB,EACnBC,mBAA2B,EAC3BC,eAAgC,KAC7B;EACH,IAAI;IACFZ,UAAU,CAACa,kBAAkB,CAAC,CAAC;IAC/Bb,UAAU,CACPc,KAAK,CAAC,CAAC,CACPC,IAAI,CAAC,YAAY;MAChBf,UAAU,CAACU,OAAO,CAACM,cAAc,CAACP,OAAO,EAAEC,OAAO,CAAC,CAAC;MACpDV,UAAU,CAACS,OAAO,CAAEQ,CAAQ,IAAK;QAC/BC,OAAO,CAACC,KAAK,CAACF,CAAC,CAAC;QAChB,OAAOR,OAAO,CAAC,IAAIN,QAAQ,CAAC;UAAEiB,OAAO,EAAEH,CAAC,CAACG;QAAQ,CAAC,CAAC,CAAC;MACtD,CAAC,CAAC;MACFpB,UAAU,CAACqB,SAAS,CAACC,gBAAgB,CAACV,eAAe,CAAC,CAAC;MACvD,MAAMZ,UAAU,CAACuB,MAAM,CAACf,MAAM,CAAC;MAC/BR,UAAU,CAACwB,oBAAoB,CAACb,mBAAmB,CAAC;MACpDX,UAAU,CAACyB,SAAS,CAAClB,SAAS,CAAC;MAC/BP,UAAU,CAAC0B,eAAe,CAACnB,SAAS,GAAGoB,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC;MAClE,MAAM3B,UAAU,CAAC4B,iBAAiB,CAAC,CAAC;MACpClB,OAAO,CA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F,KAAK,cAAc;MACjB7B,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,YAAW;QACrBW,IAAI,EAAE3B,YAAY,CAACmC,SAAS;QAC5BC,YAAY,EAAEN,KAAK,CAACM;MACtB,CAAC,CACH,CAAC;MACD;;IAEF;IACA,KAAK,qBAAqB;MACxB/B,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,qBAAoB;QAC9BW,IAAI,EAAE3B,YAAY,CAACqC;MACrB,CAAC,CACH,CAAC;MACD;IACF,KAAK,qBAAqB;MACxBhC,OAAO,CACL,IAAIN,QAAQ,CAAC;QACXiB,OAAO,EAAG,qBAAoB;QAC9BW,IAAI,EAAE3B,YAAY,CAACqC;MACrB,CAAC,CACH,CAAC;MAED;IAEF;MACE;EACJ;AACF,CAAC;AAEH,MAAMnB,gBAAgB,GACnBV,eAAgC,IAAM8B,GAAW,IAAK;EACrD9B,eAAe,CAAC+B,kBAAkB,CAACD,GAAG,CAAC,CAAC;AAC1C,CAAC;AAEH,MAAMf,iBAAiB,GAAGA,CAAA,KACxB1B,QAAQ,CAAC2C,MAAM,CAAC;EACdC,GAAG,EAAG,GAAExC,YAAa,kBAAiB;EACtCyC,OAAO,EAAEzC,YAAY;EACrB0C,OAAO,EAAE;AACX,CAAC,CAAC"}
@@ -1,8 +1,13 @@
1
1
  import { AuthorizationErrorShape, AuthorizationResultShape } from "../../utils/auth";
2
- import { until } from "../../utils/misc";
2
+ import { hasStatus, until } from "../../utils/misc";
3
3
  import parseUrl from "parse-url";
4
- import { AuthorizationError, AuthorizationIdpError } from "../../utils/errors";
4
+ import { AuthorizationError, AuthorizationIdpError, ValidationFailed } from "../../utils/errors";
5
5
  import { Linking } from "react-native";
6
+ import { decode, encodeBase64, SignJWT } from "@pagopa/io-react-native-jwt";
7
+ import { RequestObject } from "../presentation/types";
8
+ import uuid from "react-native-uuid";
9
+ import { ResponseUriResultShape } from "./types";
10
+ import { getJwtFromFormPost } from "../../../src/utils/decoder";
6
11
 
7
12
  /**
8
13
  * The interface of the phase to complete User authorization via strong identification when the response mode is "query" and the request credential is a PersonIdentificationData.
@@ -26,11 +31,6 @@ import { Linking } from "react-native";
26
31
  * @returns the authorization response which contains code, state and iss
27
32
  */
28
33
  export const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId, issuerConf, idpHint, redirectUri, authorizationContext) => {
29
- /**
30
- * Starts the authorization flow which dependes on the response mode and the request credential.
31
- * If the response mode is "query" the authorization flow is handled differently via the authorization context which opens an in-app browser capable of catching the redirectSchema.
32
- * The form_post.jwt mode is not currently supported.
33
- */
34
34
  const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
35
35
  const params = new URLSearchParams({
36
36
  client_id: clientId,
@@ -66,24 +66,144 @@ export const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, c
66
66
  throw new AuthorizationError("Invalid authentication redirect url");
67
67
  }
68
68
  }
69
- return parseAuthRedirectUrl(authRedirectUrl);
69
+ const query = parseUrl(authRedirectUrl).query;
70
+ return parseAuthroizationResponse(query);
71
+ };
72
+
73
+ /**
74
+ * WARNING: This function must be called after {@link startUserAuthorization}. The next function to be called is {@link completeUserAuthorizationWithFormPostJwtMode}.
75
+ * The interface of the phase to complete User authorization via presentation of existing credentials when the response mode is "form_post.jwt".
76
+ * It is used as a first step to complete the user authorization by obtaining the requested credential to be presented from the authorization server.
77
+ * The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
78
+ * @param issuerRequestUri the URI of the issuer where the request is sent
79
+ * @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
80
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
81
+ * @param appFetch (optional) fetch api implementation. Default: built-in fetch
82
+ * @throws {ValidationFailed} if an error while validating the response
83
+ * @returns the request object which contains the credential to be presented in order to obtain the requested credential
84
+ */
85
+ export const getRequestedCredentialToBePresented = async function (issuerRequestUri, clientId, issuerConf) {
86
+ let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
87
+ const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
88
+ const params = new URLSearchParams({
89
+ client_id: clientId,
90
+ request_uri: issuerRequestUri
91
+ });
92
+ const requestObject = await appFetch(`${authzRequestEndpoint}?${params.toString()}`, {
93
+ method: "GET"
94
+ }).then(hasStatus(200)).then(res => res.text()).then(jws => decode(jws)).then(reqObj => RequestObject.safeParse(reqObj.payload));
95
+ if (!requestObject.success) {
96
+ throw new ValidationFailed("Request Object validation failed", requestObject.error.message);
97
+ }
98
+ return requestObject.data;
70
99
  };
71
- export const parseAuthRedirectUrl = authRedirectUrl => {
72
- const urlParse = parseUrl(authRedirectUrl);
73
- const authRes = AuthorizationResultShape.safeParse(urlParse.query);
74
- if (!authRes.success) {
75
- const authErr = AuthorizationErrorShape.safeParse(urlParse.query);
100
+
101
+ /**
102
+ * WARNING: This function must be called after {@link startUserAuthorization}. The next function to be called is {@link completeUserAuthorizationWithFormPostJwtMode}.
103
+ * The interface of the phase to complete User authorization via presentation of existing credentials when the response mode is "form_post.jwt".
104
+ * It is used as a first step to complete the user authorization by obtaining the requested credential to be presented from the authorization server.
105
+ * The information is obtained by performing a GET request to the authorization endpoint with request_uri and client_id parameters.
106
+ * @param issuerRequestUri the URI of the issuer where the request is sent
107
+ * @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
108
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
109
+ * @param context.walletInstanceAccestation the Wallet Instance's attestation to be presented
110
+ * @param context.pid the PID to be presented
111
+ * @param context.wiaCryptoContext The Wallet Instance's crypto context associated with the walletInstanceAttestation parameter
112
+ * @param context.pidCryptoContext The PID crypto context associated with the pid parameter
113
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
114
+ * @throws {ValidationFailed} if an error while validating the response
115
+ * @returns the authorization response which contains code, state and iss
116
+ */
117
+ export const completeUserAuthorizationWithFormPostJwtMode = async (requestObject, ctx) => {
118
+ const {
119
+ wiaCryptoContext,
120
+ pidCryptoContext,
121
+ pid,
122
+ walletInstanceAttestation,
123
+ appFetch = fetch
124
+ } = ctx;
125
+ const wiaWpToken = await new SignJWT(wiaCryptoContext).setProtectedHeader({
126
+ alg: "ES256",
127
+ typ: "JWT"
128
+ }).setPayload({
129
+ vp: walletInstanceAttestation,
130
+ jti: uuid.v4().toString(),
131
+ nonce: requestObject.nonce
132
+ }).setIssuedAt().setExpirationTime("5m").setAudience(requestObject.response_uri).sign();
133
+ const pidWpToken = await new SignJWT(pidCryptoContext).setProtectedHeader({
134
+ alg: "ES256",
135
+ typ: "JWT"
136
+ }).setPayload({
137
+ vp: pid,
138
+ jti: uuid.v4().toString(),
139
+ nonce: requestObject.nonce
140
+ }).setIssuedAt().setExpirationTime("5m").setAudience(requestObject.response_uri).sign();
141
+
142
+ /* The path parameter refers to the vp_token variable of the authzResponsePayload and must point to the plain credential which
143
+ * is cointaned in the `vp` property of the signed jwt token payload
144
+ */
145
+ const presentationSubmission = {
146
+ definition_id: `${uuid.v4()}`,
147
+ id: `${uuid.v4()}`,
148
+ descriptor_map: [{
149
+ id: "PersonIdentificationData",
150
+ path: "$.vp_token[0].vp",
151
+ format: "vc+sd-jwt"
152
+ }, {
153
+ id: "WalletAttestation",
154
+ path: "$.vp_token[1].vp",
155
+ format: "jwt"
156
+ }]
157
+ };
158
+ const authzResponsePayload = encodeBase64(JSON.stringify({
159
+ state: requestObject.state,
160
+ presentation_submission: presentationSubmission,
161
+ vp_token: [pidWpToken, wiaWpToken]
162
+ }));
163
+
164
+ // Note: according to the spec, the response should be encrypted with the public key of the RP however this is not implemented yet
165
+ // https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-signed-and-encrypted-response
166
+ // const rsaPublicJwk = chooseRSAPublicKeyToEncrypt(rpConf);
167
+ // const encrypted = await new EncryptJwe(authzResponsePayload, {
168
+ // alg: "RSA-OAEP-256",
169
+ // enc: "A256CBC-HS512",
170
+ // kid: rsaPublicJwk.kid,
171
+ // }).encrypt(rsaPublicJwk);
172
+
173
+ const body = new URLSearchParams({
174
+ response: authzResponsePayload
175
+ }).toString();
176
+ const resUriRes = await appFetch(requestObject.response_uri, {
177
+ method: "POST",
178
+ headers: {
179
+ "Content-Type": "application/x-www-form-urlencoded"
180
+ },
181
+ body
182
+ }).then(hasStatus(200)).then(reqUri => reqUri.json());
183
+ const responseUri = ResponseUriResultShape.safeParse(resUriRes);
184
+ if (!responseUri.success) {
185
+ throw new ValidationFailed("Response Uri validation failed", responseUri.error.message);
186
+ }
187
+ return await appFetch(responseUri.data.redirect_uri).then(hasStatus(200)).then(res => res.text()).then(getJwtFromFormPost).then(cbRes => parseAuthroizationResponse(cbRes.decodedJwt.payload));
188
+ };
189
+
190
+ /**
191
+ * Parse the authorization response and return the result which contains code, state and iss.
192
+ * @throws {AuthorizationError} if an error occurs during the parsing process
193
+ * @throws {AuthorizationIdpError} if an error occurs during the parsing process and the error is related to the IDP
194
+ * @param authRes the authorization response to be parsed
195
+ * @returns the authorization result which contains code, state and iss
196
+ */
197
+ export const parseAuthroizationResponse = authRes => {
198
+ const authResParsed = AuthorizationResultShape.safeParse(authRes);
199
+ if (!authResParsed.success) {
200
+ const authErr = AuthorizationErrorShape.safeParse(authRes);
76
201
  if (!authErr.success) {
77
- throw new AuthorizationError(authRes.error.message); // an error occured while parsing the result and the error
202
+ throw new AuthorizationError(authResParsed.error.message); // an error occured while parsing the result and the error
78
203
  }
79
204
 
80
205
  throw new AuthorizationIdpError(authErr.data.error, authErr.data.error_description);
81
206
  }
82
- return authRes.data;
83
- };
84
-
85
- // TODO: SIW-1120 implement generic credential issuance flow
86
- export const completeUserAuthorizationWithFormPostJwtMode = () => {
87
- throw new Error("Not implemented");
207
+ return authResParsed.data;
88
208
  };
89
209
  //# sourceMappingURL=04-complete-user-authorization.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AuthorizationErrorShape","AuthorizationResultShape","until","parseUrl","AuthorizationError","AuthorizationIdpError","Linking","completeUserAuthorizationWithQueryMode","issuerRequestUri","clientId","issuerConf","idpHint","redirectUri","authorizationContext","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","idphint","authUrl","authRedirectUrl","redirectSchema","URL","protocol","replace","authorize","catch","e","message","addEventListener","_ref","url","includes","openAuthUrlInBrowser","openURL","unitAuthRedirectIsNotUndefined","undefined","Promise","all","parseAuthRedirectUrl","urlParse","authRes","safeParse","query","success","authErr","error","data","error_description","completeUserAuthorizationWithFormPostJwtMode","Error"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":"AAAA,SACEA,uBAAuB,EACvBC,wBAAwB,QAGnB,kBAAkB;AACzB,SAASC,KAAK,QAAkB,kBAAkB;AAElD,OAAOC,QAAQ,MAAM,WAAW;AAChC,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,oBAAoB;AAE9E,SAASC,OAAO,QAAQ,cAAc;;AAEtC;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sCAA8E,GACzF,MAAAA,CACEC,gBAAgB,EAChBC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,WAAW,EACXC,oBAAoB,KACjB;EACH;AACJ;AACA;AACA;AACA;EACI,MAAMC,oBAAoB,GACxBJ,UAAU,CAACK,0BAA0B,CAACC,sBAAsB;EAC9D,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IACjCC,SAAS,EAAEV,QAAQ;IACnBW,WAAW,EAAEZ,gBAAgB;IAC7Ba,OAAO,EAAEV;EACX,CAAC,CAAC;EACF,MAAMW,OAAO,GAAI,GAAER,oBAAqB,IAAGG,MAAO,EAAC;EACnD,IAAIM,eAAmC;EAEvC,IAAIV,oBAAoB,EAAE;IACxB,MAAMW,cAAc,GAAG,IAAIC,G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;IACjE,IAAI,CAACE,OAAO,CAACD,OAAO,EAAE;MACpB,MAAM,IAAI3C,kBAAkB,CAACwC,OAAO,CAACK,KAAK,CAAClB,OAAO,CAAC,CAAC,CAAC;IACvD;;IACA,MAAM,IAAI1B,qBAAqB,CAC7B2C,OAAO,CAACE,IAAI,CAACD,KAAK,EAClBD,OAAO,CAACE,IAAI,CAACC,iBACf,CAAC;EACH;EACA,OAAOP,OAAO,CAACM,IAAI;AACrB,CAAC;;AAED;AACA,OAAO,MAAME,4CAA4C,GAAGA,CAAA,KAAM;EAChE,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;AACpC,CAAC"}
1
+ {"version":3,"names":["AuthorizationErrorShape","AuthorizationResultShape","hasStatus","until","parseUrl","AuthorizationError","AuthorizationIdpError","ValidationFailed","Linking","decode","encodeBase64","SignJWT","RequestObject","uuid","ResponseUriResultShape","getJwtFromFormPost","completeUserAuthorizationWithQueryMode","issuerRequestUri","clientId","issuerConf","idpHint","redirectUri","authorizationContext","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","idphint","authUrl","authRedirectUrl","redirectSchema","URL","protocol","replace","authorize","catch","e","message","addEventListener","_ref","url","includes","openAuthUrlInBrowser","openURL","unitAuthRedirectIsNotUndefined","undefined","Promise","all","query","parseAuthroizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","fetch","requestObject","toString","method","then","res","text","jws","reqObj","safeParse","payload","success","error","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","setProtectedHeader","alg","typ","setPayload","vp","jti","v4","nonce","setIssuedAt","setExpirationTime","setAudience","response_uri","sign","pidWpToken","presentationSubmission","definition_id","id","descriptor_map","path","format","authzResponsePayload","JSON","stringify","state","presentation_submission","vp_token","body","response","resUriRes","headers","reqUri","json","responseUri","redirect_uri","cbRes","decodedJwt","authRes","authResParsed","authErr","error_description"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":"AAAA,SACEA,uBAAuB,EACvBC,wBAAwB,QAGnB,kBAAkB;AACzB,SAASC,SAAS,EAAEC,KAAK,QAAkB,kBAAkB;AAE7D,OAAOC,QAAQ,MAAM,WAAW;AAChC,SACEC,kBAAkB,EAClBC,qBAAqB,EACrBC,gBAAgB,QACX,oBAAoB;AAE3B,SAASC,OAAO,QAAQ,cAAc;AACtC,SACEC,MAAM,EACNC,YAAY,EACZC,OAAO,QAEF,6BAA6B;AACpC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,sBAAsB,QAAQ,SAAS;AAChD,SAASC,kBAAkB,QAAQ,4BAA4B;;AAE/D;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sCAA8E,GACzF,MAAAA,CACEC,gBAAgB,EAChBC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,WAAW,EACXC,oBAAoB,KACjB;EACH,MAAMC,oBAAoB,GACxBJ,UAAU,CAACK,0BAA0B,CAACC,sBAAsB;EAC9D,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IACjCC,SAAS,EAAEV,QAAQ;IACnBW,WAAW,EAAEZ,gBAAgB;IAC7Ba,OAAO,EAAEV;EACX,CAAC,CAAC;EACF,MAAMW,OAAO,GAAI,GAAER,oBAAqB,IAAGG,MAAO,EAAC;EACnD,IAAIM,eAAmC;EAEvC,IAAIV,oBAAoB,EAAE;IACxB,MAAMW,cAAc,GAAG,IAAIC,GAAG,CAACb,WAAW,CAAC,CAACc,QAAQ,CAACC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IACrEJ,eAAe,GAAG,MAAMV,oBAAoB,CACzCe,SAAS,CAACN,OAAO,EAAEE,cAAc,CAAC,CAClCK,KAAK,CAAEC,CAAC,IA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AO,CAAChD,OAAO,EAAE;MACpB,MAAM,IAAI/D,kBAAkB,CAAC8G,aAAa,CAAC9C,KAAK,CAAC7B,OAAO,CAAC,CAAC,CAAC;IAC7D;;IACA,MAAM,IAAIlC,qBAAqB,CAC7B8G,OAAO,CAAC9C,IAAI,CAACD,KAAK,EAClB+C,OAAO,CAAC9C,IAAI,CAAC+C,iBACf,CAAC;EACH;EACA,OAAOF,aAAa,CAAC7C,IAAI;AAC3B,CAAC"}
@@ -6,11 +6,12 @@ import { verify as verifySdJwt } from "../../sd-jwt";
6
6
 
7
7
  // handy alias
8
8
 
9
- const parseCredentialSdJwt = (credentials_supported, _ref) => {
9
+ const parseCredentialSdJwt = function (credentials_supported, _ref) {
10
10
  let {
11
11
  sdJwt,
12
12
  disclosures
13
13
  } = _ref;
14
+ let ignoreMissingAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
14
15
  const credentialSubject = credentials_supported[sdJwt.payload.vct];
15
16
  if (!credentialSubject) {
16
17
  throw new IoWalletError("Credential type not supported by the issuer");
@@ -20,6 +21,10 @@ const parseCredentialSdJwt = (credentials_supported, _ref) => {
20
21
  }
21
22
 
22
23
  // transfrom a record { key: value } in an iterable of pairs [key, value]
24
+ if (!credentialSubject.claims) {
25
+ throw new IoWalletError("Missing claims in the credential subject"); // TODO [SIW-1268]: should not be optional
26
+ }
27
+
23
28
  const attrDefinitions = Object.entries(credentialSubject.claims);
24
29
 
25
30
  // the key of the attribute defintion must match the disclosure's name
@@ -33,7 +38,9 @@ const parseCredentialSdJwt = (credentials_supported, _ref) => {
33
38
  if (attrsNotInDisclosures.length > 0) {
34
39
  const missing = attrsNotInDisclosures.map(_ => _[0 /* key */]).join(", ");
35
40
  const received = disclosures.map(_ => _[1 /* name */]).join(", ");
36
- throw new IoWalletError(`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`);
41
+ if (!ignoreMissingAttributes) {
42
+ throw new IoWalletError(`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`);
43
+ }
37
44
  }
38
45
 
39
46
  // attributes that are defined in the issuer configuration
@@ -117,10 +124,11 @@ async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingCon
117
124
 
118
125
  const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) => {
119
126
  let {
120
- credentialCryptoContext
127
+ credentialCryptoContext,
128
+ ignoreMissingAttributes
121
129
  } = _ref8;
122
130
  const decoded = await verifyCredentialSdJwt(credential, issuerConf.openid_credential_issuer.jwks.keys, credentialCryptoContext);
123
- const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.credential_configurations_supported, decoded);
131
+ const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.credential_configurations_supported, decoded, ignoreMissingAttributes);
124
132
  return {
125
133
  parsedCredential
126
134
  };
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","parseCredentialSdJwt","credentials_supported","_ref","sdJwt","disclosures","credentialSubject","payload","vct","format","header","typ","attrDefinitions","Object","entries","claims","attrsNotInDisclosures","filter","_ref2","attrKey","some","_ref3","name","length","missing","map","_","join","received","definedValues","fromEntries","_ref4","_disclosures$find","definition","value","find","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","includes","_ref7","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","credential_configurations_supported","verifyAndParseCredential","context"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":"AAEA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,IAAIC,WAAW,QAAQ,cAAc;;AAcpD;;AAkBA;;AAKA,MAAMC,oBAAoB,GAAGA,CAE3BC,qBAAg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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,wBAAkD,GAAG,MAAAA,CAChET,UAAU,EACVC,UAAU,EACVpD,MAAM,EACN6D,OAAO,KACJ;EACH,IAAI7D,MAAM,KAAK,WAAW,EAAE;IAC1B,OAAOkD,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVpD,MAAM,EACN6D,OACF,CAAC;EACH;EAEA,MAAM,IAAIzE,aAAa,CAAE,kCAAiCY,MAAO,EAAC,CAAC;AACrE,CAAC"}
1
+ {"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","parseCredentialSdJwt","credentials_supported","_ref","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","payload","vct","format","header","typ","claims","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","some","_ref3","name","missing","map","_","join","received","definedValues","fromEntries","_ref4","_disclosures$find","definition","value","find","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","includes","_ref7","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","credential_configurations_supported","verifyAndParseCredential","context"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":"AAEA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,IAAIC,WAAW,QAAQ,cAAc;;AAepD;;AAkBA;;AAKA,MAAMC,oBAAoB,GAAG,SAAAA,CAE3BC,qBAAgI,EAAAC,IAAA,EAG3G;EAAA,IAFrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAF,IAAA;EAAA,IAC9CG,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,G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AU,CAACK,wBAAwB,CAACG,mCAAmC,EACvEJ,OAAO,EACP7D,uBACF,CAAC;EAED,OAAO;IAAEgE;EAAiB,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,wBAAkD,GAAG,MAAAA,CAChET,UAAU,EACVC,UAAU,EACVnD,MAAM,EACN4D,OAAO,KACJ;EACH,IAAI5D,MAAM,KAAK,WAAW,EAAE;IAC1B,OAAOiD,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVnD,MAAM,EACN4D,OACF,CAAC;EACH;EAEA,MAAM,IAAI5E,aAAa,CAAE,kCAAiCgB,MAAO,EAAC,CAAC;AACrE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { evaluateIssuerTrust } from "./02-evaluate-issuer-trust";
2
2
  import { startUserAuthorization } from "./03-start-user-authorization";
3
- import { completeUserAuthorizationWithQueryMode, parseAuthRedirectUrl } from "./04-complete-user-authorization";
3
+ import { completeUserAuthorizationWithQueryMode, completeUserAuthorizationWithFormPostJwtMode, parseAuthroizationResponse, getRequestedCredentialToBePresented } from "./04-complete-user-authorization";
4
4
  import { authorizeAccess } from "./05-authorize-access";
5
5
  import { obtainCredential } from "./06-obtain-credential";
6
6
  import { verifyAndParseCredential } from "./07-verify-and-parse-credential";
7
- export { evaluateIssuerTrust, startUserAuthorization, completeUserAuthorizationWithQueryMode, authorizeAccess, obtainCredential, verifyAndParseCredential, parseAuthRedirectUrl };
7
+ export { evaluateIssuerTrust, startUserAuthorization, completeUserAuthorizationWithQueryMode, getRequestedCredentialToBePresented, completeUserAuthorizationWithFormPostJwtMode, authorizeAccess, obtainCredential, verifyAndParseCredential, parseAuthroizationResponse };
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["evaluateIssuerTrust","startUserAuthorization","completeUserAuthorizationWithQueryMode","parseAuthRedirectUrl","authorizeAccess","obtainCredential","verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":"AACA,SACEA,mBAAmB,QAEd,4BAA4B;AACnC,SACEC,sBAAsB,QAEjB,+BAA+B;AACtC,SACEC,sCAAsC,EACtCC,oBAAoB,QAEf,kCAAkC;AACzC,SAASC,eAAe,QAA8B,uBAAuB;AAC7E,SACEC,gBAAgB,QAEX,wBAAwB;AAC/B,SACEC,wBAAwB,QAEnB,kCAAkC;AAEzC,SACEN,mBAAmB,EACnBC,sBAAsB,EACtBC,sCAAsC,EACtCE,eAAe,EACfC,gBAAgB,EAChBC,wBAAwB,EACxBH,oBAAoB"}
1
+ {"version":3,"names":["evaluateIssuerTrust","startUserAuthorization","completeUserAuthorizationWithQueryMode","completeUserAuthorizationWithFormPostJwtMode","parseAuthroizationResponse","getRequestedCredentialToBePresented","authorizeAccess","obtainCredential","verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":"AACA,SACEA,mBAAmB,QAEd,4BAA4B;AACnC,SACEC,sBAAsB,QAEjB,+BAA+B;AACtC,SACEC,sCAAsC,EACtCC,4CAA4C,EAC5CC,0BAA0B,EAI1BC,mCAAmC,QAC9B,kCAAkC;AACzC,SAASC,eAAe,QAA8B,uBAAuB;AAC7E,SACEC,gBAAgB,QAEX,wBAAwB;AAC/B,SACEC,wBAAwB,QAEnB,kCAAkC;AAEzC,SACER,mBAAmB,EACnBC,sBAAsB,EACtBC,sCAAsC,EACtCG,mCAAmC,EACnCF,4CAA4C,EAC5CG,eAAe,EACfC,gBAAgB,EAChBC,wBAAwB,EACxBJ,0BAA0B"}
@@ -15,4 +15,11 @@ export const CredentialResponse = z.object({
15
15
  credential: z.string(),
16
16
  format: SupportedCredentialFormat
17
17
  });
18
+
19
+ /**
20
+ * Shape from parsing a response given by a request uri during the EAA credential issuance flow with response mode "form_post.jwt".
21
+ */
22
+ export const ResponseUriResultShape = z.object({
23
+ redirect_uri: z.string()
24
+ });
18
25
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["AuthorizationDetail","z","SupportedCredentialFormat","TokenResponse","object","access_token","string","authorization_details","array","c_nonce","c_nonce_expires_in","number","expires_in","token_type","CredentialResponse","credential","format"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,iBAAiB;AACrD,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,SAASC,yBAAyB,QAAQ,SAAS;AAInD,OAAO,MAAMC,aAAa,GAAGF,CAAC,CAACG,MAAM,CAAC;EACpCC,YAAY,EAAEJ,CAAC,CAACK,MAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAEN,CAAC,CAACO,KAAK,CAACR,mBAAmB,CAAC;EACnDS,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEX,CAAC,CAACU,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEZ,CAAC,CAACK,MAAM,CAAC;AACvB,CAAC,CAAC;AAIF,OAAO,MAAMQ,kBAAkB,GAAGb,CAAC,CAACG,MAAM,CAAC;EACzCK,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BI,UAAU,EAAEd,CAAC,CAACK,MAAM,CAAC,CAAC;EACtBU,MAAM,EAAEd;AACV,CAAC,CAAC"}
1
+ {"version":3,"names":["AuthorizationDetail","z","SupportedCredentialFormat","TokenResponse","object","access_token","string","authorization_details","array","c_nonce","c_nonce_expires_in","number","expires_in","token_type","CredentialResponse","credential","format","ResponseUriResultShape","redirect_uri"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,iBAAiB;AACrD,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,SAASC,yBAAyB,QAAQ,SAAS;AAInD,OAAO,MAAMC,aAAa,GAAGF,CAAC,CAACG,MAAM,CAAC;EACpCC,YAAY,EAAEJ,CAAC,CAACK,MAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAEN,CAAC,CAACO,KAAK,CAACR,mBAAmB,CAAC;EACnDS,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEX,CAAC,CAACU,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEZ,CAAC,CAACK,MAAM,CAAC;AACvB,CAAC,CAAC;AAIF,OAAO,MAAMQ,kBAAkB,GAAGb,CAAC,CAACG,MAAM,CAAC;EACzCK,OAAO,EAAER,CAAC,CAACK,MAAM,CAAC,CAAC;EACnBI,kBAAkB,EAAET,CAAC,CAACU,MAAM,CAAC,CAAC;EAC9BI,UAAU,EAAEd,CAAC,CAACK,MAAM,CAAC,CAAC;EACtBU,MAAM,EAAEd;AACV,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMe,sBAAsB,GAAGhB,CAAC,CAACG,MAAM,CAAC;EAC7Cc,YAAY,EAAEjB,CAAC,CAACK,MAAM,CAAC;AACzB,CAAC,CAAC"}
@@ -39,8 +39,9 @@ const CredentialIssuerDisplayMetadata = z.object({
39
39
  logo: z.object({
40
40
  url: z.string(),
41
41
  alt_text: z.string()
42
- })
42
+ }).optional() // TODO [SIW-1268]: should not be optional
43
43
  });
44
+
44
45
  const ClaimsMetadata = z.record(z.object({
45
46
  value_type: z.string(),
46
47
  display: z.array(z.object({
@@ -55,7 +56,8 @@ const SupportedCredentialMetadata = z.object({
55
56
  format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
56
57
  scope: z.string(),
57
58
  display: z.array(CredentialDisplayMetadata),
58
- claims: ClaimsMetadata,
59
+ claims: ClaimsMetadata.optional(),
60
+ // TODO [SIW-1268]: should not be optional
59
61
  cryptographic_binding_methods_supported: z.array(z.string()),
60
62
  credential_signing_alg_values_supported: z.array(z.string())
61
63
  });
@@ -174,7 +176,7 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z
174
176
  /** Credential Issuers act as Relying Party
175
177
  when they require the presentation of other credentials.
176
178
  This does not apply for PID issuance, which requires CIE authz. */
177
- openid_relying_party: RelyingPartyMetadata.optional()
179
+ wallet_relying_party: RelyingPartyMetadata.optional()
178
180
  })
179
181
  })
180
182
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","openid_relying_party","RelyingPartyEntityConfiguration","wallet_relying_party","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAG7E,MAAME,oBAAoB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACpCK,gBAAgB,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EACvCC,SAAS,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAChCE,WAAW,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAClCG,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;IAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;EAAE,CAAC,CAAC;EACtCe,QAAQ,EAAEd,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACI,QAAQ,CAAC;AACzC,CAAC,CAAC;AACF;;AAEA;AACA;AAEA,MAAMO,yBAAyB,GAAGf,CAAC,CAACE,MAAM,CAAC;EACzCc,IAAI,EAAEhB,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBa,MAAM,EAAEjB,CAAC,CAACI,MAAM,CAAC,CAAC;EAClBc,IAAI,EAAElB,CAAC,CACJE,MAAM,CAAC;IACNiB,GAAG,EAAEnB,CAAC,CAACI,MAAM,CAAC,CAAC;IACfgB,QAAQ,EAAEpB,CAAC,CAACI,MAAM,CAAC;EACrB,CAAC,CAAC,CACDI,QAAQ,CAAC,CAAC;EAAE;EACfa,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QACN2E,cAAc,EAAE7E,CAAC,CAACI,MAAM,CAAC,CAAC;QAC1BgG,oBAAoB,EAAEpG,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;QACpD2E,qBAAqB,EAAEnF,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1CwF,qCAAqC,EAAE5F,CAAC,CAACa,KAAK,CAACb,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;QAC1DyF,gDAAgD,EAAE7F,CAAC,CAACa,KAAK,CACvDb,CAAC,CAACI,MAAM,CAAC,CACX,CAAC;QACDO,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;UAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD4D,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAM0C,mBAAmB,GAAGrG,CAAC,CAAC8B,KAAK,CACxC,CACEoE,iCAAiC,EACjCjC,mCAAmC,EACnCD,8BAA8B,EAC9BgC,+BAA+B,CAChC,EACD;EACEM,WAAW,EAAE;AACf,CACF,CAAC"}
1
+ {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialIssuerDisplayMetadata","ClaimsMetadata","record","value_type","display","SupportedCredentialMetadata","format","union","literal","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","status_attestation_endpoint","credential_configurations_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","token_endpoint","introspection_endpoint","client_registration_types_supported","code_challenge_methods_supported","authorization_details_types_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","request_parameter_supported","boolean","request_uri_parameter_supported","response_types_supported","response_modes_supported","subject_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAG7E,MAAME,oBAAoB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACpCK,gBAAgB,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EACvCC,SAAS,EAAET,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAChCE,WAAW,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACI,QAAQ,CAAC,CAAC;EAClCG,IAAI,EAAEX,CAAC,CAACE,MAAM,CAAC;IAAEU,IAAI,EAAEZ,CAAC,CAACa,KAAK,CAACd,GAAG;EAAE,CAAC,CAAC;EACtCe,QAAQ,EAAEd,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CAAiC,EACjChC,mCAAmC,EACnCD,8BAA8B,EAC9BgC,+BAA+B,CAChC,EACD;EACEK,WAAW,EAAE;AACf,CACF,CAAC"}
@@ -5,30 +5,39 @@ import { ValidationFailed } from "./errors";
5
5
  * Decode a form_post.jwt and return the final JWT.
6
6
  * The formData here is in form_post.jwt format as defined in
7
7
  * JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)
8
- * HTTP/1.1 200 OK
9
- * Content-Type: text/html;charset=UTF-8
10
- * Cache-Control: no-cache, no-store
11
- * Pragma: no-cache
12
- *
13
- * <html>
14
- * <head><title>Submit This Form</title></head>
15
- * <body onload="javascript:document.forms[0].submit()">
16
- * <form method="post" action="https://client.example.com/cb">
17
- * <input type="hidden" name="response"
18
- * value="eyJhbGciOiJSUz....."/>
19
- * </form>
20
- * </body>
21
- * </html>
8
+ <!DOCTYPE html>
9
+ <html>
10
+ <head>
11
+ <meta charset="utf-8" />
12
+ </head>
13
+ <body onload="document.forms[0].submit()">
14
+ <noscript>
15
+ <p>
16
+ <strong>Note:</strong> Since your browser does not support JavaScript, you must press the Continue button once to proceed.
17
+ </p>
18
+ </noscript>
19
+ <form action="iowalletexample//cb" method="post">
20
+ <div>
21
+ <input type="hidden" name="response" value="somevalue" />
22
+ </div>
23
+ <noscript>
24
+ <div>
25
+ <input type="submit" value="Continue" />
26
+ </div>
27
+ </noscript>
28
+ </form>
29
+ </body>
30
+ </html>
22
31
  */
23
32
  export const getJwtFromFormPost = async formData => {
24
- const formPostRegex = /<input(.|\n)*value\s*=\s*"((.|\n)*)"(.|\n)*>/gm;
33
+ const formPostRegex = /<input[^>]*name="response"[^>]*value="([^"]*)"/i;
25
34
  const lineExpressionRegex = /\r\n|\n\r|\n|\r|\s+/g;
26
- const matches = formPostRegex.exec(formData);
27
- if (matches && matches.length >= 2) {
28
- const responseJwt = matches[2];
35
+ const match = formPostRegex.exec(formData);
36
+ if (match && match[1]) {
37
+ const responseJwt = match[1];
29
38
  if (responseJwt) {
30
39
  const jwt = responseJwt.replace(lineExpressionRegex, "");
31
- const decodedJwt = await decodeJwt(jwt);
40
+ const decodedJwt = decodeJwt(jwt);
32
41
  return {
33
42
  jwt,
34
43
  decodedJwt
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","ValidationFailed","getJwtFromFormPost","formData","formPostRegex","lineExpressionRegex","matches","exec","length","responseJwt","jwt","replace","decodedJwt"],"sourceRoot":"../../../src","sources":["utils/decoder.ts"],"mappings":"AAAA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AAEjE,SAASC,gBAAgB,QAAQ,UAAU;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,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,MAAMZ,SAAS,CAACU,GAAG,CAAC;MACvC,OAAO;QAAEA,GAAG;QAAEE;MAAW,CAAC;IAC5B;EACF;EAEA,MAAM,IAAIX,gBAAgB,CACvB,uDAAsDE,QAAS,EAClE,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["decode","decodeJwt","ValidationFailed","getJwtFromFormPost","formData","formPostRegex","lineExpressionRegex","match","exec","responseJwt","jwt","replace","decodedJwt"],"sourceRoot":"../../../src","sources":["utils/decoder.ts"],"mappings":"AAAA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AAEjE,SAASC,gBAAgB,QAAQ,UAAU;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG,MAChCC,QAAgB,IAC0C;EAC1D,MAAMC,aAAa,GAAG,iDAAiD;EACvE,MAAMC,mBAAmB,GAAG,sBAAsB;EAElD,MAAMC,KAAK,GAAGF,aAAa,CAACG,IAAI,CAACJ,QAAQ,CAAC;EAC1C,IAAIG,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC,EAAE;IACrB,MAAME,WAAW,GAAGF,KAAK,CAAC,CAAC,CAAC;IAE5B,IAAIE,WAAW,EAAE;MACf,MAAMC,GAAG,GAAGD,WAAW,CAACE,OAAO,CAACL,mBAAmB,EAAE,EAAE,CAAC;MACxD,MAAMM,UAAU,GAAGX,SAAS,CAACS,GAAG,CAAC;MACjC,OAAO;QAAEA,GAAG;QAAEE;MAAW,CAAC;IAC5B;EACF;EAEA,MAAM,IAAIV,gBAAgB,CACvB,uDAAsDE,QAAS,EAClE,CAAC;AACH,CAAC"}