@boxyhq/saml-jackson 1.33.1-beta.1 → 1.34.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 (278) hide show
  1. package/dist/typings.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/dist/controller/oauth/oidc-issuer.d.ts +0 -2
  4. package/dist/controller/oauth/oidc-issuer.js +0 -25
  5. package/dist/controller/oauth/oidc-issuer.js.map +0 -1
  6. package/dist/src/controller/admin.d.ts +0 -27
  7. package/dist/src/controller/admin.js +0 -60
  8. package/dist/src/controller/admin.js.map +0 -1
  9. package/dist/src/controller/analytics.d.ts +0 -16
  10. package/dist/src/controller/analytics.js +0 -79
  11. package/dist/src/controller/analytics.js.map +0 -1
  12. package/dist/src/controller/api.d.ts +0 -557
  13. package/dist/src/controller/api.js +0 -806
  14. package/dist/src/controller/api.js.map +0 -1
  15. package/dist/src/controller/connection/oidc.d.ts +0 -7
  16. package/dist/src/controller/connection/oidc.js +0 -181
  17. package/dist/src/controller/connection/oidc.js.map +0 -1
  18. package/dist/src/controller/connection/saml.d.ts +0 -7
  19. package/dist/src/controller/connection/saml.js +0 -250
  20. package/dist/src/controller/connection/saml.js.map +0 -1
  21. package/dist/src/controller/error.d.ts +0 -10
  22. package/dist/src/controller/error.js +0 -13
  23. package/dist/src/controller/error.js.map +0 -1
  24. package/dist/src/controller/health-check.d.ts +0 -11
  25. package/dist/src/controller/health-check.js +0 -51
  26. package/dist/src/controller/health-check.js.map +0 -1
  27. package/dist/src/controller/logout.d.ts +0 -18
  28. package/dist/src/controller/logout.js +0 -132
  29. package/dist/src/controller/logout.js.map +0 -1
  30. package/dist/src/controller/oauth/allowed.d.ts +0 -1
  31. package/dist/src/controller/oauth/allowed.js +0 -30
  32. package/dist/src/controller/oauth/allowed.js.map +0 -1
  33. package/dist/src/controller/oauth/code-verifier.d.ts +0 -1
  34. package/dist/src/controller/oauth/code-verifier.js +0 -8
  35. package/dist/src/controller/oauth/code-verifier.js.map +0 -1
  36. package/dist/src/controller/oauth/oidc-client.d.ts +0 -12
  37. package/dist/src/controller/oauth/oidc-client.js +0 -89
  38. package/dist/src/controller/oauth/oidc-client.js.map +0 -1
  39. package/dist/src/controller/oauth/redirect.d.ts +0 -1
  40. package/dist/src/controller/oauth/redirect.js +0 -13
  41. package/dist/src/controller/oauth/redirect.js.map +0 -1
  42. package/dist/src/controller/oauth.d.ts +0 -142
  43. package/dist/src/controller/oauth.js +0 -1112
  44. package/dist/src/controller/oauth.js.map +0 -1
  45. package/dist/src/controller/oidc-discovery.d.ts +0 -22
  46. package/dist/src/controller/oidc-discovery.js +0 -47
  47. package/dist/src/controller/oidc-discovery.js.map +0 -1
  48. package/dist/src/controller/setup-link.d.ts +0 -307
  49. package/dist/src/controller/setup-link.js +0 -462
  50. package/dist/src/controller/setup-link.js.map +0 -1
  51. package/dist/src/controller/sp-config.d.ts +0 -22
  52. package/dist/src/controller/sp-config.js +0 -89
  53. package/dist/src/controller/sp-config.js.map +0 -1
  54. package/dist/src/controller/sso-handler.d.ts +0 -66
  55. package/dist/src/controller/sso-handler.js +0 -306
  56. package/dist/src/controller/sso-handler.js.map +0 -1
  57. package/dist/src/controller/utils.d.ts +0 -84
  58. package/dist/src/controller/utils.js +0 -328
  59. package/dist/src/controller/utils.js.map +0 -1
  60. package/dist/src/cron/lock.d.ts +0 -18
  61. package/dist/src/cron/lock.js +0 -98
  62. package/dist/src/cron/lock.js.map +0 -1
  63. package/dist/src/db/db.d.ts +0 -5
  64. package/dist/src/db/db.js +0 -178
  65. package/dist/src/db/db.js.map +0 -1
  66. package/dist/src/db/defaultDb.d.ts +0 -2
  67. package/dist/src/db/defaultDb.js +0 -18
  68. package/dist/src/db/defaultDb.js.map +0 -1
  69. package/dist/src/db/dynamoDb.d.ts +0 -19
  70. package/dist/src/db/dynamoDb.js +0 -320
  71. package/dist/src/db/dynamoDb.js.map +0 -1
  72. package/dist/src/db/encrypter.d.ts +0 -3
  73. package/dist/src/db/encrypter.js +0 -22
  74. package/dist/src/db/encrypter.js.map +0 -1
  75. package/dist/src/db/mem.d.ts +0 -23
  76. package/dist/src/db/mem.js +0 -186
  77. package/dist/src/db/mem.js.map +0 -1
  78. package/dist/src/db/mongo.d.ts +0 -22
  79. package/dist/src/db/mongo.js +0 -177
  80. package/dist/src/db/mongo.js.map +0 -1
  81. package/dist/src/db/planetscale/entity/JacksonIndex.d.ts +0 -5
  82. package/dist/src/db/planetscale/entity/JacksonIndex.js +0 -32
  83. package/dist/src/db/planetscale/entity/JacksonIndex.js.map +0 -1
  84. package/dist/src/db/planetscale/entity/JacksonStore.d.ts +0 -9
  85. package/dist/src/db/planetscale/entity/JacksonStore.js +0 -63
  86. package/dist/src/db/planetscale/entity/JacksonStore.js.map +0 -1
  87. package/dist/src/db/planetscale/entity/JacksonTTL.d.ts +0 -4
  88. package/dist/src/db/planetscale/entity/JacksonTTL.js +0 -27
  89. package/dist/src/db/planetscale/entity/JacksonTTL.js.map +0 -1
  90. package/dist/src/db/redis.d.ts +0 -18
  91. package/dist/src/db/redis.js +0 -214
  92. package/dist/src/db/redis.js.map +0 -1
  93. package/dist/src/db/sql/entity/JacksonIndex.d.ts +0 -7
  94. package/dist/src/db/sql/entity/JacksonIndex.js +0 -39
  95. package/dist/src/db/sql/entity/JacksonIndex.js.map +0 -1
  96. package/dist/src/db/sql/entity/JacksonStore.d.ts +0 -9
  97. package/dist/src/db/sql/entity/JacksonStore.js +0 -61
  98. package/dist/src/db/sql/entity/JacksonStore.js.map +0 -1
  99. package/dist/src/db/sql/entity/JacksonTTL.d.ts +0 -4
  100. package/dist/src/db/sql/entity/JacksonTTL.js +0 -27
  101. package/dist/src/db/sql/entity/JacksonTTL.js.map +0 -1
  102. package/dist/src/db/sql/mariadb/entity/JacksonIndex.d.ts +0 -7
  103. package/dist/src/db/sql/mariadb/entity/JacksonIndex.js +0 -39
  104. package/dist/src/db/sql/mariadb/entity/JacksonIndex.js.map +0 -1
  105. package/dist/src/db/sql/mariadb/entity/JacksonStore.d.ts +0 -9
  106. package/dist/src/db/sql/mariadb/entity/JacksonStore.js +0 -63
  107. package/dist/src/db/sql/mariadb/entity/JacksonStore.js.map +0 -1
  108. package/dist/src/db/sql/mariadb/entity/JacksonTTL.d.ts +0 -4
  109. package/dist/src/db/sql/mariadb/entity/JacksonTTL.js +0 -27
  110. package/dist/src/db/sql/mariadb/entity/JacksonTTL.js.map +0 -1
  111. package/dist/src/db/sql/mssql/entity/JacksonIndex.d.ts +0 -7
  112. package/dist/src/db/sql/mssql/entity/JacksonIndex.js +0 -39
  113. package/dist/src/db/sql/mssql/entity/JacksonIndex.js.map +0 -1
  114. package/dist/src/db/sql/mssql/entity/JacksonStore.d.ts +0 -9
  115. package/dist/src/db/sql/mssql/entity/JacksonStore.js +0 -61
  116. package/dist/src/db/sql/mssql/entity/JacksonStore.js.map +0 -1
  117. package/dist/src/db/sql/mssql/entity/JacksonTTL.d.ts +0 -4
  118. package/dist/src/db/sql/mssql/entity/JacksonTTL.js +0 -27
  119. package/dist/src/db/sql/mssql/entity/JacksonTTL.js.map +0 -1
  120. package/dist/src/db/sql/mssql.d.ts +0 -1
  121. package/dist/src/db/sql/mssql.js +0 -44
  122. package/dist/src/db/sql/mssql.js.map +0 -1
  123. package/dist/src/db/sql/sql.d.ts +0 -32
  124. package/dist/src/db/sql/sql.js +0 -318
  125. package/dist/src/db/sql/sql.js.map +0 -1
  126. package/dist/src/db/sql/sqlite/entity/JacksonIndex.d.ts +0 -7
  127. package/dist/src/db/sql/sqlite/entity/JacksonIndex.js +0 -39
  128. package/dist/src/db/sql/sqlite/entity/JacksonIndex.js.map +0 -1
  129. package/dist/src/db/sql/sqlite/entity/JacksonStore.d.ts +0 -9
  130. package/dist/src/db/sql/sqlite/entity/JacksonStore.js +0 -61
  131. package/dist/src/db/sql/sqlite/entity/JacksonStore.js.map +0 -1
  132. package/dist/src/db/sql/sqlite/entity/JacksonTTL.d.ts +0 -4
  133. package/dist/src/db/sql/sqlite/entity/JacksonTTL.js +0 -27
  134. package/dist/src/db/sql/sqlite/entity/JacksonTTL.js.map +0 -1
  135. package/dist/src/db/store.d.ts +0 -5
  136. package/dist/src/db/store.js +0 -65
  137. package/dist/src/db/store.js.map +0 -1
  138. package/dist/src/db/utils.d.ts +0 -16
  139. package/dist/src/db/utils.js +0 -28
  140. package/dist/src/db/utils.js.map +0 -1
  141. package/dist/src/directory-sync/batch-events/queue.d.ts +0 -40
  142. package/dist/src/directory-sync/batch-events/queue.js +0 -225
  143. package/dist/src/directory-sync/batch-events/queue.js.map +0 -1
  144. package/dist/src/directory-sync/index.d.ts +0 -27
  145. package/dist/src/directory-sync/index.js +0 -97
  146. package/dist/src/directory-sync/index.js.map +0 -1
  147. package/dist/src/directory-sync/non-scim/google/api.d.ts +0 -36
  148. package/dist/src/directory-sync/non-scim/google/api.js +0 -143
  149. package/dist/src/directory-sync/non-scim/google/api.js.map +0 -1
  150. package/dist/src/directory-sync/non-scim/google/index.d.ts +0 -12
  151. package/dist/src/directory-sync/non-scim/google/index.js +0 -10
  152. package/dist/src/directory-sync/non-scim/google/index.js.map +0 -1
  153. package/dist/src/directory-sync/non-scim/google/oauth.d.ts +0 -27
  154. package/dist/src/directory-sync/non-scim/google/oauth.js +0 -105
  155. package/dist/src/directory-sync/non-scim/google/oauth.js.map +0 -1
  156. package/dist/src/directory-sync/non-scim/index.d.ts +0 -24
  157. package/dist/src/directory-sync/non-scim/index.js +0 -85
  158. package/dist/src/directory-sync/non-scim/index.js.map +0 -1
  159. package/dist/src/directory-sync/non-scim/syncGroupMembers.d.ts +0 -23
  160. package/dist/src/directory-sync/non-scim/syncGroupMembers.js +0 -105
  161. package/dist/src/directory-sync/non-scim/syncGroupMembers.js.map +0 -1
  162. package/dist/src/directory-sync/non-scim/syncGroups.d.ts +0 -24
  163. package/dist/src/directory-sync/non-scim/syncGroups.js +0 -120
  164. package/dist/src/directory-sync/non-scim/syncGroups.js.map +0 -1
  165. package/dist/src/directory-sync/non-scim/syncUsers.d.ts +0 -24
  166. package/dist/src/directory-sync/non-scim/syncUsers.js +0 -120
  167. package/dist/src/directory-sync/non-scim/syncUsers.js.map +0 -1
  168. package/dist/src/directory-sync/non-scim/utils.d.ts +0 -36
  169. package/dist/src/directory-sync/non-scim/utils.js +0 -109
  170. package/dist/src/directory-sync/non-scim/utils.js.map +0 -1
  171. package/dist/src/directory-sync/request.d.ts +0 -14
  172. package/dist/src/directory-sync/request.js +0 -29
  173. package/dist/src/directory-sync/request.js.map +0 -1
  174. package/dist/src/directory-sync/scim/Base.d.ts +0 -12
  175. package/dist/src/directory-sync/scim/Base.js +0 -23
  176. package/dist/src/directory-sync/scim/Base.js.map +0 -1
  177. package/dist/src/directory-sync/scim/DirectoryConfig.d.ts +0 -343
  178. package/dist/src/directory-sync/scim/DirectoryConfig.js +0 -580
  179. package/dist/src/directory-sync/scim/DirectoryConfig.js.map +0 -1
  180. package/dist/src/directory-sync/scim/DirectoryGroups.d.ts +0 -28
  181. package/dist/src/directory-sync/scim/DirectoryGroups.js +0 -252
  182. package/dist/src/directory-sync/scim/DirectoryGroups.js.map +0 -1
  183. package/dist/src/directory-sync/scim/DirectoryUsers.d.ts +0 -25
  184. package/dist/src/directory-sync/scim/DirectoryUsers.js +0 -193
  185. package/dist/src/directory-sync/scim/DirectoryUsers.js.map +0 -1
  186. package/dist/src/directory-sync/scim/Groups.d.ts +0 -166
  187. package/dist/src/directory-sync/scim/Groups.js +0 -348
  188. package/dist/src/directory-sync/scim/Groups.js.map +0 -1
  189. package/dist/src/directory-sync/scim/Users.d.ts +0 -99
  190. package/dist/src/directory-sync/scim/Users.js +0 -215
  191. package/dist/src/directory-sync/scim/Users.js.map +0 -1
  192. package/dist/src/directory-sync/scim/WebhookEventsLogger.d.ts +0 -101
  193. package/dist/src/directory-sync/scim/WebhookEventsLogger.js +0 -165
  194. package/dist/src/directory-sync/scim/WebhookEventsLogger.js.map +0 -1
  195. package/dist/src/directory-sync/scim/transform.d.ts +0 -6
  196. package/dist/src/directory-sync/scim/transform.js +0 -37
  197. package/dist/src/directory-sync/scim/transform.js.map +0 -1
  198. package/dist/src/directory-sync/scim/utils.d.ts +0 -33
  199. package/dist/src/directory-sync/scim/utils.js +0 -129
  200. package/dist/src/directory-sync/scim/utils.js.map +0 -1
  201. package/dist/src/directory-sync/types.d.ts +0 -195
  202. package/dist/src/directory-sync/types.js +0 -10
  203. package/dist/src/directory-sync/types.js.map +0 -1
  204. package/dist/src/directory-sync/utils.d.ts +0 -19
  205. package/dist/src/directory-sync/utils.js +0 -56
  206. package/dist/src/directory-sync/utils.js.map +0 -1
  207. package/dist/src/ee/branding/index.d.ts +0 -17
  208. package/dist/src/ee/branding/index.js +0 -49
  209. package/dist/src/ee/branding/index.js.map +0 -1
  210. package/dist/src/ee/common/checkLicense.d.ts +0 -3
  211. package/dist/src/ee/common/checkLicense.js +0 -23
  212. package/dist/src/ee/common/checkLicense.js.map +0 -1
  213. package/dist/src/ee/identity-federation/app.d.ts +0 -328
  214. package/dist/src/ee/identity-federation/app.js +0 -532
  215. package/dist/src/ee/identity-federation/app.js.map +0 -1
  216. package/dist/src/ee/identity-federation/idp-login.d.ts +0 -18
  217. package/dist/src/ee/identity-federation/idp-login.js +0 -98
  218. package/dist/src/ee/identity-federation/idp-login.js.map +0 -1
  219. package/dist/src/ee/identity-federation/index.d.ts +0 -15
  220. package/dist/src/ee/identity-federation/index.js +0 -43
  221. package/dist/src/ee/identity-federation/index.js.map +0 -1
  222. package/dist/src/ee/identity-federation/sso.d.ts +0 -24
  223. package/dist/src/ee/identity-federation/sso.js +0 -124
  224. package/dist/src/ee/identity-federation/sso.js.map +0 -1
  225. package/dist/src/ee/identity-federation/types.d.ts +0 -38
  226. package/dist/src/ee/identity-federation/types.js +0 -2
  227. package/dist/src/ee/identity-federation/types.js.map +0 -1
  228. package/dist/src/ee/ory/ory.d.ts +0 -18
  229. package/dist/src/ee/ory/ory.js +0 -195
  230. package/dist/src/ee/ory/ory.js.map +0 -1
  231. package/dist/src/ee/product/index.d.ts +0 -14
  232. package/dist/src/ee/product/index.js +0 -45
  233. package/dist/src/ee/product/index.js.map +0 -1
  234. package/dist/src/event/axios.d.ts +0 -2
  235. package/dist/src/event/axios.js +0 -27
  236. package/dist/src/event/axios.js.map +0 -1
  237. package/dist/src/event/index.d.ts +0 -11
  238. package/dist/src/event/index.js +0 -53
  239. package/dist/src/event/index.js.map +0 -1
  240. package/dist/src/event/types.d.ts +0 -21
  241. package/dist/src/event/types.js +0 -2
  242. package/dist/src/event/types.js.map +0 -1
  243. package/dist/src/event/utils.d.ts +0 -4
  244. package/dist/src/event/utils.js +0 -33
  245. package/dist/src/event/utils.js.map +0 -1
  246. package/dist/src/event/webhook.d.ts +0 -3
  247. package/dist/src/event/webhook.js +0 -34
  248. package/dist/src/event/webhook.js.map +0 -1
  249. package/dist/src/index.d.ts +0 -35
  250. package/dist/src/index.js +0 -161
  251. package/dist/src/index.js.map +0 -1
  252. package/dist/src/loadConnection.d.ts +0 -4
  253. package/dist/src/loadConnection.js +0 -38
  254. package/dist/src/loadConnection.js.map +0 -1
  255. package/dist/src/opentelemetry/metrics.d.ts +0 -14
  256. package/dist/src/opentelemetry/metrics.js +0 -64
  257. package/dist/src/opentelemetry/metrics.js.map +0 -1
  258. package/dist/src/saml/claims.d.ts +0 -12
  259. package/dist/src/saml/claims.js +0 -57
  260. package/dist/src/saml/claims.js.map +0 -1
  261. package/dist/src/saml/lib.d.ts +0 -8
  262. package/dist/src/saml/lib.js +0 -29
  263. package/dist/src/saml/lib.js.map +0 -1
  264. package/dist/src/saml/x509.d.ts +0 -9
  265. package/dist/src/saml/x509.js +0 -93
  266. package/dist/src/saml/x509.js.map +0 -1
  267. package/dist/src/sso-traces/index.d.ts +0 -114
  268. package/dist/src/sso-traces/index.js +0 -229
  269. package/dist/src/sso-traces/index.js.map +0 -1
  270. package/dist/src/sso-traces/types.d.ts +0 -44
  271. package/dist/src/sso-traces/types.js +0 -2
  272. package/dist/src/sso-traces/types.js.map +0 -1
  273. package/dist/src/typings.d.ts +0 -540
  274. package/dist/src/typings.js +0 -5
  275. package/dist/src/typings.js.map +0 -1
  276. package/dist/typeorm.d.ts +0 -3
  277. package/dist/typeorm.js +0 -58
  278. package/dist/typeorm.js.map +0 -1
@@ -1,43 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { SSO } from './sso';
11
- import { App } from './app';
12
- import { SSOHandler } from '../../controller/sso-handler';
13
- import { IdPLogin } from './idp-login';
14
- // This is the main entry point for the Identity Federation module
15
- const IdentityFederation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ db, opts, ssoTraces, }) {
16
- const appStore = db.store('samlfed:apps');
17
- const sessionStore = db.store('oauth:session', opts.db.ttl);
18
- const connectionStore = db.store('saml:config');
19
- const ssoHandler = new SSOHandler({
20
- connection: connectionStore,
21
- session: sessionStore,
22
- opts,
23
- });
24
- const app = new App({ store: appStore, opts });
25
- const sso = new SSO({ app, ssoHandler, ssoTraces, opts });
26
- const idpLogin = new IdPLogin({ app, ssoHandler, ssoTraces, opts });
27
- const response = {
28
- app,
29
- sso,
30
- idpLogin,
31
- };
32
- return response;
33
- });
34
- export default IdentityFederation;
35
- export * from './types';
36
- // SAML Federation flow:
37
- // SP (Eg: Twilio Flex) --> SAML Jackson --> IdP (Eg: Okta) --> SAML Jackson --> SP (Eg: Twilio Flex)
38
- // 1. SP send SAML Request to Jackson's SSO endpoint
39
- // 2. Jackson process SAML Request and create a new session to store SP request information
40
- // 3. Jackson create a new SAML Request and send it to chosen IdP
41
- // 4. After successful authentication, IdP send (POST) SAML Response to Jackson's ACS endpoint
42
- // 5. Jackson process SAML Response from the IdP and create a new SAML Response to send (POST) back to the SP's ACS endpoint
43
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ee/identity-federation/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,kEAAkE;AAClE,MAAM,kBAAkB,GAAG,KAQxB,EAAE,4CAR6B,EAChC,EAAE,EACF,IAAI,EACJ,SAAS,GAKV;IACC,MAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAEhD,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;QAChC,UAAU,EAAE,eAAe;QAC3B,OAAO,EAAE,YAAY;QACrB,IAAI;KACL,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpE,MAAM,QAAQ,GAAG;QACf,GAAG;QACH,GAAG;QACH,QAAQ;KACT,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,eAAe,kBAAkB,CAAC;AAElC,cAAc,SAAS,CAAC;AAExB,wBAAwB;AACxB,qGAAqG;AACrG,oDAAoD;AACpD,2FAA2F;AAC3F,iEAAiE;AACjE,8FAA8F;AAC9F,4HAA4H"}
@@ -1,24 +0,0 @@
1
- import { App } from './app';
2
- import { SSOHandler } from '../../controller/sso-handler';
3
- import type { JacksonOption, SSOTracesInstance } from '../../typings';
4
- export declare class SSO {
5
- private app;
6
- private ssoHandler;
7
- private ssoTraces;
8
- private opts;
9
- constructor({ app, ssoHandler, ssoTraces, opts, }: {
10
- app: App;
11
- ssoHandler: SSOHandler;
12
- ssoTraces: SSOTracesInstance;
13
- opts: JacksonOption;
14
- });
15
- getAuthorizeUrl: ({ request, relayState, idp_hint, samlBinding, }: {
16
- request: string;
17
- relayState: string;
18
- samlBinding: "HTTP-POST" | "HTTP-Redirect";
19
- idp_hint?: string;
20
- }) => Promise<{
21
- redirect_url: any;
22
- authorize_form: any;
23
- }>;
24
- }
@@ -1,124 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import saml from '@boxyhq/saml20';
11
- import { JacksonError } from '../../controller/error';
12
- import { getErrorMessage, isConnectionActive } from '../../controller/utils';
13
- import { throwIfInvalidLicense } from '../common/checkLicense';
14
- const isSAMLConnection = (connection) => {
15
- return 'idpMetadata' in connection;
16
- };
17
- export class SSO {
18
- constructor({ app, ssoHandler, ssoTraces, opts, }) {
19
- // Accept the SAML Request from Service Provider, and create a new SAML Request to be sent to Identity Provider
20
- this.getAuthorizeUrl = (_a) => __awaiter(this, [_a], void 0, function* ({ request, relayState, idp_hint, samlBinding, }) {
21
- yield throwIfInvalidLicense(this.opts.boxyhqLicenseKey);
22
- const isPostBinding = samlBinding === 'HTTP-POST';
23
- let connection;
24
- let app;
25
- let id, acsUrl, entityId, publicKey, providerName, decodedRequest;
26
- const context = {
27
- isSAMLFederated: true,
28
- relayState,
29
- };
30
- try {
31
- decodedRequest = yield saml.decodeBase64(request, !isPostBinding);
32
- context.samlRequest = decodedRequest || request;
33
- const parsedSAMLRequest = yield saml.parseSAMLRequest(decodedRequest, isPostBinding);
34
- id = parsedSAMLRequest.id;
35
- entityId = parsedSAMLRequest.audience;
36
- publicKey = parsedSAMLRequest.publicKey;
37
- providerName = parsedSAMLRequest.providerName;
38
- context.entityId = entityId;
39
- context.providerName = providerName;
40
- // Verify the request if it is signed
41
- if (publicKey && !saml.hasValidSignature(decodedRequest, publicKey, null)) {
42
- throw new JacksonError('Invalid SAML Request signature.', 400);
43
- }
44
- app = yield this.app.getByEntityId(entityId);
45
- acsUrl = parsedSAMLRequest.acsUrl || app.acsUrl; // acsUrl is optional in the SAMLRequest
46
- context.tenant = app.tenant;
47
- context.product = app.product;
48
- context.acsUrl = acsUrl;
49
- if (app.acsUrl !== acsUrl) {
50
- throw new JacksonError("Assertion Consumer Service URL doesn't match.", 400);
51
- }
52
- const response = yield this.ssoHandler.resolveConnection({
53
- tenant: app.tenant,
54
- product: app.product,
55
- idp_hint,
56
- authFlow: 'saml',
57
- idFedAppId: app.id,
58
- originalParams: {
59
- RelayState: relayState,
60
- SAMLRequest: request,
61
- samlBinding,
62
- },
63
- tenants: app.tenants,
64
- });
65
- // If there is a redirect URL, then we need to redirect to that URL
66
- if ('redirectUrl' in response) {
67
- return {
68
- redirect_url: response.redirectUrl,
69
- authorize_form: null,
70
- };
71
- }
72
- // If there is a connection, use that connection
73
- if ('connection' in response) {
74
- connection = response.connection;
75
- }
76
- if (!connection) {
77
- throw new JacksonError('No SSO connection found.', 404);
78
- }
79
- context.clientID = connection.clientID;
80
- if (!isConnectionActive(connection)) {
81
- throw new JacksonError('SSO connection is deactivated. Please contact your administrator.', 403);
82
- }
83
- const requestParams = {
84
- id,
85
- acsUrl,
86
- entityId,
87
- publicKey,
88
- providerName,
89
- relayState,
90
- tenant: app.tenant,
91
- product: app.product,
92
- };
93
- return isSAMLConnection(connection)
94
- ? yield this.ssoHandler.createSAMLRequest({
95
- connection,
96
- requestParams,
97
- mappings: app.mappings,
98
- })
99
- : yield this.ssoHandler.createOIDCRequest({
100
- connection,
101
- requestParams,
102
- mappings: app.mappings,
103
- ssoTraces: {
104
- instance: this.ssoTraces,
105
- context,
106
- },
107
- });
108
- }
109
- catch (err) {
110
- const error_description = getErrorMessage(err);
111
- this.ssoTraces.saveTrace({
112
- error: error_description,
113
- context,
114
- });
115
- throw err;
116
- }
117
- });
118
- this.app = app;
119
- this.ssoHandler = ssoHandler;
120
- this.ssoTraces = ssoTraces;
121
- this.opts = opts;
122
- }
123
- }
124
- //# sourceMappingURL=sso.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sso.js","sourceRoot":"","sources":["../../../../src/ee/identity-federation/sso.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAGlC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAUtD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,gBAAgB,GAAG,CAAC,UAAyC,EAA+B,EAAE;IAClG,OAAO,aAAa,IAAI,UAAU,CAAC;AACrC,CAAC,CAAC;AAEF,MAA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@@ -1,38 +0,0 @@
1
- import IdentityFederation from '.';
2
- export type IIdentityFederationController = Awaited<ReturnType<typeof IdentityFederation>>;
3
- export type AttributeMapping = {
4
- key: string;
5
- value: string;
6
- };
7
- export type IdentityFederationApp = {
8
- id: string;
9
- type?: string;
10
- clientID?: string;
11
- clientSecret?: string;
12
- redirectUrl?: string[] | string;
13
- name: string;
14
- tenant: string;
15
- product: string;
16
- acsUrl: string;
17
- entityId: string;
18
- logoUrl: string | null;
19
- faviconUrl: string | null;
20
- primaryColor: string | null;
21
- tenants?: string[];
22
- mappings?: AttributeMapping[] | null;
23
- };
24
- export type IdentityFederationAppWithMetadata = IdentityFederationApp & {
25
- metadata: {
26
- entityId: string;
27
- ssoUrl: string;
28
- x509cert: string;
29
- xml: string;
30
- };
31
- };
32
- export type AppRequestParams = {
33
- id: string;
34
- } | {
35
- tenant: string;
36
- product: string;
37
- type?: string;
38
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ee/identity-federation/types.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- import { JacksonOption, OryConfig, OryRes } from '../../typings';
2
- import { ProductController } from '../product';
3
- export declare class OryController {
4
- private opts;
5
- private productController;
6
- constructor({ opts, productController }: {
7
- opts: JacksonOption;
8
- productController: ProductController;
9
- });
10
- private getOrgName;
11
- private getIssuerUrl;
12
- private addOrUpdateConnection;
13
- private createOrganization;
14
- private sanitizeConfig;
15
- createConnection(config: OryConfig, tenant: string, product: string): Promise<OryRes | null>;
16
- updateConnection(config: OryConfig, tenant: string, product: string): Promise<OryRes | null>;
17
- private isEnabled;
18
- }
@@ -1,195 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import axios from 'axios';
11
- import { throwIfInvalidLicense } from '../common/checkLicense';
12
- const basePath = 'https://api.console.ory.sh';
13
- const providerId = 'sso_boxyhq';
14
- const dataMapping = 'base64://bG9jYWwgY2xhaW1zID0gewogIGVtYWlsX3ZlcmlmaWVkOiB0cnVlLAp9ICsgc3RkLmV4dFZhcignY2xhaW1zJyk7Cgp7CiAgaWRlbnRpdHk6IHsKICAgIHRyYWl0czogewogICAgICBbaWYgJ2VtYWlsJyBpbiBjbGFpbXMgJiYgY2xhaW1zLmVtYWlsX3ZlcmlmaWVkIHRoZW4gJ2VtYWlsJyBlbHNlIG51bGxdOiBjbGFpbXMuZW1haWwsCiAgICB9LAogIH0sCn0=';
15
- const issuerUrl = 'https://sso.eu.boxyhq.com';
16
- export class OryController {
17
- constructor({ opts, productController }) {
18
- this.opts = opts;
19
- this.productController = productController;
20
- }
21
- getOrgName(tenant, product) {
22
- return this.opts.boxyhqHosted ? tenant : `${tenant}:${product}`;
23
- }
24
- getIssuerUrl() {
25
- if (this.opts.boxyhqHosted) {
26
- return issuerUrl;
27
- }
28
- else {
29
- return this.opts.externalUrl;
30
- }
31
- }
32
- addOrUpdateConnection(config, tenant, product) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const project = yield axios.get(`${basePath}/projects/${config.projectId}`, {
35
- headers: {
36
- Authorization: `Bearer ${config.sdkToken}`,
37
- },
38
- });
39
- let index = '-';
40
- try {
41
- for (const idx in project.data.services.identity.config.selfservice.methods.oidc.config.providers) {
42
- const provider = project.data.services.identity.config.selfservice.methods.oidc.config.providers[idx];
43
- if (provider.id === providerId && provider.organization_id === config.organizationId) {
44
- index = idx;
45
- break;
46
- }
47
- }
48
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
- }
50
- catch (err) {
51
- // empty
52
- }
53
- const op = index === '-' ? 'add' : 'replace';
54
- yield axios.patch(`${basePath}/normalized/projects/${config.projectId}/revision/${project.data.revision_id}`, [
55
- { op: 'replace', path: '/kratos_selfservice_methods_oidc_enabled', value: true },
56
- {
57
- op,
58
- path: `/kratos_selfservice_methods_oidc_config_providers/${index}`,
59
- value: {
60
- provider_id: providerId,
61
- provider: 'generic',
62
- label: 'SSO',
63
- client_id: `tenant=${tenant}&product=${product}`,
64
- client_secret: this.opts.clientSecretVerifier,
65
- organization_id: config.organizationId,
66
- scope: [],
67
- mapper_url: dataMapping,
68
- additional_id_token_audiences: [],
69
- issuer_url: this.getIssuerUrl(),
70
- },
71
- },
72
- ], {
73
- headers: {
74
- Authorization: `Bearer ${config.sdkToken}`,
75
- },
76
- });
77
- });
78
- }
79
- createOrganization(config, label) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- var _a;
82
- if (!config.sdkToken || !config.projectId) {
83
- throw new Error('Ory SDK Token or Project ID not set');
84
- }
85
- if (config && config.organizationId) {
86
- try {
87
- const res = yield axios.get(`${basePath}/projects/${config.projectId}/organizations/${config.organizationId}`, {
88
- headers: {
89
- Authorization: `Bearer ${config.sdkToken}`,
90
- },
91
- });
92
- return res.data.organization.id;
93
- }
94
- catch (err) {
95
- // if org doesn't exist fall through to section that creates it below
96
- if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) !== 404) {
97
- throw err;
98
- }
99
- }
100
- }
101
- const res = yield axios.post(`${basePath}/projects/${config.projectId}/organizations`, {
102
- label,
103
- domains: config.domains,
104
- }, {
105
- headers: {
106
- Authorization: `Bearer ${config.sdkToken}`,
107
- },
108
- });
109
- return res.data.id;
110
- });
111
- }
112
- sanitizeConfig(config, tenant) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- var _a, _b;
115
- if (!config.sdkToken) {
116
- config.sdkToken = (_a = this.opts.ory) === null || _a === void 0 ? void 0 : _a.sdkToken;
117
- }
118
- if (!config.projectId) {
119
- config.projectId = (_b = this.opts.ory) === null || _b === void 0 ? void 0 : _b.projectId;
120
- }
121
- config.domains = config.domains || [];
122
- if (!config.domains.includes(tenant)) {
123
- config.domains.push(tenant);
124
- }
125
- return config;
126
- });
127
- }
128
- createConnection(config, tenant, product) {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- if (!(yield this.isEnabled(config, tenant, product))) {
131
- return null;
132
- }
133
- const organizationId = yield this.createOrganization(config, this.getOrgName(tenant, product));
134
- config.organizationId = organizationId;
135
- let error;
136
- try {
137
- yield this.addOrUpdateConnection(config, tenant, product);
138
- }
139
- catch (err) {
140
- error = err;
141
- }
142
- return { projectId: config.projectId, domains: config.domains, organizationId, error };
143
- });
144
- }
145
- updateConnection(config, tenant, product) {
146
- return __awaiter(this, void 0, void 0, function* () {
147
- if (!(yield this.isEnabled(config, tenant, product))) {
148
- return null;
149
- }
150
- const organizationId = yield this.createOrganization(config, this.getOrgName(tenant, product));
151
- let error;
152
- try {
153
- yield this.addOrUpdateConnection(config, tenant, product);
154
- }
155
- catch (err) {
156
- error = err;
157
- }
158
- return { projectId: config.projectId, domains: config.domains, organizationId, error };
159
- });
160
- }
161
- isEnabled(config, tenant, product) {
162
- return __awaiter(this, void 0, void 0, function* () {
163
- var _a, _b;
164
- if (this.opts.boxyhqHosted) {
165
- const productConfig = yield this.productController.get(product);
166
- if (!productConfig ||
167
- !productConfig.ory ||
168
- !productConfig.ory.sdkToken ||
169
- !productConfig.ory.projectId) {
170
- return false;
171
- }
172
- config.sdkToken = productConfig.ory.sdkToken;
173
- config.projectId = productConfig.ory.projectId;
174
- this.sanitizeConfig(config, tenant);
175
- return true;
176
- }
177
- else {
178
- if (!((_a = this.opts.ory) === null || _a === void 0 ? void 0 : _a.sdkToken) || !((_b = this.opts.ory) === null || _b === void 0 ? void 0 : _b.projectId)) {
179
- return false;
180
- }
181
- try {
182
- yield throwIfInvalidLicense(this.opts.boxyhqLicenseKey);
183
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
184
- }
185
- catch (err) {
186
- console.error('Ory is not enabled because of invalid license');
187
- return false;
188
- }
189
- this.sanitizeConfig(config, tenant);
190
- return true;
191
- }
192
- });
193
- }
194
- }
195
- //# sourceMappingURL=ory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ory.js","sourceRoot":"","sources":["../../../../src/ee/ory/ory.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GACf,2RAA2R,CAAC;AAC9R,MAAM,SAAS,GAAG,2BAA2B,CAAC;AAE9C,MAAM,OAAO,aAAa;IAIxB,YAAY,EAAE,IAAI,EAAE,iBAAiB,EAAiE;QACpG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAEO,UAAU,CAAC,MAAc,EAAE,OAAe;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC;IAClE,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QAC/B,CAAC;IACH,CAAC;IAEa,qBAAqB,CAAC,MAAiB,EAAE,MAAc,EAAE,OAAe;;YACpF,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,aAAa,MAAM,CAAC,SAAS,EAAE,EAAE;gBA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3B,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,EAC5B,CAAC;oBACD,OAAO,KAAK,CAAC;gBACf,CAAC;gBAED,MAAM,CAAC,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAC7C,MAAM,CAAC,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC;gBAE/C,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEpC,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,0CAAE,QAAQ,CAAA,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,0CAAE,SAAS,CAAA,EAAE,CAAC;oBAC1D,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,CAAC;oBACH,MAAM,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACxD,6DAA6D;gBAC/D,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;oBAC/D,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF"}
@@ -1,14 +0,0 @@
1
- import type { Storable, JacksonOption, ProductConfig } from '../../typings';
2
- export declare class ProductController {
3
- private productStore;
4
- private opts;
5
- constructor({ productStore, opts }: {
6
- productStore: Storable;
7
- opts: JacksonOption;
8
- });
9
- get(productId: string): Promise<ProductConfig>;
10
- upsert(params: Partial<ProductConfig> & {
11
- id: string;
12
- }): Promise<void>;
13
- delete(productId: string): Promise<void>;
14
- }
@@ -1,45 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { JacksonError } from '../../controller/error';
11
- import { throwIfInvalidLicense } from '../common/checkLicense';
12
- export class ProductController {
13
- constructor({ productStore, opts }) {
14
- this.productStore = productStore;
15
- this.opts = opts;
16
- }
17
- get(productId) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- yield throwIfInvalidLicense(this.opts.boxyhqLicenseKey);
20
- const productConfig = (yield this.productStore.get(productId));
21
- // if (!productConfig) {
22
- // console.error(`Product config not found for ${productId}`);
23
- // }
24
- return Object.assign(Object.assign({}, productConfig), { id: productId, name: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.name) || null, teamId: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.teamId) || null, teamName: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.teamName) || null, logoUrl: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.logoUrl) || null, faviconUrl: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.faviconUrl) || null, companyName: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.companyName) || null, primaryColor: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.primaryColor) || '#25c2a0' });
25
- });
26
- }
27
- upsert(params) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- yield throwIfInvalidLicense(this.opts.boxyhqLicenseKey);
30
- if (!('id' in params)) {
31
- throw new JacksonError('Provide a product id', 400);
32
- }
33
- const productConfig = (yield this.productStore.get(params.id));
34
- const toUpdate = productConfig ? Object.assign(Object.assign({}, productConfig), params) : params;
35
- yield this.productStore.put(params.id, toUpdate);
36
- });
37
- }
38
- delete(productId) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- yield throwIfInvalidLicense(this.opts.boxyhqLicenseKey);
41
- yield this.productStore.delete(productId);
42
- });
43
- }
44
- }
45
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ee/product/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,MAAM,OAAO,iBAAiB;IAI5B,YAAY,EAAE,YAAY,EAAE,IAAI,EAAmD;QACjF,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEY,GAAG,CAAC,SAAiB;;YAChC,MAAM,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAExD,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAkB,CAAC;YAEhF,wBAAwB;YACxB,gEAAgE;YAChE,IAAI;YAEJ,uCACK,aAAa,KAChB,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,KAAI,IAAI,EACjC,MAAM,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,KAAI,IAAI,EACrC,QAAQ,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,KAAI,IAAI,EACzC,OAAO,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,KAAI,IAAI,EACvC,UAAU,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,UAAU,KAAI,IAAI,EAC7C,WAAW,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,KAAI,IAAI,EAC/C,YAAY,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,YAAY,KAAI,SAAS,IACtD;QACJ,CAAC;KAAA;IAEY,MAAM,CAAC,MAA+C;;YACjE,MAAM,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAExD,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC;gBACtB,MAAM,IAAI,YAAY,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;YACtD,CAAC;YAED,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAkB,CAAC;YAEhF,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC,iCAAM,aAAa,GAAK,MAAM,EAAG,CAAC,CAAC,MAAM,CAAC;YAE1E,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACnD,CAAC;KAAA;IAEY,MAAM,CAAC,SAAiB;;YACnC,MAAM,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAExD,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;KAAA;CACF"}
@@ -1,2 +0,0 @@
1
- declare const axiosInstance: any;
2
- export default axiosInstance;
@@ -1,27 +0,0 @@
1
- import axios from 'axios';
2
- const retry = 3;
3
- const retryDelay = 3000;
4
- const axiosInstance = axios.create();
5
- // Axios interceptors to handle the Webhook retries
6
- axiosInstance.interceptors.response.use(undefined, (err) => {
7
- const config = err.config;
8
- if (!config) {
9
- return Promise.reject(err);
10
- }
11
- config.__retryCount = config.__retryCount || 0;
12
- if (config.__retryCount >= retry) {
13
- return Promise.reject(err);
14
- }
15
- config.__retryCount += 1;
16
- const backoff = new Promise(function (resolve) {
17
- setTimeout(function () {
18
- resolve(1);
19
- }, retryDelay);
20
- });
21
- return backoff.then(function () {
22
- console.info(`Retrying sending webhook event to ${config.url}... Attempt ${config.__retryCount}`);
23
- return axiosInstance(config);
24
- });
25
- });
26
- export default axiosInstance;
27
- //# sourceMappingURL=axios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"axios.js","sourceRoot":"","sources":["../../../src/event/axios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,KAAK,GAAG,CAAC,CAAC;AAChB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;AAErC,mDAAmD;AACnD,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAQ,EAAE,EAAE;IAC9D,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAE1B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC;IAE/C,IAAI,MAAM,CAAC,YAAY,IAAI,KAAK,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC;IAEzB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,UAAU,OAAO;QAC3C,UAAU,CAAC;YACT,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,CAAC,EAAE,UAAU,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,IAAI,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,qCAAqC,MAAM,CAAC,GAAG,eAAe,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAClG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { Directory, JacksonOption, SAMLSSORecord, EventType, SSOConnectionEventType, Webhook, EventPayloadSchema, OIDCSSORecord } from '../typings';
2
- export default class Event {
3
- private webhook;
4
- private dsync;
5
- constructor({ opts }: {
6
- opts: JacksonOption;
7
- });
8
- notify<T extends EventType>(event: T, data: T extends SSOConnectionEventType ? SAMLSSORecord | OIDCSSORecord : Directory): Promise<any>;
9
- private constructPayload;
10
- sendWebhookEvent(webhook: Webhook | undefined, payload: EventPayloadSchema): Promise<any>;
11
- }
@@ -1,53 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { sendPayloadToWebhook } from './webhook';
11
- import { transformSAMLSSOConnection, transformDirectoryConnection, transformOIDCSSOConnection, } from './utils';
12
- export default class Event {
13
- constructor({ opts }) {
14
- this.webhook = opts.webhook;
15
- this.dsync = opts.dsync;
16
- }
17
- notify(event, data) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- const payload = this.constructPayload(event, data);
20
- return this.sendWebhookEvent(this.webhook, payload);
21
- });
22
- }
23
- constructPayload(event, data) {
24
- let transformedData;
25
- if ('idpMetadata' in data) {
26
- transformedData = transformSAMLSSOConnection(data);
27
- }
28
- else if ('oidcProvider' in data) {
29
- transformedData = transformOIDCSSOConnection(data);
30
- }
31
- else {
32
- transformedData = transformDirectoryConnection(data);
33
- }
34
- const { tenant, product } = data;
35
- const payload = {
36
- event,
37
- tenant,
38
- product,
39
- data: transformedData,
40
- };
41
- return payload;
42
- }
43
- sendWebhookEvent(webhook, payload) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- var _a;
46
- if (!(webhook === null || webhook === void 0 ? void 0 : webhook.endpoint) || !webhook.secret) {
47
- return;
48
- }
49
- return yield sendPayloadToWebhook(webhook, payload, (_a = this.dsync) === null || _a === void 0 ? void 0 : _a.debugWebhooks);
50
- });
51
- }
52
- }
53
- //# sourceMappingURL=index.js.map