@prove-identity/prove-auth 2.7.1 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +8 -9
  2. package/build/bundle/release/prove-auth.js +1 -0
  3. package/build/lib/index.d.ts +3 -2
  4. package/build/lib/index.js +3 -1
  5. package/build/lib/proveauth/authenticator-builder.d.ts +4 -0
  6. package/build/lib/proveauth/authenticator-builder.js +59 -3
  7. package/build/lib/proveauth/darwinium-result.d.ts +11 -0
  8. package/build/lib/proveauth/darwinium-result.js +25 -0
  9. package/build/lib/proveauth/darwinium-wrapper.d.ts +6 -0
  10. package/build/lib/proveauth/darwinium-wrapper.js +97 -0
  11. package/build/lib/proveauth/device-context-options.d.ts +7 -0
  12. package/build/lib/proveauth/device-context-options.js +7 -1
  13. package/build/lib/proveauth/internal/auth-error.js +1 -1
  14. package/build/lib/proveauth/internal/auth-request.d.ts +1 -0
  15. package/build/lib/proveauth/internal/auth-response.d.ts +5 -1
  16. package/build/lib/proveauth/internal/auth-session.d.ts +7 -2
  17. package/build/lib/proveauth/internal/auth-session.js +115 -11
  18. package/build/lib/proveauth/internal/auth-status-actions.js +4 -4
  19. package/build/lib/proveauth/internal/auth-token-claims.d.ts +1 -0
  20. package/build/lib/proveauth/internal/device-auth.d.ts +3 -1
  21. package/build/lib/proveauth/internal/device-passive-register-step.d.ts +1 -0
  22. package/build/lib/proveauth/internal/device-passive-register-step.js +55 -35
  23. package/build/lib/proveauth/internal/device-passive-silent-step.js +9 -1
  24. package/build/lib/proveauth/internal/device-passive-step.d.ts +12 -4
  25. package/build/lib/proveauth/internal/device-passive-step.js +172 -52
  26. package/build/lib/proveauth/internal/device-passive-stepup-step.d.ts +2 -1
  27. package/build/lib/proveauth/internal/device-passive-stepup-step.js +25 -3
  28. package/build/lib/proveauth/internal/device-passive-verify-step.d.ts +3 -2
  29. package/build/lib/proveauth/internal/device-passive-verify-step.js +29 -10
  30. package/build/lib/proveauth/internal/fido-options-error.d.ts +30 -0
  31. package/build/lib/proveauth/internal/fido-options-error.js +161 -0
  32. package/build/lib/proveauth/internal/main-authenticator.js +1 -1
  33. package/build/lib/proveauth/internal/mobile-instantlink-step.js +36 -29
  34. package/build/lib/proveauth/internal/mobile-otp-step.d.ts +3 -0
  35. package/build/lib/proveauth/internal/mobile-otp-step.js +115 -67
  36. package/build/lib/proveauth/internal/platform.d.ts +2 -0
  37. package/build/lib/proveauth/internal/report-error-step.d.ts +1 -2
  38. package/build/lib/proveauth/internal/report-error-step.js +13 -12
  39. package/build/lib/proveauth/internal/scan-message-step.js +1 -1
  40. package/build/lib/proveauth/internal/settings.d.ts +4 -0
  41. package/build/lib/proveauth/internal/settings.js +16 -0
  42. package/build/lib/proveauth/internal/web-device-auth.d.ts +3 -1
  43. package/build/lib/proveauth/internal/web-device-auth.js +31 -15
  44. package/build/lib/proveauth/internal/web-platform.d.ts +2 -1
  45. package/build/lib/proveauth/internal/web-platform.js +19 -0
  46. package/build/lib/proveauth/internal/web-socket-close-reasons.d.ts +15 -0
  47. package/build/lib/proveauth/internal/web-socket-close-reasons.js +19 -0
  48. package/build/lib/proveauth/version.d.ts +2 -2
  49. package/build/lib/proveauth/version.js +2 -2
  50. package/package.json +1 -1
@@ -8,6 +8,8 @@ const mobile_auth_1 = require("@prove-identity/mobile-auth");
8
8
  const platform_1 = require("./platform");
9
9
  const request_signer_v3_1 = __importDefault(require("./request-signer-v3"));
10
10
  const web_device_auth_1 = __importDefault(require("./web-device-auth"));
11
+ const darwinium_result_1 = __importDefault(require("../darwinium-result"));
12
+ const darwinium_wrapper_1 = require("../darwinium-wrapper");
11
13
  class WebSocketMessageChannel {
12
14
  constructor(endpointUrl) {
13
15
  this.webSocket = new WebSocket(endpointUrl);
@@ -168,5 +170,22 @@ class WebPlatform {
168
170
  getOrigin() {
169
171
  return window.location.origin;
170
172
  }
173
+ collectDarwiniumData(iFrameEnabled, iFrameSrc) {
174
+ return new Promise((resolve) => {
175
+ if (iFrameEnabled) {
176
+ if (iFrameSrc) {
177
+ return darwinium_wrapper_1.DarwiniumWrapper.collectDataInIFrame(iFrameSrc).then((result) => resolve(result));
178
+ }
179
+ else {
180
+ const result = new darwinium_result_1.default();
181
+ result.setErr('iFrame is enabled for Darwinium data collection but iFrame src endpoint is unavailable');
182
+ resolve(result);
183
+ }
184
+ }
185
+ else {
186
+ return darwinium_wrapper_1.DarwiniumWrapper.collectData().then((result) => resolve(result));
187
+ }
188
+ });
189
+ }
171
190
  }
172
191
  exports.WebPlatform = WebPlatform;
@@ -0,0 +1,15 @@
1
+ export declare enum WebSocketCloseReasons {
2
+ NORMAL_CLOSURE = "Normal closure",
3
+ GOING_AWAY = "The connection is closed because a server is going down or a browser has navigated away from the page.",
4
+ PROTOCOL_ERROR = "The connection is closed due to a protocol error",
5
+ UNSUPPORTED_DATA = "The connection is closed because it has received unsupported data",
6
+ NO_STATUS_RECEIVED = "No closed status code was actually present.",
7
+ ABNORMAL_CLOSURE = "The connection was closed unexpectedly without a close frame",
8
+ INVALID_FRAME_PAYLOAD_DATA = "The connection was closed because it received inconsistent data in a message.",
9
+ POLICY_VIOLATION = "The connection was closed due to policy violation",
10
+ MESSAGE_TOO_BIG = "The connection was closed because it has received a message that is too big for it to process.",
11
+ MANDATORY_EXTENSION = "The connection was closed because the client required a server extension that was not supported.",
12
+ INTERNAL_ERROR = "The connection was closed because the server encountered an unexpected error",
13
+ TLS_HANDSHAKE = "The connection was closed due to a failure to perform a TLS handshake",
14
+ UNKNOWN_REASON = "Unknown reason"
15
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebSocketCloseReasons = void 0;
4
+ var WebSocketCloseReasons;
5
+ (function (WebSocketCloseReasons) {
6
+ WebSocketCloseReasons["NORMAL_CLOSURE"] = "Normal closure";
7
+ WebSocketCloseReasons["GOING_AWAY"] = "The connection is closed because a server is going down or a browser has navigated away from the page.";
8
+ WebSocketCloseReasons["PROTOCOL_ERROR"] = "The connection is closed due to a protocol error";
9
+ WebSocketCloseReasons["UNSUPPORTED_DATA"] = "The connection is closed because it has received unsupported data";
10
+ WebSocketCloseReasons["NO_STATUS_RECEIVED"] = "No closed status code was actually present.";
11
+ WebSocketCloseReasons["ABNORMAL_CLOSURE"] = "The connection was closed unexpectedly without a close frame";
12
+ WebSocketCloseReasons["INVALID_FRAME_PAYLOAD_DATA"] = "The connection was closed because it received inconsistent data in a message.";
13
+ WebSocketCloseReasons["POLICY_VIOLATION"] = "The connection was closed due to policy violation";
14
+ WebSocketCloseReasons["MESSAGE_TOO_BIG"] = "The connection was closed because it has received a message that is too big for it to process.";
15
+ WebSocketCloseReasons["MANDATORY_EXTENSION"] = "The connection was closed because the client required a server extension that was not supported.";
16
+ WebSocketCloseReasons["INTERNAL_ERROR"] = "The connection was closed because the server encountered an unexpected error";
17
+ WebSocketCloseReasons["TLS_HANDSHAKE"] = "The connection was closed due to a failure to perform a TLS handshake";
18
+ WebSocketCloseReasons["UNKNOWN_REASON"] = "Unknown reason";
19
+ })(WebSocketCloseReasons = exports.WebSocketCloseReasons || (exports.WebSocketCloseReasons = {}));
@@ -1,3 +1,3 @@
1
- export declare const VERSION = "2.7.1";
2
- export declare const API_CONTRACT_VERSION = "2.8.0";
1
+ export declare const VERSION = "2.9.0";
2
+ export declare const API_CONTRACT_VERSION = "2.9.0";
3
3
  export declare const USER_AGENT_VERSIONS: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.USER_AGENT_VERSIONS = exports.API_CONTRACT_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '2.7.1';
5
- exports.API_CONTRACT_VERSION = '2.8.0';
4
+ exports.VERSION = '2.9.0';
5
+ exports.API_CONTRACT_VERSION = '2.9.0';
6
6
  exports.USER_AGENT_VERSIONS = `ProveAuth/${exports.VERSION} Contract/${exports.API_CONTRACT_VERSION} WEB/1`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prove-identity/prove-auth",
3
- "version": "2.7.1",
3
+ "version": "2.9.0",
4
4
  "description": "Prove Auth SDK for Web",
5
5
  "main": "build/lib/index.js",
6
6
  "files": [