@tideorg/js 0.13.26 → 0.13.28

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 (187) hide show
  1. package/dist/Clients/ClientBase.d.ts +32 -1
  2. package/dist/Clients/ClientBase.d.ts.map +1 -1
  3. package/dist/Clients/ClientBase.js +219 -35
  4. package/dist/Clients/ClientBase.js.map +1 -0
  5. package/dist/Clients/NetworkClient.d.ts.map +1 -1
  6. package/dist/Clients/NetworkClient.js +19 -5
  7. package/dist/Clients/NetworkClient.js.map +1 -0
  8. package/dist/Clients/NodeClient.d.ts.map +1 -1
  9. package/dist/Clients/NodeClient.js +61 -13
  10. package/dist/Clients/NodeClient.js.map +1 -0
  11. package/dist/Clients/VoucherClient.js +1 -0
  12. package/dist/Clients/VoucherClient.js.map +1 -0
  13. package/dist/Clients/index.js +1 -0
  14. package/dist/Clients/index.js.map +1 -0
  15. package/dist/Contracts/BaseContract.js +6 -1
  16. package/dist/Contracts/BaseContract.js.map +1 -0
  17. package/dist/Contracts/GenericRealmAccessThresholdRoleContract.js +2 -4
  18. package/dist/Contracts/GenericRealmAccessThresholdRoleContract.js.map +1 -0
  19. package/dist/Contracts/GenericResourceAccessThresholdRoleContract.js +2 -4
  20. package/dist/Contracts/GenericResourceAccessThresholdRoleContract.js.map +1 -0
  21. package/dist/Contracts/index.js +1 -0
  22. package/dist/Contracts/index.js.map +1 -0
  23. package/dist/Cryptide/Components/BaseComponent.js +5 -2
  24. package/dist/Cryptide/Components/BaseComponent.js.map +1 -0
  25. package/dist/Cryptide/Components/ComponentRegistry.js +1 -0
  26. package/dist/Cryptide/Components/ComponentRegistry.js.map +1 -0
  27. package/dist/Cryptide/Components/Schemes/AES/AESScheme.js +1 -0
  28. package/dist/Cryptide/Components/Schemes/AES/AESScheme.js.map +1 -0
  29. package/dist/Cryptide/Components/Schemes/AES/index.js +1 -0
  30. package/dist/Cryptide/Components/Schemes/AES/index.js.map +1 -0
  31. package/dist/Cryptide/Components/Schemes/BaseScheme.js +5 -5
  32. package/dist/Cryptide/Components/Schemes/BaseScheme.js.map +1 -0
  33. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Components.js +17 -16
  34. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Components.js.map +1 -0
  35. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Scheme.js +44 -46
  36. package/dist/Cryptide/Components/Schemes/Ed25519/Ed25519Scheme.js.map +1 -0
  37. package/dist/Cryptide/Components/Schemes/Ed25519/index.js +1 -0
  38. package/dist/Cryptide/Components/Schemes/Ed25519/index.js.map +1 -0
  39. package/dist/Cryptide/Components/Schemes/SchemeRegistry.js +1 -0
  40. package/dist/Cryptide/Components/Schemes/SchemeRegistry.js.map +1 -0
  41. package/dist/Cryptide/Components/Schemes/index.js +1 -0
  42. package/dist/Cryptide/Components/Schemes/index.js.map +1 -0
  43. package/dist/Cryptide/Components/index.js +1 -0
  44. package/dist/Cryptide/Components/index.js.map +1 -0
  45. package/dist/Cryptide/Ed25519.js +7 -0
  46. package/dist/Cryptide/Ed25519.js.map +1 -0
  47. package/dist/Cryptide/Encryption/AES.js +1 -0
  48. package/dist/Cryptide/Encryption/AES.js.map +1 -0
  49. package/dist/Cryptide/Encryption/DH.js +1 -0
  50. package/dist/Cryptide/Encryption/DH.js.map +1 -0
  51. package/dist/Cryptide/Encryption/ElGamal.js +1 -0
  52. package/dist/Cryptide/Encryption/ElGamal.js.map +1 -0
  53. package/dist/Cryptide/Encryption/index.js +1 -0
  54. package/dist/Cryptide/Encryption/index.js.map +1 -0
  55. package/dist/Cryptide/Hashing/H2P.js +1 -0
  56. package/dist/Cryptide/Hashing/H2P.js.map +1 -0
  57. package/dist/Cryptide/Hashing/Hash.js +1 -0
  58. package/dist/Cryptide/Hashing/Hash.js.map +1 -0
  59. package/dist/Cryptide/Hashing/index.js +1 -0
  60. package/dist/Cryptide/Hashing/index.js.map +1 -0
  61. package/dist/Cryptide/Interpolation.js +1 -0
  62. package/dist/Cryptide/Interpolation.js.map +1 -0
  63. package/dist/Cryptide/Math.js +1 -0
  64. package/dist/Cryptide/Math.js.map +1 -0
  65. package/dist/Cryptide/Serialization.d.ts.map +1 -1
  66. package/dist/Cryptide/Serialization.js +44 -8
  67. package/dist/Cryptide/Serialization.js.map +1 -0
  68. package/dist/Cryptide/Signing/BlindSig.d.ts +16 -0
  69. package/dist/Cryptide/Signing/BlindSig.d.ts.map +1 -1
  70. package/dist/Cryptide/Signing/BlindSig.js +46 -1
  71. package/dist/Cryptide/Signing/BlindSig.js.map +1 -0
  72. package/dist/Cryptide/Signing/EdDSA.js +1 -0
  73. package/dist/Cryptide/Signing/EdDSA.js.map +1 -0
  74. package/dist/Cryptide/Signing/TideSignature.d.ts +5 -0
  75. package/dist/Cryptide/Signing/TideSignature.d.ts.map +1 -1
  76. package/dist/Cryptide/Signing/TideSignature.js +29 -17
  77. package/dist/Cryptide/Signing/TideSignature.js.map +1 -0
  78. package/dist/Cryptide/Signing/index.js +1 -0
  79. package/dist/Cryptide/Signing/index.js.map +1 -0
  80. package/dist/Cryptide/TideKey.js +4 -1
  81. package/dist/Cryptide/TideKey.js.map +1 -0
  82. package/dist/Cryptide/TideMemoryObjects.js +1 -0
  83. package/dist/Cryptide/TideMemoryObjects.js.map +1 -0
  84. package/dist/Cryptide/index.js +1 -0
  85. package/dist/Cryptide/index.js.map +1 -0
  86. package/dist/Errors/TideError.d.ts +113 -0
  87. package/dist/Errors/TideError.d.ts.map +1 -0
  88. package/dist/Errors/TideError.js +141 -0
  89. package/dist/Errors/TideError.js.map +1 -0
  90. package/dist/Errors/codes.d.ts +63 -0
  91. package/dist/Errors/codes.d.ts.map +1 -0
  92. package/dist/Errors/codes.js +84 -0
  93. package/dist/Errors/codes.js.map +1 -0
  94. package/dist/Errors/index.d.ts +5 -0
  95. package/dist/Errors/index.d.ts.map +1 -0
  96. package/dist/Errors/index.js +19 -0
  97. package/dist/Errors/index.js.map +1 -0
  98. package/dist/Flow/DecryptionFlows/dVVKDecryptionFlow.d.ts.map +1 -1
  99. package/dist/Flow/DecryptionFlows/dVVKDecryptionFlow.js +19 -2
  100. package/dist/Flow/DecryptionFlows/dVVKDecryptionFlow.js.map +1 -0
  101. package/dist/Flow/DecryptionFlows/index.js +1 -0
  102. package/dist/Flow/DecryptionFlows/index.js.map +1 -0
  103. package/dist/Flow/EncryptionFlows/AuthorizedEncryptionFlow.d.ts.map +1 -1
  104. package/dist/Flow/EncryptionFlows/AuthorizedEncryptionFlow.js +21 -2
  105. package/dist/Flow/EncryptionFlows/AuthorizedEncryptionFlow.js.map +1 -0
  106. package/dist/Flow/EncryptionFlows/PolicyAuthorizedEncryptionFlow.d.ts.map +1 -1
  107. package/dist/Flow/EncryptionFlows/PolicyAuthorizedEncryptionFlow.js +27 -2
  108. package/dist/Flow/EncryptionFlows/PolicyAuthorizedEncryptionFlow.js.map +1 -0
  109. package/dist/Flow/EncryptionFlows/index.js +1 -0
  110. package/dist/Flow/EncryptionFlows/index.js.map +1 -0
  111. package/dist/Flow/SigningFlows/AuthorizedSigningFlow.d.ts.map +1 -1
  112. package/dist/Flow/SigningFlows/AuthorizedSigningFlow.js +12 -2
  113. package/dist/Flow/SigningFlows/AuthorizedSigningFlow.js.map +1 -0
  114. package/dist/Flow/SigningFlows/dTestVVkSigningFlow.d.ts.map +1 -1
  115. package/dist/Flow/SigningFlows/dTestVVkSigningFlow.js +28 -2
  116. package/dist/Flow/SigningFlows/dTestVVkSigningFlow.js.map +1 -0
  117. package/dist/Flow/SigningFlows/dVVKSigningFlow.d.ts.map +1 -1
  118. package/dist/Flow/SigningFlows/dVVKSigningFlow.js +24 -3
  119. package/dist/Flow/SigningFlows/dVVKSigningFlow.js.map +1 -0
  120. package/dist/Flow/SigningFlows/dVVKSigningFlow2Step.d.ts.map +1 -1
  121. package/dist/Flow/SigningFlows/dVVKSigningFlow2Step.js +63 -10
  122. package/dist/Flow/SigningFlows/dVVKSigningFlow2Step.js.map +1 -0
  123. package/dist/Flow/SigningFlows/index.js +1 -0
  124. package/dist/Flow/SigningFlows/index.js.map +1 -0
  125. package/dist/Flow/VoucherFlows/VoucherFlow.js +4 -0
  126. package/dist/Flow/VoucherFlows/VoucherFlow.js.map +1 -0
  127. package/dist/Flow/VoucherFlows/index.js +1 -0
  128. package/dist/Flow/VoucherFlows/index.js.map +1 -0
  129. package/dist/Flow/index.js +1 -0
  130. package/dist/Flow/index.js.map +1 -0
  131. package/dist/Math/KeyDecryption.js +1 -0
  132. package/dist/Math/KeyDecryption.js.map +1 -0
  133. package/dist/Math/KeySigning.d.ts.map +1 -1
  134. package/dist/Math/KeySigning.js +19 -4
  135. package/dist/Math/KeySigning.js.map +1 -0
  136. package/dist/Math/index.js +1 -0
  137. package/dist/Math/index.js.map +1 -0
  138. package/dist/Models/AuthRequest.js +7 -0
  139. package/dist/Models/AuthRequest.js.map +1 -0
  140. package/dist/Models/BaseTideRequest.js +13 -0
  141. package/dist/Models/BaseTideRequest.js.map +1 -0
  142. package/dist/Models/CustomTideRequest.js +2 -0
  143. package/dist/Models/CustomTideRequest.js.map +1 -0
  144. package/dist/Models/Datum.js +3 -0
  145. package/dist/Models/Datum.js.map +1 -0
  146. package/dist/Models/Doken.js +14 -0
  147. package/dist/Models/Doken.js.map +1 -0
  148. package/dist/Models/EnclaveEntry.js +8 -0
  149. package/dist/Models/EnclaveEntry.js.map +1 -0
  150. package/dist/Models/Infos/KeyInfo.js +5 -0
  151. package/dist/Models/Infos/KeyInfo.js.map +1 -0
  152. package/dist/Models/Infos/OrkInfo.js +5 -0
  153. package/dist/Models/Infos/OrkInfo.js.map +1 -0
  154. package/dist/Models/Infos/index.js +1 -0
  155. package/dist/Models/Infos/index.js.map +1 -0
  156. package/dist/Models/ModelRegistry.js +33 -23
  157. package/dist/Models/ModelRegistry.js.map +1 -0
  158. package/dist/Models/Policy.js +14 -3
  159. package/dist/Models/Policy.js.map +1 -0
  160. package/dist/Models/PolicyProtectedSerializedField.js +3 -3
  161. package/dist/Models/PolicyProtectedSerializedField.js.map +1 -0
  162. package/dist/Models/Responses/Vendor/VoucherResponse.js +7 -0
  163. package/dist/Models/Responses/Vendor/VoucherResponse.js.map +1 -0
  164. package/dist/Models/Responses/Vendor/index.js +1 -0
  165. package/dist/Models/Responses/Vendor/index.js.map +1 -0
  166. package/dist/Models/Responses/index.js +1 -0
  167. package/dist/Models/Responses/index.js.map +1 -0
  168. package/dist/Models/SerializedField.js +3 -3
  169. package/dist/Models/SerializedField.js.map +1 -0
  170. package/dist/Models/VendorData.js +5 -0
  171. package/dist/Models/VendorData.js.map +1 -0
  172. package/dist/Models/VendorSettings.js +5 -0
  173. package/dist/Models/VendorSettings.js.map +1 -0
  174. package/dist/Models/index.js +1 -0
  175. package/dist/Models/index.js.map +1 -0
  176. package/dist/Tools/TideMemory.js +1 -0
  177. package/dist/Tools/TideMemory.js.map +1 -0
  178. package/dist/Tools/Utils.d.ts.map +1 -1
  179. package/dist/Tools/Utils.js +75 -8
  180. package/dist/Tools/Utils.js.map +1 -0
  181. package/dist/Tools/index.js +1 -0
  182. package/dist/Tools/index.js.map +1 -0
  183. package/dist/index.d.ts +1 -0
  184. package/dist/index.d.ts.map +1 -1
  185. package/dist/index.js +2 -0
  186. package/dist/index.js.map +1 -0
  187. package/package.json +1 -1
@@ -0,0 +1,113 @@
1
+ /**
2
+ * One element of {@link TideErrorInit.details} — used by aggregate errors
3
+ * (e.g. "could not reach enough ORKs") to carry the per-attempt failures.
4
+ * Kept structural (not a class) so callers can spread/serialise freely.
5
+ */
6
+ export interface TideErrorDetail {
7
+ /** Per-attempt URL, if known (e.g. `http://hostgateway:1002/Authentication/Auth/Convert?uid=...`). */
8
+ url?: string;
9
+ /** Per-attempt endpoint path, if known. */
10
+ endpoint?: string;
11
+ /** Per-attempt HTTP method, if known. */
12
+ method?: string;
13
+ /** Canonical error code of the underlying failure. */
14
+ code?: string;
15
+ /** UI-safe message of the underlying failure. */
16
+ displayMessage?: string;
17
+ /** Underlying error object (preserved for stack inspection in the console). */
18
+ cause?: unknown;
19
+ }
20
+ /**
21
+ * Initialiser shape for {@link TideError}. Always passed as a single object
22
+ * so call-sites are self-documenting and field order can never drift.
23
+ */
24
+ export interface TideErrorInit {
25
+ /**
26
+ * Canonical error code. Either a {@link TideJsErrorCodes} value, or — for
27
+ * pass-through of upstream Problem Details — the upstream code verbatim
28
+ * (e.g. `"TIDE-ORK-SIG-VERIFY_FAILED"`).
29
+ */
30
+ code: string;
31
+ /** Human-readable, UI-safe message. For upstream errors this comes from `problem.detail`. */
32
+ displayMessage: string;
33
+ /** Optional i18n message key, mirroring the upstream Problem Details `messageKey`. */
34
+ messageKey?: string | null;
35
+ /** Optional i18n message params, mirroring the upstream Problem Details `messageParams`. */
36
+ messageParams?: Record<string, unknown> | null;
37
+ /** W3C trace-context `traceparent` value, propagated verbatim from upstream. */
38
+ traceId?: string;
39
+ /** Server-side source location, e.g. `"Ork/Voucher/Verifier.cs:142"`, or the tide-js call-site for locally-originated errors. */
40
+ source?: string;
41
+ /** HTTP status code if the error originated from an HTTP response. */
42
+ httpStatus?: number;
43
+ /** The Problem Details `type` URI (e.g. `"urn:tide:errors:TIDE-ORK-SIG-VERIFY_FAILED"`). */
44
+ problemType?: string;
45
+ /**
46
+ * Full request URL that this error originated from, when knowable at
47
+ * throw-time. Populated for client-emitted network errors so a dev
48
+ * inspecting the console immediately sees which ORK / endpoint failed.
49
+ * Server-emitted Problem Details responses leave this `undefined`.
50
+ */
51
+ url?: string;
52
+ /** Path portion of {@link url} alone, e.g. `/Authentication/Auth/Convert`. */
53
+ endpoint?: string;
54
+ /** HTTP method of the failed request, e.g. `"GET"` / `"POST"`. */
55
+ method?: string;
56
+ /**
57
+ * For aggregate errors (e.g. "not enough ORKs reached threshold"): the
58
+ * underlying per-attempt failures. Each entry summarises one failed call.
59
+ */
60
+ details?: TideErrorDetail[];
61
+ /** Underlying cause (network error, JSON parse error, raw response text, ...). */
62
+ cause?: unknown;
63
+ }
64
+ /**
65
+ * Single, structured error type thrown across tide-js.
66
+ *
67
+ * Consumers (notably keycloak-IGA's `getTideErrorInfo`) introspect instances
68
+ * via {@link TideError.isTideError} and read the listed fields directly — so
69
+ * the field names here form a cross-project public contract and MUST NOT be
70
+ * renamed without coordination.
71
+ */
72
+ export declare class TideError extends Error {
73
+ /** Canonical error code (see {@link TideErrorInit.code}). */
74
+ readonly code: string;
75
+ /** UI-safe message (see {@link TideErrorInit.displayMessage}). */
76
+ readonly displayMessage: string;
77
+ readonly messageKey?: string | null;
78
+ readonly messageParams?: Record<string, unknown> | null;
79
+ readonly traceId?: string;
80
+ readonly source?: string;
81
+ readonly httpStatus?: number;
82
+ readonly problemType?: string;
83
+ /** Full request URL when knowable (client-emitted network errors only). */
84
+ readonly url?: string;
85
+ /** Endpoint path portion of {@link url}. */
86
+ readonly endpoint?: string;
87
+ /** HTTP method of the failed request. */
88
+ readonly method?: string;
89
+ /** Per-attempt underlying failures, populated on aggregate errors only. */
90
+ readonly details?: TideErrorDetail[];
91
+ constructor(init: TideErrorInit);
92
+ /**
93
+ * Developer-facing string form. Surfaces the most-useful debugging fields
94
+ * (`method`, `url`, `source`, `httpStatus`, `cause`, and a summary of
95
+ * `details` for aggregate errors) at the top of the printed error so a
96
+ * dev opening the browser console sees them immediately instead of
97
+ * having to expand `cause` or scroll through stack frames.
98
+ *
99
+ * Format example:
100
+ * TideError[TIDE-TIDEJS-NET-FETCH_FAILED]: Network request failed
101
+ * method: POST
102
+ * url: http://hostgateway:1002/Authentication/Auth/Convert?uid=...
103
+ * source: Clients/ClientBase.ts:_post
104
+ * cause: TypeError: Failed to fetch
105
+ */
106
+ toString(): string;
107
+ /**
108
+ * Structural type guard. Used by external consumers (keycloak-IGA) that
109
+ * cannot rely on `instanceof` across module/bundling boundaries.
110
+ */
111
+ static isTideError(e: unknown): e is TideError;
112
+ }
113
+ //# sourceMappingURL=TideError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TideError.d.ts","sourceRoot":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E,MAAM,CAAC;IAC7B,kEAAkE;IAClE,SAAgB,cAAc,EAAE,MAAM,CAAC;IACvC,SAAgB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,SAAgB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjC,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrC,2EAA2E;IAC3E,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC7B,4CAA4C;IAC5C,SAAgB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClC,yCAAyC;IACzC,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChC,2EAA2E;IAC3E,SAAgB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;gBAEhC,IAAI,EAAE,aAAa;IAsC/B;;;;;;;;;;;;;OAaG;IACM,QAAQ,IAAI,MAAM;IA4B3B;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,SAAS;CAQjD"}
@@ -0,0 +1,141 @@
1
+ //
2
+ // Tide Protocol - Infrastructure for a TRUE Zero-Trust paradigm
3
+ // Copyright (C) 2022 Tide Foundation Ltd
4
+ //
5
+ // This program is free software and is subject to the terms of
6
+ // the Tide Community Open Code License as published by the
7
+ // Tide Foundation Limited. You may modify it and redistribute
8
+ // it in accordance with and subject to the terms of that License.
9
+ // This program is distributed WITHOUT WARRANTY of any kind,
10
+ // including without any implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE.
12
+ // See the Tide Community Open Code License for more details.
13
+ // You should have received a copy of the Tide Community Open
14
+ // Code License along with this program.
15
+ // If not, see https://tide.org/licenses_tcoc2-0-0-en
16
+ //
17
+ /**
18
+ * Single, structured error type thrown across tide-js.
19
+ *
20
+ * Consumers (notably keycloak-IGA's `getTideErrorInfo`) introspect instances
21
+ * via {@link TideError.isTideError} and read the listed fields directly — so
22
+ * the field names here form a cross-project public contract and MUST NOT be
23
+ * renamed without coordination.
24
+ */
25
+ export class TideError extends Error {
26
+ /** Canonical error code (see {@link TideErrorInit.code}). */
27
+ code;
28
+ /** UI-safe message (see {@link TideErrorInit.displayMessage}). */
29
+ displayMessage;
30
+ messageKey;
31
+ messageParams;
32
+ traceId;
33
+ source;
34
+ httpStatus;
35
+ problemType;
36
+ /** Full request URL when knowable (client-emitted network errors only). */
37
+ url;
38
+ /** Endpoint path portion of {@link url}. */
39
+ endpoint;
40
+ /** HTTP method of the failed request. */
41
+ method;
42
+ /** Per-attempt underlying failures, populated on aggregate errors only. */
43
+ details;
44
+ constructor(init) {
45
+ // `Error.cause` is only honoured by ES2022+; we pass it via the options
46
+ // bag so engines that support it set it for us, and we re-assign below
47
+ // defensively for engines that drop it silently.
48
+ super(init.displayMessage, init.cause !== undefined ? { cause: init.cause } : undefined);
49
+ // Required for downlevel emit (`target` < ES2022) where `Error`
50
+ // subclassing otherwise produces a plain Error at runtime.
51
+ Object.setPrototypeOf(this, TideError.prototype);
52
+ this.name = "TideError";
53
+ this.code = init.code;
54
+ this.displayMessage = init.displayMessage;
55
+ this.messageKey = init.messageKey ?? null;
56
+ this.messageParams = init.messageParams ?? null;
57
+ this.traceId = init.traceId;
58
+ this.source = init.source;
59
+ this.httpStatus = init.httpStatus;
60
+ this.problemType = init.problemType;
61
+ this.url = init.url;
62
+ this.endpoint = init.endpoint;
63
+ this.method = init.method;
64
+ this.details = init.details;
65
+ // Defensive cause assignment (no-op on engines that already set it).
66
+ if (init.cause !== undefined && this.cause === undefined) {
67
+ try {
68
+ Object.defineProperty(this, "cause", {
69
+ value: init.cause,
70
+ writable: true,
71
+ configurable: true,
72
+ });
73
+ }
74
+ catch {
75
+ /* ignore — read-only environments will already have `cause` */
76
+ }
77
+ }
78
+ }
79
+ /**
80
+ * Developer-facing string form. Surfaces the most-useful debugging fields
81
+ * (`method`, `url`, `source`, `httpStatus`, `cause`, and a summary of
82
+ * `details` for aggregate errors) at the top of the printed error so a
83
+ * dev opening the browser console sees them immediately instead of
84
+ * having to expand `cause` or scroll through stack frames.
85
+ *
86
+ * Format example:
87
+ * TideError[TIDE-TIDEJS-NET-FETCH_FAILED]: Network request failed
88
+ * method: POST
89
+ * url: http://hostgateway:1002/Authentication/Auth/Convert?uid=...
90
+ * source: Clients/ClientBase.ts:_post
91
+ * cause: TypeError: Failed to fetch
92
+ */
93
+ toString() {
94
+ const lines = [`TideError[${this.code}]: ${this.displayMessage}`];
95
+ const pad = (label) => (label + ":").padEnd(10, " ");
96
+ if (this.method)
97
+ lines.push(` ${pad("method")}${this.method}`);
98
+ if (this.url)
99
+ lines.push(` ${pad("url")}${this.url}`);
100
+ else if (this.endpoint)
101
+ lines.push(` ${pad("endpoint")}${this.endpoint}`);
102
+ if (this.httpStatus !== undefined)
103
+ lines.push(` ${pad("status")}${this.httpStatus}`);
104
+ if (this.source)
105
+ lines.push(` ${pad("source")}${this.source}`);
106
+ if (this.traceId)
107
+ lines.push(` ${pad("traceId")}${this.traceId}`);
108
+ if (this.details && this.details.length > 0) {
109
+ lines.push(` ${pad("details")}${this.details.length} underlying failure(s):`);
110
+ for (const d of this.details) {
111
+ const tag = d.url ?? d.endpoint ?? "<unknown>";
112
+ const codePart = d.code ? ` [${d.code}]` : "";
113
+ const msgPart = d.displayMessage ? ` ${d.displayMessage}` : "";
114
+ lines.push(` - ${tag}${codePart}${msgPart}`);
115
+ }
116
+ }
117
+ const causeVal = this.cause;
118
+ if (causeVal !== undefined && causeVal !== null) {
119
+ const causeStr = causeVal instanceof Error
120
+ ? `${causeVal.name}: ${causeVal.message}`
121
+ : String(causeVal);
122
+ lines.push(` ${pad("cause")}${causeStr}`);
123
+ }
124
+ return lines.join("\n");
125
+ }
126
+ /**
127
+ * Structural type guard. Used by external consumers (keycloak-IGA) that
128
+ * cannot rely on `instanceof` across module/bundling boundaries.
129
+ */
130
+ static isTideError(e) {
131
+ if (e instanceof TideError)
132
+ return true;
133
+ if (e === null || typeof e !== "object")
134
+ return false;
135
+ const candidate = e;
136
+ return candidate.name === "TideError"
137
+ && typeof candidate.code === "string"
138
+ && typeof candidate.displayMessage === "string";
139
+ }
140
+ }
141
+ //# sourceMappingURL=TideError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TideError.js","sourceRoot":"","sources":["../../Errors/TideError.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,gEAAgE;AAChE,yCAAyC;AACzC,EAAE;AACF,+DAA+D;AAC/D,2DAA2D;AAC3D,8DAA8D;AAC9D,kEAAkE;AAClE,4DAA4D;AAC5D,+DAA+D;AAC/D,oCAAoC;AACpC,6DAA6D;AAC7D,6DAA6D;AAC7D,wCAAwC;AACxC,qDAAqD;AACrD,EAAE;AAmEF;;;;;;;GAOG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAChC,6DAA6D;IAC7C,IAAI,CAAS;IAC7B,kEAAkE;IAClD,cAAc,CAAS;IACvB,UAAU,CAAiB;IAC3B,aAAa,CAAkC;IAC/C,OAAO,CAAU;IACjB,MAAM,CAAU;IAChB,UAAU,CAAU;IACpB,WAAW,CAAU;IACrC,2EAA2E;IAC3D,GAAG,CAAU;IAC7B,4CAA4C;IAC5B,QAAQ,CAAU;IAClC,yCAAyC;IACzB,MAAM,CAAU;IAChC,2EAA2E;IAC3D,OAAO,CAAqB;IAE5C,YAAY,IAAmB;QAC3B,wEAAwE;QACxE,uEAAuE;QACvE,iDAAiD;QACjD,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAEzF,gEAAgE;QAChE,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9B,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;eAClC,OAAO,SAAS,CAAC,cAAc,KAAK,QAAQ,CAAC;IACxD,CAAC;CACJ"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Canonical error codes emitted by tide-js itself.
3
+ *
4
+ * Format: `TIDE-TIDEJS-<CATEGORY>-<NAME>`
5
+ *
6
+ * These are *only* the codes tide-js originates. When tide-js receives an
7
+ * `application/problem+json` body from an upstream component (e.g. ORK,
8
+ * tidecloak-idp-extensions), the upstream `code` is passed through verbatim
9
+ * on the resulting `TideError` and is NOT mapped onto any of these constants.
10
+ */
11
+ export declare const TideJsErrorCodes: Readonly<{
12
+ /** Underlying `fetch` rejected (DNS, connection refused, TLS, CORS, ...). */
13
+ readonly NET_FETCH_FAILED: "TIDE-TIDEJS-NET-FETCH_FAILED";
14
+ /** The request was aborted by our internal `setTimeout(...controller.abort)`. */
15
+ readonly NET_TIMEOUT: "TIDE-TIDEJS-NET-TIMEOUT";
16
+ /** The request was aborted by a caller-supplied `AbortSignal`. */
17
+ readonly NET_ABORTED: "TIDE-TIDEJS-NET-ABORTED";
18
+ /** `response.ok === false` and the body did not carry a recognisable error envelope. */
19
+ readonly NET_NON_OK_STATUS: "TIDE-TIDEJS-NET-NON_OK_STATUS";
20
+ /**
21
+ * Fan-out to multiple ORKs completed but fewer succeeded than the
22
+ * threshold required (e.g. 3 of 5 ORKs unreachable during a sign flow).
23
+ * Carries `details[]` with each per-ORK underlying failure.
24
+ */
25
+ readonly NET_THRESHOLD_FAILURE: "TIDE-TIDEJS-NET-THRESHOLD_FAILURE";
26
+ /** Server sent `application/problem+json` but the body did not parse / lacked required fields. */
27
+ readonly PARSE_PROBLEM_JSON_INVALID: "TIDE-TIDEJS-PARSE-PROBLEM_JSON_INVALID";
28
+ /** Body shape is not understood (e.g. legacy `--FAILED--:` envelope, or unknown format). */
29
+ readonly PARSE_UNKNOWN_FORMAT: "TIDE-TIDEJS-PARSE-UNKNOWN_FORMAT";
30
+ /** A NodeClient response did not contain the expected `index` field (used by `WaitForNumberofORKs` cleanup). */
31
+ readonly PARSE_NODECLIENT_RESPONSE_SHAPE: "TIDE-TIDEJS-PARSE-NODECLIENT_RESPONSE_SHAPE";
32
+ /** TideMemory buffer is too small to read the requested segment (truncated / malformed input). */
33
+ readonly PARSE_INSUFFICIENT_DATA: "TIDE-TIDEJS-PARSE-INSUFFICIENT_DATA";
34
+ /** TideMemory segment index requested is past the end of the buffer's encoded segments. */
35
+ readonly PARSE_INDEX_OUT_OF_RANGE: "TIDE-TIDEJS-PARSE-INDEX_OUT_OF_RANGE";
36
+ /** TideMemory allocation/write would exceed the destination buffer's capacity. */
37
+ readonly PARSE_BUFFER_OVERFLOW: "TIDE-TIDEJS-PARSE-BUFFER_OVERFLOW";
38
+ /** A client method required a session key but `AddBearerAuthorization` was never called. */
39
+ readonly VAL_MISSING_SESSION_KEY: "TIDE-TIDEJS-VAL-MISSING_SESSION_KEY";
40
+ /** A flow input failed a shape/type validation (wrong type, wrong array length, missing required field). */
41
+ readonly VAL_INPUT_SHAPE: "TIDE-TIDEJS-VAL-INPUT_SHAPE";
42
+ /** The supplied username (uid) is not allowed (empty reserver list returned by the network). */
43
+ readonly VAL_UID_FORBIDDEN: "TIDE-TIDEJS-VAL-UID_FORBIDDEN";
44
+ /** The supplied account could not be located on the network (e.g. simulator invalid-account sentinel). */
45
+ readonly VAL_INVALID_ACCOUNT: "TIDE-TIDEJS-VAL-INVALID_ACCOUNT";
46
+ /** The session key the caller supplied does not match the session key bound into the Doken. */
47
+ readonly CRYPTO_SESSION_KEY_MISMATCH: "TIDE-TIDEJS-CRYPTO-SESSION_KEY_MISMATCH";
48
+ /** GRj and Sj arrays produced by a signing flow had differing lengths (should be impossible). */
49
+ readonly CRYPTO_GRJ_SJ_LENGTH_MISMATCH: "TIDE-TIDEJS-CRYPTO-GRJ_SJ_LENGTH_MISMATCH";
50
+ /** Per-ORK response arrays had differing lengths during PreSign/Sign aggregation. */
51
+ readonly CRYPTO_ORK_ARRAY_LENGTH_MISMATCH: "TIDE-TIDEJS-CRYPTO-ORK_ARRAY_LENGTH_MISMATCH";
52
+ /** Local blind-signature verification failed against the expected challenge. */
53
+ readonly SIG_BLIND_VERIFY_FAILED: "TIDE-TIDEJS-SIG-BLIND_VERIFY_FAILED";
54
+ /**
55
+ * tide-js is wrapping an upstream failure in a way that *adds* semantics
56
+ * (e.g. "all ORKs failed", retry exhaustion). For straight pass-through
57
+ * of an upstream Problem Details body, DO NOT use this — preserve the
58
+ * upstream `code` verbatim instead.
59
+ */
60
+ readonly PROXY_UPSTREAM_ERROR: "TIDE-TIDEJS-PROXY-UPSTREAM_ERROR";
61
+ }>;
62
+ export type TideJsErrorCode = typeof TideJsErrorCodes[keyof typeof TideJsErrorCodes];
63
+ //# sourceMappingURL=codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../Errors/codes.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB;IAEzB,6EAA6E;;IAE7E,iFAAiF;;IAEjF,kEAAkE;;IAElE,wFAAwF;;IAExF;;;;OAIG;;IAIH,kGAAkG;;IAElG,4FAA4F;;IAE5F,gHAAgH;;IAEhH,kGAAkG;;IAElG,2FAA2F;;IAE3F,kFAAkF;;IAIlF,4FAA4F;;IAE5F,4GAA4G;;IAE5G,gGAAgG;;IAEhG,0GAA0G;;IAI1G,+FAA+F;;IAE/F,iGAAiG;;IAEjG,qFAAqF;;IAIrF,gFAAgF;;IAIhF;;;;;OAKG;;EAEI,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,84 @@
1
+ //
2
+ // Tide Protocol - Infrastructure for a TRUE Zero-Trust paradigm
3
+ // Copyright (C) 2022 Tide Foundation Ltd
4
+ //
5
+ // This program is free software and is subject to the terms of
6
+ // the Tide Community Open Code License as published by the
7
+ // Tide Foundation Limited. You may modify it and redistribute
8
+ // it in accordance with and subject to the terms of that License.
9
+ // This program is distributed WITHOUT WARRANTY of any kind,
10
+ // including without any implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE.
12
+ // See the Tide Community Open Code License for more details.
13
+ // You should have received a copy of the Tide Community Open
14
+ // Code License along with this program.
15
+ // If not, see https://tide.org/licenses_tcoc2-0-0-en
16
+ //
17
+ /**
18
+ * Canonical error codes emitted by tide-js itself.
19
+ *
20
+ * Format: `TIDE-TIDEJS-<CATEGORY>-<NAME>`
21
+ *
22
+ * These are *only* the codes tide-js originates. When tide-js receives an
23
+ * `application/problem+json` body from an upstream component (e.g. ORK,
24
+ * tidecloak-idp-extensions), the upstream `code` is passed through verbatim
25
+ * on the resulting `TideError` and is NOT mapped onto any of these constants.
26
+ */
27
+ export const TideJsErrorCodes = Object.freeze({
28
+ // --- Network ---------------------------------------------------------
29
+ /** Underlying `fetch` rejected (DNS, connection refused, TLS, CORS, ...). */
30
+ NET_FETCH_FAILED: "TIDE-TIDEJS-NET-FETCH_FAILED",
31
+ /** The request was aborted by our internal `setTimeout(...controller.abort)`. */
32
+ NET_TIMEOUT: "TIDE-TIDEJS-NET-TIMEOUT",
33
+ /** The request was aborted by a caller-supplied `AbortSignal`. */
34
+ NET_ABORTED: "TIDE-TIDEJS-NET-ABORTED",
35
+ /** `response.ok === false` and the body did not carry a recognisable error envelope. */
36
+ NET_NON_OK_STATUS: "TIDE-TIDEJS-NET-NON_OK_STATUS",
37
+ /**
38
+ * Fan-out to multiple ORKs completed but fewer succeeded than the
39
+ * threshold required (e.g. 3 of 5 ORKs unreachable during a sign flow).
40
+ * Carries `details[]` with each per-ORK underlying failure.
41
+ */
42
+ NET_THRESHOLD_FAILURE: "TIDE-TIDEJS-NET-THRESHOLD_FAILURE",
43
+ // --- Parsing ---------------------------------------------------------
44
+ /** Server sent `application/problem+json` but the body did not parse / lacked required fields. */
45
+ PARSE_PROBLEM_JSON_INVALID: "TIDE-TIDEJS-PARSE-PROBLEM_JSON_INVALID",
46
+ /** Body shape is not understood (e.g. legacy `--FAILED--:` envelope, or unknown format). */
47
+ PARSE_UNKNOWN_FORMAT: "TIDE-TIDEJS-PARSE-UNKNOWN_FORMAT",
48
+ /** A NodeClient response did not contain the expected `index` field (used by `WaitForNumberofORKs` cleanup). */
49
+ PARSE_NODECLIENT_RESPONSE_SHAPE: "TIDE-TIDEJS-PARSE-NODECLIENT_RESPONSE_SHAPE",
50
+ /** TideMemory buffer is too small to read the requested segment (truncated / malformed input). */
51
+ PARSE_INSUFFICIENT_DATA: "TIDE-TIDEJS-PARSE-INSUFFICIENT_DATA",
52
+ /** TideMemory segment index requested is past the end of the buffer's encoded segments. */
53
+ PARSE_INDEX_OUT_OF_RANGE: "TIDE-TIDEJS-PARSE-INDEX_OUT_OF_RANGE",
54
+ /** TideMemory allocation/write would exceed the destination buffer's capacity. */
55
+ PARSE_BUFFER_OVERFLOW: "TIDE-TIDEJS-PARSE-BUFFER_OVERFLOW",
56
+ // --- Validation ------------------------------------------------------
57
+ /** A client method required a session key but `AddBearerAuthorization` was never called. */
58
+ VAL_MISSING_SESSION_KEY: "TIDE-TIDEJS-VAL-MISSING_SESSION_KEY",
59
+ /** A flow input failed a shape/type validation (wrong type, wrong array length, missing required field). */
60
+ VAL_INPUT_SHAPE: "TIDE-TIDEJS-VAL-INPUT_SHAPE",
61
+ /** The supplied username (uid) is not allowed (empty reserver list returned by the network). */
62
+ VAL_UID_FORBIDDEN: "TIDE-TIDEJS-VAL-UID_FORBIDDEN",
63
+ /** The supplied account could not be located on the network (e.g. simulator invalid-account sentinel). */
64
+ VAL_INVALID_ACCOUNT: "TIDE-TIDEJS-VAL-INVALID_ACCOUNT",
65
+ // --- Crypto ----------------------------------------------------------
66
+ /** The session key the caller supplied does not match the session key bound into the Doken. */
67
+ CRYPTO_SESSION_KEY_MISMATCH: "TIDE-TIDEJS-CRYPTO-SESSION_KEY_MISMATCH",
68
+ /** GRj and Sj arrays produced by a signing flow had differing lengths (should be impossible). */
69
+ CRYPTO_GRJ_SJ_LENGTH_MISMATCH: "TIDE-TIDEJS-CRYPTO-GRJ_SJ_LENGTH_MISMATCH",
70
+ /** Per-ORK response arrays had differing lengths during PreSign/Sign aggregation. */
71
+ CRYPTO_ORK_ARRAY_LENGTH_MISMATCH: "TIDE-TIDEJS-CRYPTO-ORK_ARRAY_LENGTH_MISMATCH",
72
+ // --- Signature -------------------------------------------------------
73
+ /** Local blind-signature verification failed against the expected challenge. */
74
+ SIG_BLIND_VERIFY_FAILED: "TIDE-TIDEJS-SIG-BLIND_VERIFY_FAILED",
75
+ // --- Proxy / pass-through -------------------------------------------
76
+ /**
77
+ * tide-js is wrapping an upstream failure in a way that *adds* semantics
78
+ * (e.g. "all ORKs failed", retry exhaustion). For straight pass-through
79
+ * of an upstream Problem Details body, DO NOT use this — preserve the
80
+ * upstream `code` verbatim instead.
81
+ */
82
+ PROXY_UPSTREAM_ERROR: "TIDE-TIDEJS-PROXY-UPSTREAM_ERROR",
83
+ });
84
+ //# sourceMappingURL=codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codes.js","sourceRoot":"","sources":["../../Errors/codes.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,gEAAgE;AAChE,yCAAyC;AACzC,EAAE;AACF,+DAA+D;AAC/D,2DAA2D;AAC3D,8DAA8D;AAC9D,kEAAkE;AAClE,4DAA4D;AAC5D,+DAA+D;AAC/D,oCAAoC;AACpC,6DAA6D;AAC7D,6DAA6D;AAC7D,wCAAwC;AACxC,qDAAqD;AACrD,EAAE;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,wEAAwE;IACxE,6EAA6E;IAC7E,gBAAgB,EAAE,8BAA8B;IAChD,iFAAiF;IACjF,WAAW,EAAE,yBAAyB;IACtC,kEAAkE;IAClE,WAAW,EAAE,yBAAyB;IACtC,wFAAwF;IACxF,iBAAiB,EAAE,+BAA+B;IAClD;;;;OAIG;IACH,qBAAqB,EAAE,mCAAmC;IAE1D,wEAAwE;IACxE,kGAAkG;IAClG,0BAA0B,EAAE,wCAAwC;IACpE,4FAA4F;IAC5F,oBAAoB,EAAE,kCAAkC;IACxD,gHAAgH;IAChH,+BAA+B,EAAE,6CAA6C;IAC9E,kGAAkG;IAClG,uBAAuB,EAAE,qCAAqC;IAC9D,2FAA2F;IAC3F,wBAAwB,EAAE,sCAAsC;IAChE,kFAAkF;IAClF,qBAAqB,EAAE,mCAAmC;IAE1D,wEAAwE;IACxE,4FAA4F;IAC5F,uBAAuB,EAAE,qCAAqC;IAC9D,4GAA4G;IAC5G,eAAe,EAAE,6BAA6B;IAC9C,gGAAgG;IAChG,iBAAiB,EAAE,+BAA+B;IAClD,0GAA0G;IAC1G,mBAAmB,EAAE,iCAAiC;IAEtD,wEAAwE;IACxE,+FAA+F;IAC/F,2BAA2B,EAAE,yCAAyC;IACtE,iGAAiG;IACjG,6BAA6B,EAAE,2CAA2C;IAC1E,qFAAqF;IACrF,gCAAgC,EAAE,8CAA8C;IAEhF,wEAAwE;IACxE,gFAAgF;IAChF,uBAAuB,EAAE,qCAAqC;IAE9D,uEAAuE;IACvE;;;;;OAKG;IACH,oBAAoB,EAAE,kCAAkC;CAClD,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { TideError } from "./TideError";
2
+ export type { TideErrorInit, TideErrorDetail } from "./TideError";
3
+ export { TideJsErrorCodes } from "./codes";
4
+ export type { TideJsErrorCode } from "./codes";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Errors/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,19 @@
1
+ //
2
+ // Tide Protocol - Infrastructure for a TRUE Zero-Trust paradigm
3
+ // Copyright (C) 2022 Tide Foundation Ltd
4
+ //
5
+ // This program is free software and is subject to the terms of
6
+ // the Tide Community Open Code License as published by the
7
+ // Tide Foundation Limited. You may modify it and redistribute
8
+ // it in accordance with and subject to the terms of that License.
9
+ // This program is distributed WITHOUT WARRANTY of any kind,
10
+ // including without any implied warranty of MERCHANTABILITY or
11
+ // FITNESS FOR A PARTICULAR PURPOSE.
12
+ // See the Tide Community Open Code License for more details.
13
+ // You should have received a copy of the Tide Community Open
14
+ // Code License along with this program.
15
+ // If not, see https://tide.org/licenses_tcoc2-0-0-en
16
+ //
17
+ export { TideError } from "./TideError";
18
+ export { TideJsErrorCodes } from "./codes";
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../Errors/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,gEAAgE;AAChE,yCAAyC;AACzC,EAAE;AACF,+DAA+D;AAC/D,2DAA2D;AAC3D,8DAA8D;AAC9D,kEAAkE;AAClE,4DAA4D;AAC5D,+DAA+D;AAC/D,oCAAoC;AACpC,6DAA6D;AAC7D,6DAA6D;AAC7D,wCAAwC;AACxC,qDAAqD;AACrD,EAAE;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"dVVKDecryptionFlow.d.ts","sourceRoot":"","sources":["../../../Flow/DecryptionFlows/dVVKDecryptionFlow.ts"],"names":[],"mappings":"AAkBA,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAI3D,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AA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AK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM;IAqBxG,2BAA2B,CAAC,mBAAmB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC;IAI/E,KAAK,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,GAAE,OAAe;CAYpE"}
@@ -18,14 +18,30 @@ import { Max, sortORKs, Threshold, WaitForNumberofORKs } from "../../Tools/Utils
18
18
  import NodeClient from "../../Clients/NodeClient";
19
19
  import VoucherFlow from "../VoucherFlows/VoucherFlow";
20
20
  import { GetKeys } from "../../Math/KeyDecryption";
21
+ import { TideError } from "../../Errors/TideError";
22
+ import { TideJsErrorCodes } from "../../Errors/codes";
21
23
  export default class dVVKDecryptionFlow {
24
+ vvkid;
25
+ vvkPublic;
26
+ orks;
27
+ sessKey;
28
+ doken;
29
+ getVouchersFunction;
30
+ voucherURL;
22
31
  constructor(vvkid, vvkPublic, orks, sessKey, doken, voucherURL) {
23
32
  this.vvkid = vvkid;
24
33
  this.vvkPublic = vvkPublic;
25
34
  this.orks = orks;
26
35
  this.orks = sortORKs(this.orks); // sort for bitwise!
27
- if (!doken.payload.sessionKey.Equals(sessKey.get_public_component()))
28
- throw Error("Mismatch between session key private and Doken session key public");
36
+ if (!doken.payload.sessionKey.Equals(sessKey.get_public_component())) {
37
+ const dokenFp = String(doken.payload.sessionKey.Serialize().ToString()).slice(0, 8);
38
+ const suppliedFp = String(sessKey.get_public_component().Serialize().ToString()).slice(0, 8);
39
+ throw new TideError({
40
+ code: TideJsErrorCodes.CRYPTO_SESSION_KEY_MISMATCH,
41
+ displayMessage: `Doken session key (${dokenFp}) does not match supplied session key (${suppliedFp})`,
42
+ source: "Flow/DecryptionFlows/dVVKDecryptionFlow.ts:41",
43
+ });
44
+ }
29
45
  this.sessKey = sessKey;
30
46
  this.doken = doken;
31
47
  this.getVouchersFunction = null;
@@ -45,3 +61,4 @@ export default class dVVKDecryptionFlow {
45
61
  return GetKeys(fulfilledResponses, this.orks.map(o => BigInt(o.orkID))); // to be used for symmetric encryption now with caller
46
62
  }
47
63
  }
64
+ //# sourceMappingURL=dVVKDecryptionFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dVVKDecryptionFlow.js","sourceRoot":"","sources":["../../../Flow/DecryptionFlows/dVVKDecryptionFlow.ts"],"names":[],"mappings":"AAAA,GAAG;AACH,gEAAgE;AAChE,yCAAyC;AACzC,GAAG;AACH,gEAAgE;AAChE,4DAA4D;AAC5D,+DAA+D;AAC/D,kEAAkE;AAClE,6DAA6D;AAC7D,gEAAgE;AAChE,oCAAoC;AACpC,6DAA6D;AAC7D,8DAA8D;AAC9D,wCAAwC;AACxC,qDAAqD;AACrD,EAAE;AAEF,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,kBAAkB;IACnC,KAAK,CAAS;IACd,SAAS,CAAM;IACf,IAAI,CAAM;IACV,OAAO,CAAU;IACjB,KAAK,CAAQ;IACb,mBAAmB,CAAgD;IACnE,UAAU,CAAS;IAEnB,YAAY,KAAa,EAAE,SAAc,EAAE,IAAS,EAAE,OAAgB,EAAE,KAAY,EAAE,UAAkB;QACpG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,I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.org/licenses_tcoc2-0-0-en
16
16
  //
17
17
  export { default as dVVKDecryptionFlow } from './dVVKDecryptionFlow';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Flow/DecryptionFlows/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,gEAAgE;AAChE,yCAAyC;AACzC,EAAE;AACF,+DAA+D;AAC/D,2DAA2D;AAC3D,8DAA8D;AAC9D,kEAAkE;AAClE,4DAA4D;AAC5D,+DAA+D;AAC/D,oCAAoC;AACpC,6DAA6D;AAC7D,6DAA6D;AAC7D,wCAAwC;AACxC,qDAAqD;AACrD,EAAE;AAEF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizedEncryptionFlow.d.ts","sourceRoot":"","sources":["../../../Flow/EncryptionFlows/AuthorizedEncryptionFlow.ts"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,KAAA,QA6K9C"}
1
+ {"version":3,"file":"AuthorizedEncryptionFlow.d.ts","sourceRoot":"","sources":["../../../Flow/EncryptionFlows/AuthorizedEncryptionFlow.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,KAAA,QA6L9C"}
@@ -22,6 +22,8 @@ import BaseTideRequest from "../../Models/BaseTideRequest";
22
22
  import dVVKSigningFlow from "../SigningFlows/dVVKSigningFlow";
23
23
  import SerializedField from "../../Models/SerializedField";
24
24
  import dVVKDecryptionFlow from "../DecryptionFlows/dVVKDecryptionFlow";
25
+ import { TideError } from "../../Errors/TideError";
26
+ import { TideJsErrorCodes } from "../../Errors/codes";
25
27
  /**
26
28
  *
27
29
  * @param {{
@@ -39,7 +41,13 @@ export function AuthorizedEncryptionFlow(config) {
39
41
  }
40
42
  var encryptionFlow = this;
41
43
  if (!config.token.payload.sessionKey.Equals(config.sessionKey.get_public_component())) {
42
- throw Error("Mismatch between session key private and Doken session key public");
44
+ const dokenFp = String(config.token.payload.sessionKey.Serialize().ToString()).slice(0, 8);
45
+ const suppliedFp = String(config.sessionKey.get_public_component().Serialize().ToString()).slice(0, 8);
46
+ throw new TideError({
47
+ code: TideJsErrorCodes.CRYPTO_SESSION_KEY_MISMATCH,
48
+ displayMessage: `Doken session key (${dokenFp}) does not match supplied session key (${suppliedFp})`,
49
+ source: "Flow/EncryptionFlows/AuthorizedEncryptionFlow.ts:48",
50
+ });
43
51
  }
44
52
  encryptionFlow.vvkId = config.vendorId;
45
53
  encryptionFlow.token = config.token;
@@ -127,7 +135,17 @@ export function AuthorizedEncryptionFlow(config) {
127
135
  const deserializedDatas = datasToDecrypt.map(d => {
128
136
  const b = SerializedField.deserialize(d.encrypted);
129
137
  if (b.signature == null)
130
- throw Error("Signature must be provided in Tide Serialized Data to an Authorized Decryption");
138
+ throw new TideError({
139
+ code: TideJsErrorCodes.VAL_INPUT_SHAPE,
140
+ displayMessage: "The data you are trying to decrypt is missing its authorization signature and cannot be decrypted. Please refresh and try again, or contact support if the problem persists.",
141
+ source: "Flow/EncryptionFlows/AuthorizedEncryptionFlow.ts:163",
142
+ details: [
143
+ {
144
+ displayMessage: "SerializedField.deserialize returned a record with no `signature` field",
145
+ code: `encryptedSize=${d.encrypted?.byteLength ?? "<unknown>"} tags=${JSON.stringify(d.tags)}`,
146
+ },
147
+ ],
148
+ });
131
149
  const tags_b = d.tags.map(t => StringToUint8Array(t));
132
150
  return {
133
151
  ...b,
@@ -181,3 +199,4 @@ export function AuthorizedEncryptionFlow(config) {
181
199
  return decryptedDatas;
182
200
  };
183
201
  }
202
+ //# sourceMappingURL=AuthorizedEncryptionFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizedEncryptionFlow.js","sourceRoot":"","sources":["../../../Flow/EncryptionFlows/AuthorizedEncryptionFlow.ts"],"names":[],"mapp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