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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/lib/commonjs/cie/component.js +180 -0
  2. package/lib/commonjs/cie/component.js.map +1 -0
  3. package/lib/commonjs/cie/error.js +44 -0
  4. package/lib/commonjs/cie/error.js.map +1 -0
  5. package/lib/commonjs/cie/index.js +32 -0
  6. package/lib/commonjs/cie/index.js.map +1 -0
  7. package/lib/commonjs/cie/manager.js +142 -0
  8. package/lib/commonjs/cie/manager.js.map +1 -0
  9. package/lib/commonjs/client/index.js +5 -2
  10. package/lib/commonjs/client/index.js.map +1 -1
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +6 -2
  12. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  13. package/lib/commonjs/credential/issuance/index.js +6 -0
  14. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  15. package/lib/commonjs/index.js +3 -1
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/module/cie/component.js +171 -0
  18. package/lib/module/cie/component.js.map +1 -0
  19. package/lib/module/cie/error.js +36 -0
  20. package/lib/module/cie/error.js.map +1 -0
  21. package/lib/module/cie/index.js +4 -0
  22. package/lib/module/cie/index.js.map +1 -0
  23. package/lib/module/cie/manager.js +133 -0
  24. package/lib/module/cie/manager.js.map +1 -0
  25. package/lib/module/client/index.js +5 -2
  26. package/lib/module/client/index.js.map +1 -1
  27. package/lib/module/credential/issuance/04-complete-user-authorization.js +3 -0
  28. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  29. package/lib/module/credential/issuance/index.js +2 -2
  30. package/lib/module/credential/issuance/index.js.map +1 -1
  31. package/lib/module/index.js +2 -1
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/typescript/cie/component.d.ts +46 -0
  34. package/lib/typescript/cie/component.d.ts.map +1 -0
  35. package/lib/typescript/cie/error.d.ts +31 -0
  36. package/lib/typescript/cie/error.d.ts.map +1 -0
  37. package/lib/typescript/cie/index.d.ts +4 -0
  38. package/lib/typescript/cie/index.d.ts.map +1 -0
  39. package/lib/typescript/cie/manager.d.ts +5 -0
  40. package/lib/typescript/cie/manager.d.ts.map +1 -0
  41. package/lib/typescript/client/index.d.ts.map +1 -1
  42. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +5 -0
  43. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  44. package/lib/typescript/credential/issuance/index.d.ts +2 -2
  45. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  46. package/lib/typescript/index.d.ts +2 -1
  47. package/lib/typescript/index.d.ts.map +1 -1
  48. package/package.json +6 -2
  49. package/src/cie/component.tsx +216 -0
  50. package/src/cie/error.ts +58 -0
  51. package/src/cie/index.ts +4 -0
  52. package/src/cie/manager.ts +183 -0
  53. package/src/client/index.ts +4 -1
  54. package/src/credential/issuance/04-complete-user-authorization.ts +16 -13
  55. package/src/credential/issuance/index.ts +2 -0
  56. package/src/index.ts +2 -0
  57. package/lib/commonjs/credential/issuance/03-start-credential-issuance.js +0 -287
  58. package/lib/commonjs/credential/issuance/03-start-credential-issuance.js.map +0 -1
  59. package/lib/module/credential/issuance/03-start-credential-issuance.js +0 -276
  60. package/lib/module/credential/issuance/03-start-credential-issuance.js.map +0 -1
  61. package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts +0 -41
  62. package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts.map +0 -1
  63. package/src/credential/issuance/03-start-credential-issuance.ts +0 -407
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WebViewComponent = exports.CieEvent = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeWebview = require("react-native-webview");
10
+ var _manager = require("./manager");
11
+ var _error = require("./error");
12
+ 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); }
13
+ 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; }
14
+ /* To obtain the authentication URL on CIE L3 it is necessary to take the
15
+ * link contained in the "Entra con lettura carta CIE" button.
16
+ * This link can then be used on CieManager.
17
+ * This javascript code takes the link in question and sends it to the react native function via postMessage
18
+ */
19
+ const injectedJavaScript = `
20
+ (function() {
21
+ function sendDocumentContent() {
22
+ const idpAuthUrl = [...document.querySelectorAll("a")]
23
+ .filter(a => a.textContent.includes("lettura carta CIE"))
24
+ .map(a=>a.href)[0];
25
+
26
+ if(idpAuthUrl) {
27
+ window.ReactNativeWebView.postMessage(idpAuthUrl);
28
+ }
29
+ }
30
+ if (document.readyState === 'complete') {
31
+ sendDocumentContent();
32
+ } else {
33
+ window.addEventListener('load', sendDocumentContent);
34
+ }
35
+ })();
36
+ true;
37
+ `;
38
+ let CieEvent = /*#__PURE__*/function (CieEvent) {
39
+ CieEvent["reading"] = "reading";
40
+ CieEvent["completed"] = "completed";
41
+ CieEvent["waiting_card"] = "waiting_card";
42
+ return CieEvent;
43
+ }({});
44
+ exports.CieEvent = CieEvent;
45
+ /*
46
+ * To make sure the server recognizes the client as valid iPhone device (iOS only) we use a custom header
47
+ * on Android it is not required.
48
+ */
49
+ const iOSUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1";
50
+ const defaultUserAgent = _reactNative.Platform.select({
51
+ ios: iOSUserAgent,
52
+ default: undefined
53
+ });
54
+ const webView = /*#__PURE__*/(0, _react.createRef)();
55
+
56
+ /**
57
+ * WebViewComponent
58
+ *
59
+ * Component that manages authentication via CIE L3 (NFC+PIN) based on WebView (react-native-webview).
60
+ * In particular, once rendered, it makes a series of calls to the authUrl in the WebView,
61
+ * extrapolates the authentication URL necessary for CieManager to sign via certificate
62
+ * and calls the CIE SDK which is responsible for starting card reading via NFC.
63
+ * At the end of the reading, a redirect is made in the WebView towards the page that asks
64
+ * the user for consent to send the data to the Service Provider. This moment can be captured
65
+ * via the onUserInteraction parameter. When the user allows or denies their consent,
66
+ * a redirect is made to the URL set by the Service Provider.
67
+ * This url can be configured using the redirectUrl parameter which allows you to close the WebView.
68
+ * The event can then be captured via the onSuccess parameter.
69
+ *
70
+ * @param {CIEParams} params - Parameters required by the component.
71
+ * @param {string} params.authUrl -The authentication URL of the Service Provider to which to authenticate.
72
+ * @param {boolean} params.useUat - If set to true it uses the CIE testing environment.
73
+ * @param {string} params.pin - CIE pin for use with NFC reading.
74
+ * @param {Function} params.onError - Callback function in case of error. The function is passed the Error parameter.
75
+ * @param {Function} params.onSuccess - Callback at the end of authentication to which the redirect URL including parameters is passed.
76
+ * @param {string} params.redirectUrl - Redirect URL set by the Service Provider. It is used to stop the flow and return to the calling function via onSuccess.
77
+ * @param {Function} params.onEvent - Callback function that is called whenever there is a new CieEvent from the CIE reader.
78
+ * @returns {JSX.Element} - The configured component with WebView.
79
+ */
80
+ const WebViewComponent = params => {
81
+ const [webViewUrl, setWebViewUrl] = _react.default.useState(params.authUrl);
82
+ const [isCardReadingFinished, setCardReadingFinished] = _react.default.useState(false);
83
+
84
+ /*
85
+ * Once the reading of the card with NFC is finished, it is necessary
86
+ * to change the URL of the WebView by redirecting to the URL returned by
87
+ * CieManager to allow the user to continue with the consent authorization
88
+ * */
89
+ const continueWithUrl = callbackUrl => {
90
+ setCardReadingFinished(true);
91
+ setWebViewUrl(callbackUrl);
92
+ };
93
+
94
+ // This function is called from the injected javascript code (postMessage). Which receives the authentication URL
95
+ const handleMessage = async event => {
96
+ const cieAuthorizationUri = event.nativeEvent.data;
97
+ const startCie = _reactNative.Platform.select({
98
+ ios: _manager.startCieiOS,
99
+ default: _manager.startCieAndroid
100
+ });
101
+ await startCie(params.useUat, params.pin, params.onError, params.onEvent, cieAuthorizationUri, continueWithUrl);
102
+ };
103
+
104
+ //This function is called when authentication with CIE ends and the SP URL containing code and state is returned
105
+ const handleShouldStartLoading = (onSuccess, redirectUrl) => event => {
106
+ if (isCardReadingFinished && event.url.includes(redirectUrl)) {
107
+ onSuccess(event.url);
108
+ return false;
109
+ } else {
110
+ return true;
111
+ }
112
+ };
113
+ const handleOnLoadEnd = (onError, onCieEvent) => e => {
114
+ const eventTitle = e.nativeEvent.title.toLowerCase();
115
+ if (eventTitle === "pagina web non disponibile" ||
116
+ // On Android, if we attempt to access the idp URL twice,
117
+ // we are presented with an error page titled "ERROR".
118
+ eventTitle === "errore") {
119
+ handleOnError(onError)(new Error(eventTitle));
120
+ }
121
+
122
+ /* At the end of loading the page, if the card has already been read
123
+ * then the WebView has loaded the page to ask the user for consent,
124
+ * so send the completed event
125
+ * */
126
+ if (isCardReadingFinished) {
127
+ onCieEvent(CieEvent.completed);
128
+ }
129
+ };
130
+ const handleOnError = onError => e => {
131
+ const error = e;
132
+ const webViewError = e;
133
+ const webViewHttpError = e;
134
+ if (webViewHttpError.nativeEvent.statusCode) {
135
+ const {
136
+ description,
137
+ statusCode
138
+ } = webViewHttpError.nativeEvent;
139
+ onError(new _error.CieError({
140
+ message: `WebView http error: ${description} with status code: ${statusCode}`,
141
+ type: _error.CieErrorType.WEB_VIEW_ERROR
142
+ }));
143
+ } else if (webViewError.nativeEvent) {
144
+ const {
145
+ code,
146
+ description
147
+ } = webViewError.nativeEvent;
148
+ onError(new _error.CieError({
149
+ message: `WebView error: ${description} with code: ${code}`,
150
+ type: _error.CieErrorType.WEB_VIEW_ERROR
151
+ }));
152
+ } else if (error.message !== undefined) {
153
+ onError(new _error.CieError({
154
+ message: `${error.message}`,
155
+ type: _error.CieErrorType.WEB_VIEW_ERROR
156
+ }));
157
+ } else {
158
+ onError(new _error.CieError({
159
+ message: "An error occurred in the WebView",
160
+ type: _error.CieErrorType.WEB_VIEW_ERROR
161
+ }));
162
+ }
163
+ };
164
+ return /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
165
+ ref: webView,
166
+ userAgent: defaultUserAgent,
167
+ javaScriptEnabled: true,
168
+ source: {
169
+ uri: webViewUrl
170
+ },
171
+ onLoadEnd: handleOnLoadEnd(params.onError, params.onEvent),
172
+ onError: handleOnError(params.onError),
173
+ onHttpError: handleOnError(params.onError),
174
+ injectedJavaScript: injectedJavaScript,
175
+ onShouldStartLoadWithRequest: handleShouldStartLoading(params.onSuccess, params.redirectUrl),
176
+ onMessage: handleMessage
177
+ });
178
+ };
179
+ exports.WebViewComponent = WebViewComponent;
180
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeWebview","_manager","_error","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","injectedJavaScript","CieEvent","exports","iOSUserAgent","defaultUserAgent","Platform","select","ios","undefined","webView","createRef","WebViewComponent","params","webViewUrl","setWebViewUrl","React","useState","authUrl","isCardReadingFinished","setCardReadingFinished","continueWithUrl","callbackUrl","handleMessage","event","cieAuthorizationUri","nativeEvent","data","startCie","startCieiOS","startCieAndroid","useUat","pin","onError","onEvent","handleShouldStartLoading","onSuccess","redirectUrl","url","includes","handleOnLoadEnd","onCieEvent","e","eventTitle","title","toLowerCase","handleOnError","Error","completed","error","webViewError","webViewHttpError","statusCode","description","CieError","message","type","CieErrorType","WEB_VIEW_ERROR","code","createElement","WebView","ref","userAgent","javaScriptEnabled","source","uri","onLoadEnd","onHttpError","onShouldStartLoadWithRequest","onMessage"],"sourceRoot":"../../../src","sources":["cie/component.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AASA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAiD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,M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BAAiB;IAC5B2D,iBAAiB,EAAE,IAAK;IACxBC,MAAM,EAAE;MAAEC,GAAG,EAAEpD;IAAW,CAAE;IAC5BqD,SAAS,EAAE3B,eAAe,CAAC3B,MAAM,CAACoB,OAAO,EAAEpB,MAAM,CAACqB,OAAO,CAAE;IAC3DD,OAAO,EAAEa,aAAa,CAACjC,MAAM,CAACoB,OAAO,CAAE;IACvCmC,WAAW,EAAEtB,aAAa,CAACjC,MAAM,CAACoB,OAAO,CAAE;IAC3ChC,kBAAkB,EAAEA,kBAAmB;IACvCoE,4BAA4B,EAAElC,wBAAwB,CACpDtB,MAAM,CAACuB,SAAS,EAChBvB,MAAM,CAACwB,WACT,CAAE;IACFiC,SAAS,EAAE/C;EAAc,CAC1B,CAAC;AAEN,CAAC;AAACpB,OAAA,CAAAS,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CieErrorType = exports.CieError = void 0;
7
+ let CieErrorType = /*#__PURE__*/function (CieErrorType) {
8
+ CieErrorType[CieErrorType["GENERIC"] = 0] = "GENERIC";
9
+ CieErrorType[CieErrorType["TAG_NOT_VALID"] = 1] = "TAG_NOT_VALID";
10
+ CieErrorType[CieErrorType["WEB_VIEW_ERROR"] = 2] = "WEB_VIEW_ERROR";
11
+ CieErrorType[CieErrorType["NFC_ERROR"] = 3] = "NFC_ERROR";
12
+ CieErrorType[CieErrorType["AUTHENTICATION_ERROR"] = 4] = "AUTHENTICATION_ERROR";
13
+ CieErrorType[CieErrorType["PIN_ERROR"] = 5] = "PIN_ERROR";
14
+ CieErrorType[CieErrorType["PIN_LOCKED"] = 6] = "PIN_LOCKED";
15
+ CieErrorType[CieErrorType["CERTIFICATE_ERROR"] = 7] = "CERTIFICATE_ERROR";
16
+ return CieErrorType;
17
+ }({});
18
+ exports.CieErrorType = CieErrorType;
19
+ class CieError extends Error {
20
+ constructor(options) {
21
+ super(options.message);
22
+ if (options.type) {
23
+ this.type = options.type;
24
+ } else {
25
+ this.type = CieErrorType.GENERIC;
26
+ }
27
+ if (this.type === CieErrorType.PIN_ERROR) {
28
+ this.attemptsLeft = options.attemptsLeft;
29
+ } else if (this.type === CieErrorType.PIN_LOCKED) {
30
+ this.attemptsLeft = 0;
31
+ }
32
+ this.name = this.constructor.name;
33
+ }
34
+ toString() {
35
+ return JSON.stringify({
36
+ name: this.name,
37
+ type: CieErrorType[this.type],
38
+ message: this.message,
39
+ attemptsLeft: this.attemptsLeft
40
+ });
41
+ }
42
+ }
43
+ exports.CieError = CieError;
44
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CieErrorType","exports","CieError","Error","constructor","options","message","type","GENERIC","PIN_ERROR","attemptsLeft","PIN_LOCKED","name","toString","JSON","stringify"],"sourceRoot":"../../../src","sources":["cie/error.ts"],"mappings":";;;;;;IAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAAAC,OAAA,CAAAD,YAAA,GAAAA,YAAA;AA4BjB,MAAME,QAAQ,SAASC,KAAK,CAAC;EAGlCC,WAAWA,CAACC,OAAqB,EAAE;IACjC,KAAK,CAACA,OAAO,CAACC,OAAO,CAAC;IAEtB,IAAID,OAAO,CAACE,IAAI,EAAE;MAChB,IAAI,CAACA,IAAI,GAAGF,OAAO,CAACE,IAAI;IAC1B,CAAC,MAAM;MACL,IAAI,CAACA,IAAI,GAAGP,YAAY,CAACQ,OAAO;IAClC;IAEA,IAAI,IAAI,CAACD,IAAI,KAAKP,YAAY,CAACS,SAAS,EAAE;MACxC,IAAI,CAACC,YAAY,GAAGL,OAAO,CAACK,YAAY;IAC1C,CAAC,MAAM,IAAI,IAAI,CAACH,IAAI,KAAKP,YAAY,CAACW,UAAU,EAAE;MAChD,IAAI,CAACD,YAAY,GAAG,CAAC;IACvB;IAEA,IAAI,CAACE,IAAI,GAAG,IAAI,CAACR,WAAW,CAACQ,IAAI;EACnC;EAEAC,QAAQA,CAAA,EAAW;IACjB,OAAOC,IAAI,CAACC,SAAS,CAAC;MACpBH,IAAI,EAAE,IAAI,CAACA,IAAI;MACfL,IAAI,EAAEP,YAAY,CAAC,IAAI,CAACO,IAAI,CAAC;MAC7BD,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBI,YAAY,EAAE,IAAI,CAACA;IACrB,CAAC,CAAC;EACJ;AACF;AAACT,OAAA,CAAAC,QAAA,GAAAA,QAAA"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "CieError", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _error.CieError;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "CieErrorType", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _error.CieErrorType;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "CieEvent", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _component.CieEvent;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "WebViewComponent", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _component.WebViewComponent;
28
+ }
29
+ });
30
+ var _component = require("./component");
31
+ var _error = require("./error");
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_component","require","_error"],"sourceRoot":"../../../src","sources":["cie/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.startCieiOS = exports.startCieAndroid = void 0;
7
+ var _reactNativeCie = _interopRequireDefault(require("@pagopa/react-native-cie"));
8
+ var _reactNative = require("react-native");
9
+ var _component = require("./component");
10
+ var _error = require("./error");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ const BASE_UAT_URL = "https://collaudo.idserver.servizicie.interno.gov.it/idp/";
13
+ const startCieAndroid = (useCieUat, ciePin, onError, onEvent, cieAuthorizationUri, continueWithUrl) => {
14
+ try {
15
+ _reactNativeCie.default.removeAllListeners();
16
+ _reactNativeCie.default.start().then(async () => {
17
+ _reactNativeCie.default.onEvent(handleCieEvent(onError, onEvent));
18
+ _reactNativeCie.default.onError(e => {
19
+ console.error(e);
20
+ return onError(new _error.CieError({
21
+ message: e.message
22
+ }));
23
+ });
24
+ _reactNativeCie.default.onSuccess(handleCieSuccess(continueWithUrl));
25
+ await _reactNativeCie.default.setPin(ciePin);
26
+ _reactNativeCie.default.setAuthenticationUrl(cieAuthorizationUri);
27
+ _reactNativeCie.default.enableLog(useCieUat);
28
+ _reactNativeCie.default.setCustomIdpUrl(useCieUat ? getCieUatEndpoint() : null);
29
+ await _reactNativeCie.default.startListeningNFC();
30
+ onEvent(_component.CieEvent.waiting_card);
31
+ }).catch(onError);
32
+ } catch {
33
+ onError(new _error.CieError({
34
+ message: "Unable to start CIE NFC manager on iOS",
35
+ type: _error.CieErrorType.NFC_ERROR
36
+ }));
37
+ }
38
+ };
39
+ exports.startCieAndroid = startCieAndroid;
40
+ const startCieiOS = async (useCieUat, ciePin, onError, onEvent, cieAuthorizationUri, continueWithUrl) => {
41
+ try {
42
+ _reactNativeCie.default.removeAllListeners();
43
+ _reactNativeCie.default.onEvent(handleCieEvent(onError, onEvent));
44
+ _reactNativeCie.default.onError(e => onError(new _error.CieError({
45
+ message: e.message
46
+ })));
47
+ _reactNativeCie.default.onSuccess(handleCieSuccess(continueWithUrl));
48
+ _reactNativeCie.default.enableLog(useCieUat);
49
+ _reactNativeCie.default.setCustomIdpUrl(useCieUat ? getCieUatEndpoint() : null);
50
+ await _reactNativeCie.default.setPin(ciePin);
51
+ _reactNativeCie.default.setAuthenticationUrl(cieAuthorizationUri);
52
+ _reactNativeCie.default.start().then(async () => {
53
+ await _reactNativeCie.default.startListeningNFC();
54
+ onEvent(_component.CieEvent.waiting_card);
55
+ }).catch(onError);
56
+ } catch {
57
+ onError(new _error.CieError({
58
+ message: "Unable to start CIE NFC manager on Android",
59
+ type: _error.CieErrorType.NFC_ERROR
60
+ }));
61
+ }
62
+ };
63
+ exports.startCieiOS = startCieiOS;
64
+ const handleCieEvent = (onError, onEvent) => event => {
65
+ switch (event.event) {
66
+ // Reading starts
67
+ case "ON_TAG_DISCOVERED":
68
+ onEvent(_component.CieEvent.reading);
69
+ break;
70
+ // "Function not supported" seems to be TAG_ERROR_NFC_NOT_SUPPORTED
71
+ // for the iOS SDK
72
+ case "Function not supported":
73
+ case "TAG_ERROR_NFC_NOT_SUPPORTED":
74
+ case "ON_TAG_DISCOVERED_NOT_CIE":
75
+ onError(new _error.CieError({
76
+ message: `Invalid CIE card: ${event.event}`,
77
+ type: _error.CieErrorType.TAG_NOT_VALID
78
+ }));
79
+ break;
80
+ case "AUTHENTICATION_ERROR":
81
+ case "ON_NO_INTERNET_CONNECTION":
82
+ onError(new _error.CieError({
83
+ message: `Authentication error or no internet connection`,
84
+ type: _error.CieErrorType.AUTHENTICATION_ERROR
85
+ }));
86
+ break;
87
+ case "EXTENDED_APDU_NOT_SUPPORTED":
88
+ onError(new _error.CieError({
89
+ message: `APDU not supported`,
90
+ type: _error.CieErrorType.NFC_ERROR
91
+ }));
92
+ break;
93
+ case "Transmission Error":
94
+ case "ON_TAG_LOST":
95
+ onError(new _error.CieError({
96
+ message: `Trasmission error`,
97
+ type: _error.CieErrorType.NFC_ERROR
98
+ }));
99
+ break;
100
+
101
+ // The card is temporarily locked. Unlock is available by CieID app
102
+ case "PIN Locked":
103
+ case "ON_CARD_PIN_LOCKED":
104
+ onError(new _error.CieError({
105
+ message: `PIN locked`,
106
+ type: _error.CieErrorType.PIN_LOCKED
107
+ }));
108
+ break;
109
+ case "ON_PIN_ERROR":
110
+ onError(new _error.CieError({
111
+ message: `PIN locked`,
112
+ type: _error.CieErrorType.PIN_ERROR,
113
+ attemptsLeft: event.attemptsLeft
114
+ }));
115
+ break;
116
+
117
+ // CIE is Expired or Revoked
118
+ case "CERTIFICATE_EXPIRED":
119
+ onError(new _error.CieError({
120
+ message: `Certificate expired`,
121
+ type: _error.CieErrorType.CERTIFICATE_ERROR
122
+ }));
123
+ break;
124
+ case "CERTIFICATE_REVOKED":
125
+ onError(new _error.CieError({
126
+ message: `Certificate revoked`,
127
+ type: _error.CieErrorType.CERTIFICATE_ERROR
128
+ }));
129
+ break;
130
+ default:
131
+ break;
132
+ }
133
+ };
134
+ const handleCieSuccess = continueWithUrl => url => {
135
+ continueWithUrl(decodeURIComponent(url));
136
+ };
137
+ const getCieUatEndpoint = () => _reactNative.Platform.select({
138
+ ios: `${BASE_UAT_URL}Authn/SSL/Login2`,
139
+ android: BASE_UAT_URL,
140
+ default: null
141
+ });
142
+ //# sourceMappingURL=manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeCie","_interopRequireDefault","require","_reactNative","_component","_error","obj","__esModule","default","BASE_UAT_URL","startCieAndroid","useCieUat","ciePin","onError","onEvent","cieAuthorizationUri","continueWithUrl","cieManager","removeAllListeners","start","then","handleCieEvent","e","console","error","CieError","message","onSuccess","handleCieSuccess","setPin","setAuthenticationUrl","enableLog","setCustomIdpUrl","getCieUatEndpoint","startListeningNFC","CieEvent","waiting_card","catch","type","CieErrorType","NFC_ERROR","exports","startCieiOS","event","reading","TAG_NOT_VALID","AUTHENTICATION_ERROR","PIN_LOCKED","PIN_ERROR","attemptsLeft","CERTIFICATE_ERROR","url","decodeURIComponent","Platform","select","ios","android"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AK,cAAc;MACjBlC,OAAO,CACL,IAAIY,eAAQ,CAAC;QACXC,OAAO,EAAG,YAAW;QACrBY,IAAI,EAAEC,mBAAY,CAACS,SAAS;QAC5BC,YAAY,EAAEN,KAAK,CAACM;MACtB,CAAC,CACH,CAAC;MACD;;IAEF;IACA,KAAK,qBAAqB;MACxBpC,OAAO,CACL,IAAIY,eAAQ,CAAC;QACXC,OAAO,EAAG,qBAAoB;QAC9BY,IAAI,EAAEC,mBAAY,CAACW;MACrB,CAAC,CACH,CAAC;MACD;IACF,KAAK,qBAAqB;MACxBrC,OAAO,CACL,IAAIY,eAAQ,CAAC;QACXC,OAAO,EAAG,qBAAoB;QAC9BY,IAAI,EAAEC,mBAAY,CAACW;MACrB,CAAC,CACH,CAAC;MAED;IAEF;MACE;EACJ;AACF,CAAC;AAEH,MAAMtB,gBAAgB,GACnBZ,eAAgC,IAAMmC,GAAW,IAAK;EACrDnC,eAAe,CAACoC,kBAAkB,CAACD,GAAG,CAAC,CAAC;AAC1C,CAAC;AAEH,MAAMlB,iBAAiB,GAAGA,CAAA,KACxBoB,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAG,GAAE9C,YAAa,kBAAiB;EACtC+C,OAAO,EAAE/C,YAAY;EACrBD,OAAO,EAAE;AACX,CAAC,CAAC"}
@@ -27,10 +27,13 @@ const getWalletProviderClient = context => {
27
27
  } = context;
28
28
  return (0, _walletProvider.createApiClient)((method, url, params) => appFetch(url, {
29
29
  method,
30
- body: params ? JSON.stringify(params.body) : undefined
30
+ body: params ? JSON.stringify(params.body) : undefined,
31
+ headers: {
32
+ "Content-Type": "application/json"
33
+ }
31
34
  }).then(validateResponse).then(res => {
32
35
  const contentType = res.headers.get("content-type");
33
- if (contentType === "application/json") {
36
+ if (contentType !== null && contentType !== void 0 && contentType.includes("application/json")) {
34
37
  return res.json();
35
38
  }
36
39
  return res.text();
@@ -1 +1 @@
1
- {"version":3,"names":["_errors","require","_walletProvider","validateResponse","response","ok","problemDetail","ProblemDetail","parse","json","title","WalletProviderResponseError","type","detail","status","getWalletProviderClient","context","walletProviderBaseUrl","appFetch","fetch","createWalletProviderApiClient","method","url","params","body","JSON","stringify","undefined","then","res","contentType","headers","get","text","exports"],"sourceRoot":"../../../src","sources":["client/index.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAQA,MAAME,gBAAgB,GAAG,MAAOC,QAAkB,IAAK;EACrD,IAAI,CAACA,QAAQ,CAACC,EAAE,EAAE;IAChB,IAAIC,aAA4B,GAAG,CAAC,CAAC;IACrC,IAAI;MACFA,aAAa,GAAGC,6BAAa,CAACC,KAAK,CAAC,MAAMJ,QAAQ,CAACK,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,MAAM;MACNH,aAAa,GAAG;QACdI,KAAK,EAAE;MACT,CAAC;IACH;IAEA,MAAM,IAAIC,mCAA2B,CACnCL,aAAa,CAACI,KAAK,IAAI,uCAAuC,EAC9DJ,aAAa,CAACM,IAAI,EAClBN,aAAa,CAACO,MAAM,EACpBT,QAAQ,CAACU,MACX,CAAC;EACH;EACA,OAAOV,QAAQ;AACjB,CAAC;AAEM,MAAMW,uBAAuB,GAAIC,OAGvC,IAAK;EACJ,MAAM;IAAEC,qBAAqB;IAAEC,QAAQ,GAAGC;EAAM,CAAC,GAAGH,OAAO;EAE3D,OAAO,IAAAI,+BAA6B,EAClC,CAACC,MAAM,EAAEC,GAAG,EAAEC,MAAM,KAClBL,QAAQ,CAACI,GAAG,EAAE;IACZD,MAAM;IACNG,IAAI,EAAED,MAAM,GAAGE,IAAI,CAACC,SAAS,CAACH,MAAM,CAACC,IAAI,CAAC,GAAGG;EAC/C,CAAC,CAAC,CACCC,IAAI,CAACzB,gBAAgB,CAAC,CACtByB,IAAI,CAAEC,GAAG,IAAK;IACb,MAAMC,WAAW,GAAGD,GAAG,CAACE,OAAO,CAACC,GAAG,CAAC,cAAc,CAAC;IACnD,IAAIF,WAAW,KAAK,kBAAkB,EAAE;MACtC,OAAOD,GAAG,CAACpB,IAAI,CAAC,CAAC;IACnB;IACA,OAAOoB,GAAG,CAACI,IAAI,CAAC,CAAC;EACnB,CAAC,CAAC,EACNhB,qBACF,CAAC;AACH,CAAC;AAACiB,OAAA,CAAAnB,uBAAA,GAAAA,uBAAA"}
1
+ {"version":3,"names":["_errors","require","_walletProvider","validateResponse","response","ok","problemDetail","ProblemDetail","parse","json","title","WalletProviderResponseError","type","detail","status","getWalletProviderClient","context","walletProviderBaseUrl","appFetch","fetch","createWalletProviderApiClient","method","url","params","body","JSON","stringify","undefined","headers","then","res","contentType","get","includes","text","exports"],"sourceRoot":"../../../src","sources":["client/index.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAQA,MAAME,gBAAgB,GAAG,MAAOC,QAAkB,IAAK;EACrD,IAAI,CAACA,QAAQ,CAACC,EAAE,EAAE;IAChB,IAAIC,aAA4B,GAAG,CAAC,CAAC;IACrC,IAAI;MACFA,aAAa,GAAGC,6BAAa,CAACC,KAAK,CAAC,MAAMJ,QAAQ,CAACK,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,MAAM;MACNH,aAAa,GAAG;QACdI,KAAK,EAAE;MACT,CAAC;IACH;IAEA,MAAM,IAAIC,mCAA2B,CACnCL,aAAa,CAACI,KAAK,IAAI,uCAAuC,EAC9DJ,aAAa,CAACM,IAAI,EAClBN,aAAa,CAACO,MAAM,EACpBT,QAAQ,CAACU,MACX,CAAC;EACH;EACA,OAAOV,QAAQ;AACjB,CAAC;AAEM,MAAMW,uBAAuB,GAAIC,OAGvC,IAAK;EACJ,MAAM;IAAEC,qBAAqB;IAAEC,QAAQ,GAAGC;EAAM,CAAC,GAAGH,OAAO;EAE3D,OAAO,IAAAI,+BAA6B,EAClC,CAACC,MAAM,EAAEC,GAAG,EAAEC,MAAM,KAClBL,QAAQ,CAACI,GAAG,EAAE;IACZD,MAAM;IACNG,IAAI,EAAED,MAAM,GAAGE,IAAI,CAACC,SAAS,CAACH,MAAM,CAACC,IAAI,CAAC,GAAGG,SAAS;IACtDC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB;EACF,CAAC,CAAC,CACCC,IAAI,CAAC1B,gBAAgB,CAAC,CACtB0B,IAAI,CAAEC,GAAG,IAAK;IACb,MAAMC,WAAW,GAAGD,GAAG,CAACF,OAAO,CAACI,GAAG,CAAC,cAAc,CAAC;IACnD,IAAID,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEE,QAAQ,CAAC,kBAAkB,CAAC,EAAE;MAC7C,OAAOH,GAAG,CAACrB,IAAI,CAAC,CAAC;IACnB;IACA,OAAOqB,GAAG,CAACI,IAAI,CAAC,CAAC;EACnB,CAAC,CAAC,EACNjB,qBACF,CAAC;AACH,CAAC;AAACkB,OAAA,CAAApB,uBAAA,GAAAA,uBAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.completeUserAuthorizationWithQueryMode = exports.completeUserAuthorizationWithFormPostJwtMode = void 0;
6
+ exports.parseAuthRedirectUrl = exports.completeUserAuthorizationWithQueryMode = exports.completeUserAuthorizationWithFormPostJwtMode = void 0;
7
7
  var _auth = require("../../utils/auth");
8
8
  var _misc = require("../../utils/misc");
9
9
  var _parseUrl = _interopRequireDefault(require("parse-url"));
@@ -72,6 +72,10 @@ const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId
72
72
  throw new _errors.AuthorizationError("Invalid authentication redirect url");
73
73
  }
74
74
  }
75
+ return parseAuthRedirectUrl(authRedirectUrl);
76
+ };
77
+ exports.completeUserAuthorizationWithQueryMode = completeUserAuthorizationWithQueryMode;
78
+ const parseAuthRedirectUrl = authRedirectUrl => {
75
79
  const urlParse = (0, _parseUrl.default)(authRedirectUrl);
76
80
  const authRes = _auth.AuthorizationResultShape.safeParse(urlParse.query);
77
81
  if (!authRes.success) {
@@ -86,7 +90,7 @@ const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId
86
90
  };
87
91
 
88
92
  // TODO: SIW-1120 implement generic credential issuance flow
89
- exports.completeUserAuthorizationWithQueryMode = completeUserAuthorizationWithQueryMode;
93
+ exports.parseAuthRedirectUrl = parseAuthRedirectUrl;
90
94
  const completeUserAuthorizationWithFormPostJwtMode = () => {
91
95
  throw new Error("Not implemented");
92
96
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_reactNative","obj","__esModule","default","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","AuthorizationError","message","Linking","addEventListener","_ref","url","includes","openAuthUrlInBrowser","openURL","unitAuthRedirectIsNotUndefined","until","undefined","Promise","all","urlParse","parseUrl","authRes","AuthorizationResultShape","safeParse","query","success","authErr","AuthorizationErrorShape","error","AuthorizationIdpError","data","error_description","exports","completeUserAuthorizationWithFormPostJwtMode","Error"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAAuC,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvC;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,sCA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CAAC;IAEzE,IAAIjB,eAAe,KAAKmB,SAAS,EAAE;MACjC,MAAM,IAAIX,0BAAkB,CAAC,qCAAqC,CAAC;IACrE;EACF;EAEA,MAAMc,QAAQ,GAAG,IAAAC,iBAAQ,EAACvB,eAAe,CAAC;EAC1C,MAAMwB,OAAO,GAAGC,8BAAwB,CAACC,SAAS,CAACJ,QAAQ,CAACK,KAAK,CAAC;EAClE,IAAI,CAACH,OAAO,CAACI,OAAO,EAAE;IACpB,MAAMC,OAAO,GAAGC,6BAAuB,CAACJ,SAAS,CAACJ,QAAQ,CAACK,KAAK,CAAC;IACjE,IAAI,CAACE,OAAO,CAACD,OAAO,EAAE;MACpB,MAAM,IAAIpB,0BAAkB,CAACgB,OAAO,CAACO,KAAK,CAACtB,OAAO,CAAC,CAAC,CAAC;IACvD;;IACA,MAAM,IAAIuB,6BAAqB,CAC7BH,OAAO,CAACI,IAAI,CAACF,KAAK,EAClBF,OAAO,CAACI,IAAI,CAACC,iBACf,CAAC;EACH;EACA,OAAOV,OAAO,CAACS,IAAI;AACrB,CAAC;;AAEH;AAAAE,OAAA,CAAAnD,sCAAA,GAAAA,sCAAA;AACO,MAAMoD,4CAA4C,GAAGA,CAAA,KAAM;EAChE,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;AACpC,CAAC;AAACF,OAAA,CAAAC,4CAAA,GAAAA,4CAAA"}
1
+ {"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_reactNative","obj","__esModule","default","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","AuthorizationError","message","Linking","addEventListener","_ref","url","includes","openAuthUrlInBrowser","openURL","unitAuthRedirectIsNotUndefined","until","undefined","Promise","all","parseAuthRedirectUrl","exports","urlParse","parseUrl","authRes","AuthorizationResultShape","safeParse","query","success","authErr","AuthorizationErrorShape","error","AuthorizationIdpError","data","error_description","completeUserAuthorizationWithFormPostJwtMode","Error"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAAuC,SAAAG,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvC;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,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,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,IAA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B,6BAAqB,CAC7BH,OAAO,CAACI,IAAI,CAACF,KAAK,EAClBF,OAAO,CAACI,IAAI,CAACC,iBACf,CAAC;EACH;EACA,OAAOV,OAAO,CAACS,IAAI;AACrB,CAAC;;AAED;AAAAZ,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACO,MAAMe,4CAA4C,GAAGA,CAAA,KAAM;EAChE,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;AACpC,CAAC;AAACf,OAAA,CAAAc,4CAAA,GAAAA,4CAAA"}
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "obtainCredential", {
27
27
  return _obtainCredential.obtainCredential;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "parseAuthRedirectUrl", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _completeUserAuthorization.parseAuthRedirectUrl;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "startUserAuthorization", {
31
37
  enumerable: true,
32
38
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AAIA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA"}
1
+ {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA"}
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "AuthorizationDetails", {
15
15
  return _par.AuthorizationDetails;
16
16
  }
17
17
  });
18
- exports.WalletInstanceAttestation = exports.WalletInstance = exports.Trust = exports.SdJwt = exports.PID = exports.Errors = exports.Credential = void 0;
18
+ exports.WalletInstanceAttestation = exports.WalletInstance = exports.Trust = exports.SdJwt = exports.PID = exports.Errors = exports.Credential = exports.Cie = void 0;
19
19
  Object.defineProperty(exports, "createCryptoContextFor", {
20
20
  enumerable: true,
21
21
  get: function () {
@@ -44,6 +44,8 @@ var Trust = _interopRequireWildcard(require("./trust"));
44
44
  exports.Trust = Trust;
45
45
  var WalletInstance = _interopRequireWildcard(require("./wallet-instance"));
46
46
  exports.WalletInstance = WalletInstance;
47
+ var Cie = _interopRequireWildcard(require("./cie"));
48
+ exports.Cie = Cie;
47
49
  var _par = require("./utils/par");
48
50
  var _crypto = require("./utils/crypto");
49
51
  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); }
@@ -1 +1 @@
1
- {"version":3,"names":["_jwk","require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","WalletInstance","_par","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;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E,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"}
1
+ {"version":3,"names":["_jwk","require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","WalletInstance","Cie","_par","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAGAA,OAAA;AAEA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA2CG,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAC3C,IAAAG,GAAA,GAAAF,uBAAA,CAAAF,OAAA;AAA6BG,OAAA,CAAAC,GAAA,GAAAA,GAAA;AAC7B,IAAAC,KAAA,GAAAH,uBAAA,CAAAF,OAAA;AAAkCG,OAAA,CAAAE,KA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