@budibase/backend-core 2.9.16 → 2.9.18

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 (435) hide show
  1. package/dist/index.js +12544 -0
  2. package/dist/index.js.map +7 -0
  3. package/dist/index.js.meta.json +1 -0
  4. package/dist/package.json +5 -5
  5. package/dist/plugins.js +288 -16
  6. package/dist/plugins.js.map +7 -1
  7. package/dist/plugins.js.meta.json +1 -0
  8. package/dist/tests.js +8476 -0
  9. package/dist/tests.js.map +7 -0
  10. package/dist/tests.js.meta.json +1 -0
  11. package/dist/tsconfig.build.tsbuildinfo +1 -1
  12. package/package.json +5 -5
  13. package/scripts/build.js +6 -0
  14. package/tsconfig.build.json +5 -1
  15. package/tsconfig.json +0 -8
  16. package/dist/jest.config.js +0 -25
  17. package/dist/jest.config.js.map +0 -1
  18. package/dist/plugins.d.ts +0 -1
  19. package/dist/src/accounts/accounts.js +0 -83
  20. package/dist/src/accounts/accounts.js.map +0 -1
  21. package/dist/src/accounts/api.js +0 -92
  22. package/dist/src/accounts/api.js.map +0 -1
  23. package/dist/src/accounts/index.js +0 -18
  24. package/dist/src/accounts/index.js.map +0 -1
  25. package/dist/src/auth/auth.js +0 -189
  26. package/dist/src/auth/auth.js.map +0 -1
  27. package/dist/src/auth/index.js +0 -18
  28. package/dist/src/auth/index.js.map +0 -1
  29. package/dist/src/blacklist/blacklist.js +0 -76
  30. package/dist/src/blacklist/blacklist.js.map +0 -1
  31. package/dist/src/blacklist/index.js +0 -18
  32. package/dist/src/blacklist/index.js.map +0 -1
  33. package/dist/src/cache/appMetadata.js +0 -96
  34. package/dist/src/cache/appMetadata.js.map +0 -1
  35. package/dist/src/cache/base/index.js +0 -120
  36. package/dist/src/cache/base/index.js.map +0 -1
  37. package/dist/src/cache/generic.js +0 -31
  38. package/dist/src/cache/generic.js.map +0 -1
  39. package/dist/src/cache/index.js +0 -35
  40. package/dist/src/cache/index.js.map +0 -1
  41. package/dist/src/cache/user.js +0 -108
  42. package/dist/src/cache/user.js.map +0 -1
  43. package/dist/src/cache/writethrough.js +0 -159
  44. package/dist/src/cache/writethrough.js.map +0 -1
  45. package/dist/src/configs/configs.js +0 -278
  46. package/dist/src/configs/configs.js.map +0 -1
  47. package/dist/src/configs/index.js +0 -18
  48. package/dist/src/configs/index.js.map +0 -1
  49. package/dist/src/constants/db.js +0 -67
  50. package/dist/src/constants/db.js.map +0 -1
  51. package/dist/src/constants/index.js +0 -19
  52. package/dist/src/constants/index.js.map +0 -1
  53. package/dist/src/constants/misc.js +0 -54
  54. package/dist/src/constants/misc.js.map +0 -1
  55. package/dist/src/context/Context.js +0 -14
  56. package/dist/src/context/Context.js.map +0 -1
  57. package/dist/src/context/identity.js +0 -72
  58. package/dist/src/context/identity.js.map +0 -1
  59. package/dist/src/context/index.js +0 -34
  60. package/dist/src/context/index.js.map +0 -1
  61. package/dist/src/context/mainContext.js +0 -331
  62. package/dist/src/context/mainContext.js.map +0 -1
  63. package/dist/src/context/types.js +0 -3
  64. package/dist/src/context/types.js.map +0 -1
  65. package/dist/src/db/Replication.js +0 -85
  66. package/dist/src/db/Replication.js.map +0 -1
  67. package/dist/src/db/constants.js +0 -13
  68. package/dist/src/db/constants.js.map +0 -1
  69. package/dist/src/db/couch/DatabaseImpl.js +0 -248
  70. package/dist/src/db/couch/DatabaseImpl.js.map +0 -1
  71. package/dist/src/db/couch/connections.js +0 -88
  72. package/dist/src/db/couch/connections.js.map +0 -1
  73. package/dist/src/db/couch/index.js +0 -27
  74. package/dist/src/db/couch/index.js.map +0 -1
  75. package/dist/src/db/couch/pouchDB.js +0 -108
  76. package/dist/src/db/couch/pouchDB.js.map +0 -1
  77. package/dist/src/db/couch/pouchDump.js +0 -2
  78. package/dist/src/db/couch/pouchDump.js.map +0 -1
  79. package/dist/src/db/couch/utils.js +0 -55
  80. package/dist/src/db/couch/utils.js.map +0 -1
  81. package/dist/src/db/db.js +0 -59
  82. package/dist/src/db/db.js.map +0 -1
  83. package/dist/src/db/errors.js +0 -22
  84. package/dist/src/db/errors.js.map +0 -1
  85. package/dist/src/db/index.js +0 -48
  86. package/dist/src/db/index.js.map +0 -1
  87. package/dist/src/db/lucene.js +0 -650
  88. package/dist/src/db/lucene.js.map +0 -1
  89. package/dist/src/db/searchIndexes/index.js +0 -18
  90. package/dist/src/db/searchIndexes/index.js.map +0 -1
  91. package/dist/src/db/searchIndexes/searchIndexes.js +0 -77
  92. package/dist/src/db/searchIndexes/searchIndexes.js.map +0 -1
  93. package/dist/src/db/utils.js +0 -213
  94. package/dist/src/db/utils.js.map +0 -1
  95. package/dist/src/db/views.js +0 -219
  96. package/dist/src/db/views.js.map +0 -1
  97. package/dist/src/docIds/conversions.js +0 -62
  98. package/dist/src/docIds/conversions.js.map +0 -1
  99. package/dist/src/docIds/ids.js +0 -112
  100. package/dist/src/docIds/ids.js.map +0 -1
  101. package/dist/src/docIds/index.js +0 -19
  102. package/dist/src/docIds/index.js.map +0 -1
  103. package/dist/src/docIds/newid.js +0 -9
  104. package/dist/src/docIds/newid.js.map +0 -1
  105. package/dist/src/docIds/params.js +0 -138
  106. package/dist/src/docIds/params.js.map +0 -1
  107. package/dist/src/docUpdates/index.js +0 -36
  108. package/dist/src/docUpdates/index.js.map +0 -1
  109. package/dist/src/environment.js +0 -110
  110. package/dist/src/environment.js.map +0 -1
  111. package/dist/src/errors/errors.js +0 -97
  112. package/dist/src/errors/errors.js.map +0 -1
  113. package/dist/src/errors/index.js +0 -18
  114. package/dist/src/errors/index.js.map +0 -1
  115. package/dist/src/events/analytics.js +0 -42
  116. package/dist/src/events/analytics.js.map +0 -1
  117. package/dist/src/events/asyncEvents/index.js +0 -19
  118. package/dist/src/events/asyncEvents/index.js.map +0 -1
  119. package/dist/src/events/asyncEvents/publisher.js +0 -27
  120. package/dist/src/events/asyncEvents/publisher.js.map +0 -1
  121. package/dist/src/events/asyncEvents/queue.js +0 -26
  122. package/dist/src/events/asyncEvents/queue.js.map +0 -1
  123. package/dist/src/events/backfill.js +0 -179
  124. package/dist/src/events/backfill.js.map +0 -1
  125. package/dist/src/events/documentId.js +0 -28
  126. package/dist/src/events/documentId.js.map +0 -1
  127. package/dist/src/events/events.js +0 -73
  128. package/dist/src/events/events.js.map +0 -1
  129. package/dist/src/events/identification.js +0 -300
  130. package/dist/src/events/identification.js.map +0 -1
  131. package/dist/src/events/index.js +0 -47
  132. package/dist/src/events/index.js.map +0 -1
  133. package/dist/src/events/processors/AnalyticsProcessor.js +0 -93
  134. package/dist/src/events/processors/AnalyticsProcessor.js.map +0 -1
  135. package/dist/src/events/processors/AuditLogsProcessor.js +0 -86
  136. package/dist/src/events/processors/AuditLogsProcessor.js.map +0 -1
  137. package/dist/src/events/processors/LoggingProcessor.js +0 -47
  138. package/dist/src/events/processors/LoggingProcessor.js.map +0 -1
  139. package/dist/src/events/processors/Processors.js +0 -52
  140. package/dist/src/events/processors/Processors.js.map +0 -1
  141. package/dist/src/events/processors/async/DocumentUpdateProcessor.js +0 -44
  142. package/dist/src/events/processors/async/DocumentUpdateProcessor.js.map +0 -1
  143. package/dist/src/events/processors/index.js +0 -23
  144. package/dist/src/events/processors/index.js.map +0 -1
  145. package/dist/src/events/processors/posthog/PosthogProcessor.js +0 -139
  146. package/dist/src/events/processors/posthog/PosthogProcessor.js.map +0 -1
  147. package/dist/src/events/processors/posthog/index.js +0 -8
  148. package/dist/src/events/processors/posthog/index.js.map +0 -1
  149. package/dist/src/events/processors/posthog/rateLimiting.js +0 -119
  150. package/dist/src/events/processors/posthog/rateLimiting.js.map +0 -1
  151. package/dist/src/events/processors/types.js +0 -3
  152. package/dist/src/events/processors/types.js.map +0 -1
  153. package/dist/src/events/publishers/account.js +0 -43
  154. package/dist/src/events/publishers/account.js.map +0 -1
  155. package/dist/src/events/publishers/app.js +0 -153
  156. package/dist/src/events/publishers/app.js.map +0 -1
  157. package/dist/src/events/publishers/auditLog.js +0 -34
  158. package/dist/src/events/publishers/auditLog.js.map +0 -1
  159. package/dist/src/events/publishers/auth.js +0 -80
  160. package/dist/src/events/publishers/auth.js.map +0 -1
  161. package/dist/src/events/publishers/automation.js +0 -117
  162. package/dist/src/events/publishers/automation.js.map +0 -1
  163. package/dist/src/events/publishers/backfill.js +0 -85
  164. package/dist/src/events/publishers/backfill.js.map +0 -1
  165. package/dist/src/events/publishers/backup.js +0 -41
  166. package/dist/src/events/publishers/backup.js.map +0 -1
  167. package/dist/src/events/publishers/datasource.js +0 -54
  168. package/dist/src/events/publishers/datasource.js.map +0 -1
  169. package/dist/src/events/publishers/email.js +0 -30
  170. package/dist/src/events/publishers/email.js.map +0 -1
  171. package/dist/src/events/publishers/environmentVariable.js +0 -44
  172. package/dist/src/events/publishers/environmentVariable.js.map +0 -1
  173. package/dist/src/events/publishers/group.js +0 -107
  174. package/dist/src/events/publishers/group.js.map +0 -1
  175. package/dist/src/events/publishers/index.js +0 -55
  176. package/dist/src/events/publishers/index.js.map +0 -1
  177. package/dist/src/events/publishers/installation.js +0 -52
  178. package/dist/src/events/publishers/installation.js.map +0 -1
  179. package/dist/src/events/publishers/layout.js +0 -34
  180. package/dist/src/events/publishers/layout.js.map +0 -1
  181. package/dist/src/events/publishers/license.js +0 -77
  182. package/dist/src/events/publishers/license.js.map +0 -1
  183. package/dist/src/events/publishers/org.js +0 -52
  184. package/dist/src/events/publishers/org.js.map +0 -1
  185. package/dist/src/events/publishers/plugin.js +0 -55
  186. package/dist/src/events/publishers/plugin.js.map +0 -1
  187. package/dist/src/events/publishers/query.js +0 -74
  188. package/dist/src/events/publishers/query.js.map +0 -1
  189. package/dist/src/events/publishers/role.js +0 -69
  190. package/dist/src/events/publishers/role.js.map +0 -1
  191. package/dist/src/events/publishers/rows.js +0 -32
  192. package/dist/src/events/publishers/rows.js.map +0 -1
  193. package/dist/src/events/publishers/screen.js +0 -46
  194. package/dist/src/events/publishers/screen.js.map +0 -1
  195. package/dist/src/events/publishers/serve.js +0 -47
  196. package/dist/src/events/publishers/serve.js.map +0 -1
  197. package/dist/src/events/publishers/table.js +0 -77
  198. package/dist/src/events/publishers/table.js.map +0 -1
  199. package/dist/src/events/publishers/user.js +0 -202
  200. package/dist/src/events/publishers/user.js.map +0 -1
  201. package/dist/src/events/publishers/view.js +0 -111
  202. package/dist/src/events/publishers/view.js.map +0 -1
  203. package/dist/src/featureFlags/index.js +0 -96
  204. package/dist/src/featureFlags/index.js.map +0 -1
  205. package/dist/src/helpers.js +0 -14
  206. package/dist/src/helpers.js.map +0 -1
  207. package/dist/src/index.js +0 -82
  208. package/dist/src/index.js.map +0 -1
  209. package/dist/src/installation.js +0 -138
  210. package/dist/src/installation.js.map +0 -1
  211. package/dist/src/logging/alerts.js +0 -24
  212. package/dist/src/logging/alerts.js.map +0 -1
  213. package/dist/src/logging/correlation/correlation.js +0 -17
  214. package/dist/src/logging/correlation/correlation.js.map +0 -1
  215. package/dist/src/logging/correlation/index.js +0 -18
  216. package/dist/src/logging/correlation/index.js.map +0 -1
  217. package/dist/src/logging/correlation/middleware.js +0 -17
  218. package/dist/src/logging/correlation/middleware.js.map +0 -1
  219. package/dist/src/logging/index.js +0 -35
  220. package/dist/src/logging/index.js.map +0 -1
  221. package/dist/src/logging/pino/logger.js +0 -218
  222. package/dist/src/logging/pino/logger.js.map +0 -1
  223. package/dist/src/logging/pino/middleware.js +0 -47
  224. package/dist/src/logging/pino/middleware.js.map +0 -1
  225. package/dist/src/logging/system.js +0 -101
  226. package/dist/src/logging/system.js.map +0 -1
  227. package/dist/src/middleware/adminOnly.js +0 -19
  228. package/dist/src/middleware/adminOnly.js.map +0 -1
  229. package/dist/src/middleware/auditLog.js +0 -16
  230. package/dist/src/middleware/auditLog.js.map +0 -1
  231. package/dist/src/middleware/authenticated.js +0 -204
  232. package/dist/src/middleware/authenticated.js.map +0 -1
  233. package/dist/src/middleware/builderOnly.js +0 -33
  234. package/dist/src/middleware/builderOnly.js.map +0 -1
  235. package/dist/src/middleware/builderOrAdmin.js +0 -33
  236. package/dist/src/middleware/builderOrAdmin.js.map +0 -1
  237. package/dist/src/middleware/csrf.js +0 -81
  238. package/dist/src/middleware/csrf.js.map +0 -1
  239. package/dist/src/middleware/errorHandling.js +0 -64
  240. package/dist/src/middleware/errorHandling.js.map +0 -1
  241. package/dist/src/middleware/index.js +0 -65
  242. package/dist/src/middleware/index.js.map +0 -1
  243. package/dist/src/middleware/internalApi.js +0 -30
  244. package/dist/src/middleware/internalApi.js.map +0 -1
  245. package/dist/src/middleware/joi-validator.js +0 -47
  246. package/dist/src/middleware/joi-validator.js.map +0 -1
  247. package/dist/src/middleware/matchers.js +0 -43
  248. package/dist/src/middleware/matchers.js.map +0 -1
  249. package/dist/src/middleware/passport/datasource/google.js +0 -95
  250. package/dist/src/middleware/passport/datasource/google.js.map +0 -1
  251. package/dist/src/middleware/passport/local.js +0 -81
  252. package/dist/src/middleware/passport/local.js.map +0 -1
  253. package/dist/src/middleware/passport/sso/google.js +0 -90
  254. package/dist/src/middleware/passport/sso/google.js.map +0 -1
  255. package/dist/src/middleware/passport/sso/oidc.js +0 -151
  256. package/dist/src/middleware/passport/sso/oidc.js.map +0 -1
  257. package/dist/src/middleware/passport/sso/sso.js +0 -165
  258. package/dist/src/middleware/passport/sso/sso.js.map +0 -1
  259. package/dist/src/middleware/passport/utils.js +0 -66
  260. package/dist/src/middleware/passport/utils.js.map +0 -1
  261. package/dist/src/middleware/querystringToBody.js +0 -29
  262. package/dist/src/middleware/querystringToBody.js.map +0 -1
  263. package/dist/src/middleware/tenancy.js +0 -37
  264. package/dist/src/middleware/tenancy.js.map +0 -1
  265. package/dist/src/migrations/definitions.js +0 -39
  266. package/dist/src/migrations/definitions.js.map +0 -1
  267. package/dist/src/migrations/index.js +0 -19
  268. package/dist/src/migrations/index.js.map +0 -1
  269. package/dist/src/migrations/migrations.js +0 -198
  270. package/dist/src/migrations/migrations.js.map +0 -1
  271. package/dist/src/objectStore/buckets/app.js +0 -73
  272. package/dist/src/objectStore/buckets/app.js.map +0 -1
  273. package/dist/src/objectStore/buckets/global.js +0 -58
  274. package/dist/src/objectStore/buckets/global.js.map +0 -1
  275. package/dist/src/objectStore/buckets/index.js +0 -20
  276. package/dist/src/objectStore/buckets/index.js.map +0 -1
  277. package/dist/src/objectStore/buckets/plugins.js +0 -95
  278. package/dist/src/objectStore/buckets/plugins.js.map +0 -1
  279. package/dist/src/objectStore/cloudfront.js +0 -40
  280. package/dist/src/objectStore/cloudfront.js.map +0 -1
  281. package/dist/src/objectStore/index.js +0 -20
  282. package/dist/src/objectStore/index.js.map +0 -1
  283. package/dist/src/objectStore/objectStore.js +0 -382
  284. package/dist/src/objectStore/objectStore.js.map +0 -1
  285. package/dist/src/objectStore/utils.js +0 -32
  286. package/dist/src/objectStore/utils.js.map +0 -1
  287. package/dist/src/platform/index.js +0 -33
  288. package/dist/src/platform/index.js.map +0 -1
  289. package/dist/src/platform/platformDb.js +0 -10
  290. package/dist/src/platform/platformDb.js.map +0 -1
  291. package/dist/src/platform/tenants.js +0 -139
  292. package/dist/src/platform/tenants.js.map +0 -1
  293. package/dist/src/platform/users.js +0 -96
  294. package/dist/src/platform/users.js.map +0 -1
  295. package/dist/src/plugin/index.js +0 -18
  296. package/dist/src/plugin/index.js.map +0 -1
  297. package/dist/src/plugin/utils.js +0 -145
  298. package/dist/src/plugin/utils.js.map +0 -1
  299. package/dist/src/queue/constants.js +0 -11
  300. package/dist/src/queue/constants.js.map +0 -1
  301. package/dist/src/queue/inMemoryQueue.js +0 -145
  302. package/dist/src/queue/inMemoryQueue.js.map +0 -1
  303. package/dist/src/queue/index.js +0 -19
  304. package/dist/src/queue/index.js.map +0 -1
  305. package/dist/src/queue/listeners.js +0 -186
  306. package/dist/src/queue/listeners.js.map +0 -1
  307. package/dist/src/queue/queue.js +0 -92
  308. package/dist/src/queue/queue.js.map +0 -1
  309. package/dist/src/redis/index.js +0 -37
  310. package/dist/src/redis/index.js.map +0 -1
  311. package/dist/src/redis/init.js +0 -138
  312. package/dist/src/redis/init.js.map +0 -1
  313. package/dist/src/redis/redis.js +0 -335
  314. package/dist/src/redis/redis.js.map +0 -1
  315. package/dist/src/redis/redlockImpl.js +0 -162
  316. package/dist/src/redis/redlockImpl.js.map +0 -1
  317. package/dist/src/redis/utils.js +0 -123
  318. package/dist/src/redis/utils.js.map +0 -1
  319. package/dist/src/security/encryption.js +0 -163
  320. package/dist/src/security/encryption.js.map +0 -1
  321. package/dist/src/security/permissions.js +0 -151
  322. package/dist/src/security/permissions.js.map +0 -1
  323. package/dist/src/security/roles.js +0 -388
  324. package/dist/src/security/roles.js.map +0 -1
  325. package/dist/src/security/sessions.js +0 -121
  326. package/dist/src/security/sessions.js.map +0 -1
  327. package/dist/src/tenancy/db.js +0 -10
  328. package/dist/src/tenancy/db.js.map +0 -1
  329. package/dist/src/tenancy/index.js +0 -19
  330. package/dist/src/tenancy/index.js.map +0 -1
  331. package/dist/src/tenancy/tenancy.js +0 -116
  332. package/dist/src/tenancy/tenancy.js.map +0 -1
  333. package/dist/src/timers/index.js +0 -18
  334. package/dist/src/timers/index.js.map +0 -1
  335. package/dist/src/timers/timers.js +0 -26
  336. package/dist/src/timers/timers.js.map +0 -1
  337. package/dist/src/users/db.js +0 -407
  338. package/dist/src/users/db.js.map +0 -1
  339. package/dist/src/users/events.js +0 -169
  340. package/dist/src/users/events.js.map +0 -1
  341. package/dist/src/users/index.js +0 -23
  342. package/dist/src/users/index.js.map +0 -1
  343. package/dist/src/users/lookup.js +0 -112
  344. package/dist/src/users/lookup.js.map +0 -1
  345. package/dist/src/users/users.js +0 -261
  346. package/dist/src/users/users.js.map +0 -1
  347. package/dist/src/users/utils.js +0 -92
  348. package/dist/src/users/utils.js.map +0 -1
  349. package/dist/src/utils/hashing.js +0 -47
  350. package/dist/src/utils/hashing.js.map +0 -1
  351. package/dist/src/utils/index.js +0 -20
  352. package/dist/src/utils/index.js.map +0 -1
  353. package/dist/src/utils/stringUtils.js +0 -9
  354. package/dist/src/utils/stringUtils.js.map +0 -1
  355. package/dist/src/utils/utils.js +0 -247
  356. package/dist/src/utils/utils.js.map +0 -1
  357. package/dist/tests/core/logging.js +0 -33
  358. package/dist/tests/core/logging.js.map +0 -1
  359. package/dist/tests/core/utilities/index.js +0 -37
  360. package/dist/tests/core/utilities/index.js.map +0 -1
  361. package/dist/tests/core/utilities/jestUtils.js +0 -21
  362. package/dist/tests/core/utilities/jestUtils.js.map +0 -1
  363. package/dist/tests/core/utilities/mocks/alerts.js +0 -30
  364. package/dist/tests/core/utilities/mocks/alerts.js.map +0 -1
  365. package/dist/tests/core/utilities/mocks/date.js +0 -6
  366. package/dist/tests/core/utilities/mocks/date.js.map +0 -1
  367. package/dist/tests/core/utilities/mocks/events.js +0 -143
  368. package/dist/tests/core/utilities/mocks/events.js.map +0 -1
  369. package/dist/tests/core/utilities/mocks/fetch.js +0 -15
  370. package/dist/tests/core/utilities/mocks/fetch.js.map +0 -1
  371. package/dist/tests/core/utilities/mocks/index.js +0 -43
  372. package/dist/tests/core/utilities/mocks/index.js.map +0 -1
  373. package/dist/tests/core/utilities/mocks/licenses.js +0 -97
  374. package/dist/tests/core/utilities/mocks/licenses.js.map +0 -1
  375. package/dist/tests/core/utilities/mocks/posthog.js +0 -9
  376. package/dist/tests/core/utilities/mocks/posthog.js.map +0 -1
  377. package/dist/tests/core/utilities/structures/Chance.js +0 -21
  378. package/dist/tests/core/utilities/structures/Chance.js.map +0 -1
  379. package/dist/tests/core/utilities/structures/accounts.js +0 -78
  380. package/dist/tests/core/utilities/structures/accounts.js.map +0 -1
  381. package/dist/tests/core/utilities/structures/apps.js +0 -24
  382. package/dist/tests/core/utilities/structures/apps.js.map +0 -1
  383. package/dist/tests/core/utilities/structures/common.js +0 -11
  384. package/dist/tests/core/utilities/structures/common.js.map +0 -1
  385. package/dist/tests/core/utilities/structures/db.js +0 -16
  386. package/dist/tests/core/utilities/structures/db.js.map +0 -1
  387. package/dist/tests/core/utilities/structures/documents/index.js +0 -18
  388. package/dist/tests/core/utilities/structures/documents/index.js.map +0 -1
  389. package/dist/tests/core/utilities/structures/documents/platform/index.js +0 -28
  390. package/dist/tests/core/utilities/structures/documents/platform/index.js.map +0 -1
  391. package/dist/tests/core/utilities/structures/documents/platform/installation.js +0 -38
  392. package/dist/tests/core/utilities/structures/documents/platform/installation.js.map +0 -1
  393. package/dist/tests/core/utilities/structures/generator.js +0 -9
  394. package/dist/tests/core/utilities/structures/generator.js.map +0 -1
  395. package/dist/tests/core/utilities/structures/index.js +0 -46
  396. package/dist/tests/core/utilities/structures/index.js.map +0 -1
  397. package/dist/tests/core/utilities/structures/koa.js +0 -10
  398. package/dist/tests/core/utilities/structures/koa.js.map +0 -1
  399. package/dist/tests/core/utilities/structures/licenses.js +0 -140
  400. package/dist/tests/core/utilities/structures/licenses.js.map +0 -1
  401. package/dist/tests/core/utilities/structures/plugins.js +0 -23
  402. package/dist/tests/core/utilities/structures/plugins.js.map +0 -1
  403. package/dist/tests/core/utilities/structures/quotas.js +0 -71
  404. package/dist/tests/core/utilities/structures/quotas.js.map +0 -1
  405. package/dist/tests/core/utilities/structures/scim.js +0 -63
  406. package/dist/tests/core/utilities/structures/scim.js.map +0 -1
  407. package/dist/tests/core/utilities/structures/shared.js +0 -14
  408. package/dist/tests/core/utilities/structures/shared.js.map +0 -1
  409. package/dist/tests/core/utilities/structures/sso.js +0 -132
  410. package/dist/tests/core/utilities/structures/sso.js.map +0 -1
  411. package/dist/tests/core/utilities/structures/tenants.js +0 -9
  412. package/dist/tests/core/utilities/structures/tenants.js.map +0 -1
  413. package/dist/tests/core/utilities/structures/userGroups.js +0 -13
  414. package/dist/tests/core/utilities/structures/userGroups.js.map +0 -1
  415. package/dist/tests/core/utilities/structures/users.js +0 -48
  416. package/dist/tests/core/utilities/structures/users.js.map +0 -1
  417. package/dist/tests/core/utilities/testContainerUtils.js +0 -84
  418. package/dist/tests/core/utilities/testContainerUtils.js.map +0 -1
  419. package/dist/tests/core/utilities/utils/index.js +0 -28
  420. package/dist/tests/core/utilities/utils/index.js.map +0 -1
  421. package/dist/tests/core/utilities/utils/time.js +0 -8
  422. package/dist/tests/core/utilities/utils/time.js.map +0 -1
  423. package/dist/tests/extra/DBTestConfiguration.js +0 -55
  424. package/dist/tests/extra/DBTestConfiguration.js.map +0 -1
  425. package/dist/tests/extra/index.js +0 -33
  426. package/dist/tests/extra/index.js.map +0 -1
  427. package/dist/tests/extra/testEnv.js +0 -127
  428. package/dist/tests/extra/testEnv.js.map +0 -1
  429. package/dist/tests/index.js +0 -18
  430. package/dist/tests/index.js.map +0 -1
  431. package/dist/tests/jestEnv.js +0 -8
  432. package/dist/tests/jestEnv.js.map +0 -1
  433. package/dist/tests/jestSetup.js +0 -28
  434. package/dist/tests/jestSetup.js.map +0 -1
  435. package/plugins.ts +0 -1
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.params = exports.body = void 0;
7
- const joi_1 = __importDefault(require("joi"));
8
- function validate(schema, property) {
9
- // Return a Koa middleware function
10
- return (ctx, next) => {
11
- var _a;
12
- if (!schema) {
13
- return next();
14
- }
15
- let params = null;
16
- // @ts-ignore
17
- let reqProp = (_a = ctx.request) === null || _a === void 0 ? void 0 : _a[property];
18
- if (ctx[property] != null) {
19
- params = ctx[property];
20
- }
21
- else if (reqProp != null) {
22
- params = reqProp;
23
- }
24
- // not all schemas have the append property e.g. array schemas
25
- if (schema.append) {
26
- schema = schema.append({
27
- createdAt: joi_1.default.any().optional(),
28
- updatedAt: joi_1.default.any().optional(),
29
- });
30
- }
31
- const { error } = schema.validate(params);
32
- if (error) {
33
- ctx.throw(400, `Invalid ${property} - ${error.message}`);
34
- return;
35
- }
36
- return next();
37
- };
38
- }
39
- function body(schema) {
40
- return validate(schema, "body");
41
- }
42
- exports.body = body;
43
- function params(schema) {
44
- return validate(schema, "params");
45
- }
46
- exports.params = params;
47
- //# sourceMappingURL=joi-validator.js.map
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AgB,MAAM,CAAC,MAA0C;IAC/D,OAAO,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AACnC,CAAC;AAFD,wBAEC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.matches = exports.buildMatcherRegex = void 0;
4
- const PARAM_REGEX = /\/:(.*?)(\/.*)?$/g;
5
- const buildMatcherRegex = (patterns) => {
6
- if (!patterns) {
7
- return [];
8
- }
9
- return patterns.map(pattern => {
10
- let route = pattern.route;
11
- const method = pattern.method;
12
- const strict = pattern.strict ? pattern.strict : false;
13
- // if there is a param in the route
14
- // use a wildcard pattern
15
- const matches = route.match(PARAM_REGEX);
16
- if (matches) {
17
- for (let match of matches) {
18
- const suffix = match.endsWith("/") ? "/" : "";
19
- const pattern = "/.*" + suffix;
20
- route = route.replace(match, pattern);
21
- }
22
- }
23
- return { regex: new RegExp(route), method, strict, route };
24
- });
25
- };
26
- exports.buildMatcherRegex = buildMatcherRegex;
27
- const matches = (ctx, options) => {
28
- return options.find(({ regex, method, strict, route }) => {
29
- let urlMatch;
30
- if (strict) {
31
- urlMatch = ctx.request.url === route;
32
- }
33
- else {
34
- urlMatch = regex.test(ctx.request.url);
35
- }
36
- const methodMatch = method === "ALL"
37
- ? true
38
- : ctx.request.method.toLowerCase() === method.toLowerCase();
39
- return urlMatch && methodMatch;
40
- });
41
- };
42
- exports.matches = matches;
43
- //# sourceMappingURL=matchers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"matchers.js","sourceRoot":"","sources":["../../../src/middleware/matchers.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,mBAAmB,CAAA;AAEhC,MAAM,iBAAiB,GAAG,CAC/B,QAA2B,EACX,EAAE;IAClB,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAA;KACV;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QAC5B,IAAI,KAAK,G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YACN,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,WAAW,EAAE,CAAA;QAE/D,OAAO,QAAQ,IAAI,WAAW,CAAA;IAChC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAhBY,QAAA,OAAO,WAgBnB"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.postAuth = exports.preAuth = void 0;
36
- const google = __importStar(require("../sso/google"));
37
- const constants_1 = require("../../../constants");
38
- const configs = __importStar(require("../../../configs"));
39
- const cache = __importStar(require("../../../cache"));
40
- const utils = __importStar(require("../../../utils"));
41
- const sso_1 = require("../sso/sso");
42
- const GoogleStrategy = require("passport-google-oauth").OAuth2Strategy;
43
- function fetchGoogleCreds() {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- let config = yield configs.getGoogleDatasourceConfig();
46
- if (!config) {
47
- throw new Error("No google configuration found");
48
- }
49
- return config;
50
- });
51
- }
52
- function preAuth(passport, ctx, next) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- // get the relevant config
55
- const googleConfig = yield fetchGoogleCreds();
56
- const platformUrl = yield configs.getPlatformUrl({ tenantAware: false });
57
- let callbackUrl = `${platformUrl}/api/global/auth/datasource/google/callback`;
58
- const strategy = yield google.strategyFactory(googleConfig, callbackUrl, sso_1.ssoSaveUserNoOp);
59
- if (!ctx.query.appId) {
60
- ctx.throw(400, "appId query param not present.");
61
- }
62
- return passport.authenticate(strategy, {
63
- scope: ["profile", "email", "https://www.googleapis.com/auth/spreadsheets"],
64
- accessType: "offline",
65
- prompt: "consent",
66
- })(ctx, next);
67
- });
68
- }
69
- exports.preAuth = preAuth;
70
- function postAuth(passport, ctx, next) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- // get the relevant config
73
- const config = yield fetchGoogleCreds();
74
- const platformUrl = yield configs.getPlatformUrl({ tenantAware: false });
75
- let callbackUrl = `${platformUrl}/api/global/auth/datasource/google/callback`;
76
- const authStateCookie = utils.getCookie(ctx, constants_1.Cookie.DatasourceAuth);
77
- return passport.authenticate(new GoogleStrategy({
78
- clientID: config.clientID,
79
- clientSecret: config.clientSecret,
80
- callbackURL: callbackUrl,
81
- }, (accessToken, refreshToken, _profile, done) => {
82
- utils.clearCookie(ctx, constants_1.Cookie.DatasourceAuth);
83
- done(null, { accessToken, refreshToken });
84
- }), { successRedirect: "/", failureRedirect: "/error" }, (err, tokens) => __awaiter(this, void 0, void 0, function* () {
85
- const baseUrl = `/builder/app/${authStateCookie.appId}/data`;
86
- const id = utils.newid();
87
- yield cache.store(`datasource:creation:${authStateCookie.appId}:google:${id}`, {
88
- tokens,
89
- });
90
- ctx.redirect(`${baseUrl}/new?continue_google_setup=${id}`);
91
- }))(ctx, next);
92
- });
93
- }
94
- exports.postAuth = postAuth;
95
- //# sourceMappingURL=google.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google.js","sourceRoot":"","sources":["../../../../../src/middleware/passport/datasource/google.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAuC;AACvC,kDAA2C;AAC3C,0DAA2C;AAC3C,sDAAuC;AACvC,sDAAuC;AAEvC,oCAA4C;AAE5C,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,cAAc,CAAA;AAMtE,SAAe,gBAAgB;;QAC7B,IAAI,MAAM,GAAG,MAAM,OAAO,CAAC,yBAAyB,EAAE,CAAA;QAEtD,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;SACjD;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAED,SAAsB,OAAO,CAC3B,QAAkB,EAClB,GAAY,EACZ,IAAc;;QAEd,0BAA0B;QAC1B,MAAM,YAAY,GAAG,MAAM,gBAAgB,EAAE,CAAA;QAC7C,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;QAExE,IAAI,WAAW,GAAG,GAAG,WAAW,6CAA6C,CAAA;QAC7E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,eAAe,CAC3C,YAAY,EACZ,WAAW,EACX,qBAAe,CAChB,CAAA;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE;YACpB,GAAG,CAAC,KAAK,CAAC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AK,CAAC,KAAK,EAAE,CAAA;YACxB,MAAM,KAAK,CAAC,KAAK,CACf,uBAAuB,eAAe,CAAC,KAAK,WAAW,EAAE,EAAE,EAC3D;gBACE,MAAM;aACP,CACF,CAAA;YAED,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,8BAA8B,EAAE,EAAE,CAAC,CAAA;QAC5D,CAAC,CAAA,CACF,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACd,CAAC;CAAA;AA5CD,4BA4CC"}
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.authenticate = exports.options = void 0;
36
- const constants_1 = require("../../constants");
37
- const utils_1 = require("../../utils");
38
- const users = __importStar(require("../../users"));
39
- const utils_2 = require("./utils");
40
- const INVALID_ERR = "Invalid credentials";
41
- const EXPIRED = "This account has expired. Please reset your password";
42
- exports.options = {
43
- passReqToCallback: true,
44
- };
45
- /**
46
- * Passport Local Authentication Middleware.
47
- * @param {*} ctx the request structure
48
- * @param {*} email username to login with
49
- * @param {*} password plain text password to log in with
50
- * @param {*} done callback from passport to return user information and errors
51
- * @returns The authenticated user, or errors if they occur
52
- */
53
- function authenticate(ctx, email, password, done) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- if (!email)
56
- return (0, utils_2.authError)(done, "Email Required");
57
- if (!password)
58
- return (0, utils_2.authError)(done, "Password Required");
59
- const dbUser = yield users.getGlobalUserByEmail(email);
60
- if (dbUser == null) {
61
- console.info(`user=${email} could not be found`);
62
- return (0, utils_2.authError)(done, INVALID_ERR);
63
- }
64
- if (dbUser.status === constants_1.UserStatus.INACTIVE) {
65
- console.info(`user=${email} is inactive`, dbUser);
66
- return (0, utils_2.authError)(done, INVALID_ERR);
67
- }
68
- if (!dbUser.password) {
69
- console.info(`user=${email} has no password set`, dbUser);
70
- return (0, utils_2.authError)(done, EXPIRED);
71
- }
72
- if (!(yield (0, utils_1.compare)(password, dbUser.password))) {
73
- return (0, utils_2.authError)(done, INVALID_ERR);
74
- }
75
- // intentionally remove the users password in payload
76
- delete dbUser.password;
77
- return done(null, dbUser);
78
- });
79
- }
80
- exports.authenticate = authenticate;
81
- //# sourceMappingURL=local.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src/middleware/passport/local.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4C;AAC5C,uCAAqC;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,qDAAqD;QACrD,OAAO,MAAM,CAAC,QAAQ,CAAA;QACtB,OAAO,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC3B,CAAC;CAAA;AAhCD,oCAgCC"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.getCallbackUrl = exports.strategyFactory = exports.buildVerifyFn = void 0;
36
- const utils_1 = require("../utils");
37
- const sso = __importStar(require("./sso"));
38
- const types_1 = require("@budibase/types");
39
- const GoogleStrategy = require("passport-google-oauth").OAuth2Strategy;
40
- function buildVerifyFn(saveUserFn) {
41
- return (accessToken, refreshToken, profile, done) => {
42
- const details = {
43
- provider: "google",
44
- providerType: types_1.SSOProviderType.GOOGLE,
45
- userId: profile.id,
46
- profile: profile,
47
- email: profile._json.email,
48
- oauth2: {
49
- accessToken,
50
- refreshToken,
51
- },
52
- };
53
- return sso.authenticate(details, true, // require local accounts to exist
54
- done, saveUserFn);
55
- };
56
- }
57
- exports.buildVerifyFn = buildVerifyFn;
58
- /**
59
- * Create an instance of the google passport strategy. This wrapper fetches the configuration
60
- * from couchDB rather than environment variables, using this factory is necessary for dynamically configuring passport.
61
- * @returns Dynamically configured Passport Google Strategy
62
- */
63
- function strategyFactory(config, callbackUrl, saveUserFn) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- try {
66
- const { clientID, clientSecret } = config;
67
- if (!clientID || !clientSecret) {
68
- throw new Error("Configuration invalid. Must contain google clientID and clientSecret");
69
- }
70
- const verify = buildVerifyFn(saveUserFn);
71
- return new GoogleStrategy({
72
- clientID: config.clientID,
73
- clientSecret: config.clientSecret,
74
- callbackURL: callbackUrl,
75
- }, verify);
76
- }
77
- catch (err) {
78
- console.error(err);
79
- throw new Error(`Error constructing google authentication strategy: ${err}`);
80
- }
81
- });
82
- }
83
- exports.strategyFactory = strategyFactory;
84
- function getCallbackUrl(config) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- return (0, utils_1.ssoCallbackUrl)(types_1.ConfigType.GOOGLE, config);
87
- });
88
- }
89
- exports.getCallbackUrl = getCallbackUrl;
90
- //# sourceMappingURL=google.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"google.js","sourceRoot":"","sources":["../../../../../src/middleware/passport/sso/google.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAyC;AACzC,2CAA4B;AAC5B,2CAOwB;AACxB,MAAM,cA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,MAAyB;;QAC5D,OAAO,IAAA,sBAAc,EAAC,kBAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClD,CAAC;CAAA;AAFD,wCAEC"}
@@ -1,151 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.getCallbackUrl = exports.fetchStrategyConfig = exports.strategyFactory = exports.buildVerifyFn = void 0;
39
- const node_fetch_1 = __importDefault(require("node-fetch"));
40
- const sso = __importStar(require("./sso"));
41
- const utils_1 = require("../utils");
42
- const utils_2 = require("../../../utils");
43
- const types_1 = require("@budibase/types");
44
- const OIDCStrategy = require("@techpass/passport-openidconnect").Strategy;
45
- function buildVerifyFn(saveUserFn) {
46
- /**
47
- * @param {*} issuer The identity provider base URL
48
- * @param {*} sub The user ID
49
- * @param {*} profile The user profile information. Created by passport from the /userinfo response
50
- * @param {*} jwtClaims The parsed id_token claims
51
- * @param {*} accessToken The access_token for contacting the identity provider - may or may not be a JWT
52
- * @param {*} refreshToken The refresh_token for obtaining a new access_token - usually not a JWT
53
- * @param {*} idToken The id_token - always a JWT
54
- * @param {*} params The response body from requesting an access_token
55
- * @param {*} done The passport callback: err, user, info
56
- */
57
- return (issuer, sub, profile, jwtClaims, accessToken, refreshToken, idToken, params, done) => __awaiter(this, void 0, void 0, function* () {
58
- const details = {
59
- // store the issuer info to enable sync in future
60
- provider: issuer,
61
- providerType: types_1.SSOProviderType.OIDC,
62
- userId: profile.id,
63
- profile: profile,
64
- email: getEmail(profile, jwtClaims),
65
- oauth2: {
66
- accessToken: accessToken,
67
- refreshToken: refreshToken,
68
- },
69
- };
70
- return sso.authenticate(details, false, // don't require local accounts to exist
71
- done, saveUserFn);
72
- });
73
- }
74
- exports.buildVerifyFn = buildVerifyFn;
75
- /**
76
- * @param {*} profile The structured profile created by passport using the user info endpoint
77
- * @param {*} jwtClaims The claims returned in the id token
78
- */
79
- function getEmail(profile, jwtClaims) {
80
- // profile not guaranteed to contain email e.g. github connected azure ad account
81
- if (profile._json.email) {
82
- return profile._json.email;
83
- }
84
- // fallback to id token email
85
- if (jwtClaims.email) {
86
- return jwtClaims.email;
87
- }
88
- // fallback to id token preferred username
89
- const username = jwtClaims.preferred_username;
90
- if (username && (0, utils_2.validEmail)(username)) {
91
- return username;
92
- }
93
- throw new Error(`Could not determine user email from profile ${JSON.stringify(profile)} and claims ${JSON.stringify(jwtClaims)}`);
94
- }
95
- /**
96
- * Create an instance of the oidc passport strategy. This wrapper fetches the configuration
97
- * from couchDB rather than environment variables, using this factory is necessary for dynamically configuring passport.
98
- * @returns Dynamically configured Passport OIDC Strategy
99
- */
100
- function strategyFactory(config, saveUserFn) {
101
- return __awaiter(this, void 0, void 0, function* () {
102
- try {
103
- const verify = buildVerifyFn(saveUserFn);
104
- const strategy = new OIDCStrategy(config, verify);
105
- strategy.name = "oidc";
106
- return strategy;
107
- }
108
- catch (err) {
109
- console.error(err);
110
- throw new Error(`Error constructing OIDC authentication strategy - ${err}`);
111
- }
112
- });
113
- }
114
- exports.strategyFactory = strategyFactory;
115
- function fetchStrategyConfig(oidcConfig, callbackUrl) {
116
- return __awaiter(this, void 0, void 0, function* () {
117
- try {
118
- const { clientID, clientSecret, configUrl } = oidcConfig;
119
- if (!clientID || !clientSecret || !callbackUrl || !configUrl) {
120
- // check for remote config and all required elements
121
- throw new Error("Configuration invalid. Must contain clientID, clientSecret, callbackUrl and configUrl");
122
- }
123
- const response = yield (0, node_fetch_1.default)(configUrl);
124
- if (!response.ok) {
125
- throw new Error(`Unexpected response when fetching openid-configuration: ${response.statusText}`);
126
- }
127
- const body = yield response.json();
128
- return {
129
- issuer: body.issuer,
130
- authorizationURL: body.authorization_endpoint,
131
- tokenURL: body.token_endpoint,
132
- userInfoURL: body.userinfo_endpoint,
133
- clientID: clientID,
134
- clientSecret: clientSecret,
135
- callbackURL: callbackUrl,
136
- };
137
- }
138
- catch (err) {
139
- console.error(err);
140
- throw new Error(`Error constructing OIDC authentication configuration - ${err}`);
141
- }
142
- });
143
- }
144
- exports.fetchStrategyConfig = fetchStrategyConfig;
145
- function getCallbackUrl() {
146
- return __awaiter(this, void 0, void 0, function* () {
147
- return (0, utils_1.ssoCallbackUrl)(types_1.ConfigType.OIDC);
148
- });
149
- }
150
- exports.getCallbackUrl = getCallbackUrl;
151
- //# sourceMappingURL=oidc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oidc.js","sourceRoot":"","sources":["../../../../../src/middleware/passport/sso/oidc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8B;AAC9B,2CAA4B;AAC5B,oCAAyC;AACzC,0CAA2C;AAC3C,2CASwB;AAExB,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC,QAAQ,CAAA;AAEzE,SAAgB,aAAa,CAAC,UAA+B;IAC3D;;;;;;;;;;OAUG;IACH,OAAO,CACL,MAAc,EACd,GAAW,EACX,OAAmB,EACnB,SAAoB,EACpB,WAAmB,EACnB,YAAoB,EACpB,OAAe,EACf,MAAW,EACX,IAAc,EACd,EAAE;QACF,MAAM,OAAO,GAAmB;YAC9B,iDAAiD;YACjD,QAAQ,EAAE,MAAM;YAChB,YAAY,EAAE,uBAAe,CAAC,IAAI;YAClC,MAAM,EAAE,OAAO,CAAC,EAAE;YAClB,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;YACnC,MAAM,EAAE;gBACN,WAAW,EAAE,WAAW;gBACxB,YAAY,EAAE,YAAY;aAC3B;SACF,CAAA;QAED,OAAO,GAAG,CAAC,YAAY,CACrB,OAAO,EACP,KAAK,EAAE,wCAAwC;QAC/C,IAAI,EACJ,UAAU,CACX,CAAA;IACH,CAAC,CAAA,CAAA;AACH,CAAC;AA3CD,sCA2CC;AAED;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAAmB,EAAE,SAAoB;IACzD,iFAAiF;IACjF,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE;QACvB,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,CAAA;KAC3B;IAED,6BAA6B;IAC7B,IAAI,SAAS,CAAC,KAAK,EAAE;QACnB,OAAO,SAAS,CAAC,KAAK,CAAA;KACvB;IAED,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,SAA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