@atlasauth/cli 0.12.0 → 0.14.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 (280) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/args.d.ts +18 -0
  3. package/dist/args.js +9 -0
  4. package/dist/args.js.map +1 -1
  5. package/dist/commands/config.js +72 -7
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/dev.d.ts +8 -0
  8. package/dist/commands/dev.js +84 -0
  9. package/dist/commands/dev.js.map +1 -0
  10. package/dist/commands/fga.d.ts +10 -0
  11. package/dist/commands/fga.js +105 -0
  12. package/dist/commands/fga.js.map +1 -0
  13. package/dist/commands/pages.d.ts +14 -0
  14. package/dist/commands/pages.js +113 -0
  15. package/dist/commands/pages.js.map +1 -0
  16. package/dist/context.d.ts +1 -1
  17. package/dist/help.d.ts +1 -1
  18. package/dist/help.js +71 -2
  19. package/dist/help.js.map +1 -1
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +3 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/migrate/appwrite/plugin.d.ts +2 -0
  24. package/dist/migrate/appwrite/plugin.js +103 -0
  25. package/dist/migrate/appwrite/plugin.js.map +1 -0
  26. package/dist/migrate/authentik/plugin.d.ts +2 -0
  27. package/dist/migrate/authentik/plugin.js +135 -0
  28. package/dist/migrate/authentik/plugin.js.map +1 -0
  29. package/dist/migrate/azure-ad-b2c/plugin.d.ts +8 -0
  30. package/dist/migrate/azure-ad-b2c/plugin.js +165 -0
  31. package/dist/migrate/azure-ad-b2c/plugin.js.map +1 -0
  32. package/dist/migrate/cognito/plugin.d.ts +5 -0
  33. package/dist/migrate/cognito/plugin.js +170 -0
  34. package/dist/migrate/cognito/plugin.js.map +1 -0
  35. package/dist/migrate/corbado/plugin.d.ts +2 -0
  36. package/dist/migrate/corbado/plugin.js +63 -0
  37. package/dist/migrate/corbado/plugin.js.map +1 -0
  38. package/dist/migrate/entra-external-id/plugin.d.ts +8 -0
  39. package/dist/migrate/entra-external-id/plugin.js +12 -0
  40. package/dist/migrate/entra-external-id/plugin.js.map +1 -0
  41. package/dist/migrate/export/appwrite-config.d.ts +28 -0
  42. package/dist/migrate/export/appwrite-config.js +170 -0
  43. package/dist/migrate/export/appwrite-config.js.map +1 -0
  44. package/dist/migrate/export/appwrite.d.ts +51 -0
  45. package/dist/migrate/export/appwrite.js +288 -0
  46. package/dist/migrate/export/appwrite.js.map +1 -0
  47. package/dist/migrate/export/authentik-config.d.ts +45 -0
  48. package/dist/migrate/export/authentik-config.js +357 -0
  49. package/dist/migrate/export/authentik-config.js.map +1 -0
  50. package/dist/migrate/export/authentik.d.ts +110 -0
  51. package/dist/migrate/export/authentik.js +838 -0
  52. package/dist/migrate/export/authentik.js.map +1 -0
  53. package/dist/migrate/export/azure-config.d.ts +58 -0
  54. package/dist/migrate/export/azure-config.js +344 -0
  55. package/dist/migrate/export/azure-config.js.map +1 -0
  56. package/dist/migrate/export/azure.d.ts +85 -0
  57. package/dist/migrate/export/azure.js +373 -0
  58. package/dist/migrate/export/azure.js.map +1 -0
  59. package/dist/migrate/export/cognito-config.d.ts +25 -0
  60. package/dist/migrate/export/cognito-config.js +273 -0
  61. package/dist/migrate/export/cognito-config.js.map +1 -0
  62. package/dist/migrate/export/cognito.d.ts +103 -0
  63. package/dist/migrate/export/cognito.js +441 -0
  64. package/dist/migrate/export/cognito.js.map +1 -0
  65. package/dist/migrate/export/corbado-config.d.ts +20 -0
  66. package/dist/migrate/export/corbado-config.js +63 -0
  67. package/dist/migrate/export/corbado-config.js.map +1 -0
  68. package/dist/migrate/export/corbado.d.ts +37 -0
  69. package/dist/migrate/export/corbado.js +132 -0
  70. package/dist/migrate/export/corbado.js.map +1 -0
  71. package/dist/migrate/export/firebase-config.d.ts +24 -0
  72. package/dist/migrate/export/firebase-config.js +215 -0
  73. package/dist/migrate/export/firebase-config.js.map +1 -0
  74. package/dist/migrate/export/firebase.d.ts +102 -0
  75. package/dist/migrate/export/firebase.js +464 -0
  76. package/dist/migrate/export/firebase.js.map +1 -0
  77. package/dist/migrate/export/frontegg-config.d.ts +29 -0
  78. package/dist/migrate/export/frontegg-config.js +238 -0
  79. package/dist/migrate/export/frontegg-config.js.map +1 -0
  80. package/dist/migrate/export/frontegg.d.ts +67 -0
  81. package/dist/migrate/export/frontegg.js +410 -0
  82. package/dist/migrate/export/frontegg.js.map +1 -0
  83. package/dist/migrate/export/fusionauth-config.d.ts +26 -0
  84. package/dist/migrate/export/fusionauth-config.js +226 -0
  85. package/dist/migrate/export/fusionauth-config.js.map +1 -0
  86. package/dist/migrate/export/fusionauth.d.ts +99 -0
  87. package/dist/migrate/export/fusionauth.js +642 -0
  88. package/dist/migrate/export/fusionauth.js.map +1 -0
  89. package/dist/migrate/export/hanko-config.d.ts +27 -0
  90. package/dist/migrate/export/hanko-config.js +265 -0
  91. package/dist/migrate/export/hanko-config.js.map +1 -0
  92. package/dist/migrate/export/hanko.d.ts +52 -0
  93. package/dist/migrate/export/hanko.js +605 -0
  94. package/dist/migrate/export/hanko.js.map +1 -0
  95. package/dist/migrate/export/keycloak-config.d.ts +19 -0
  96. package/dist/migrate/export/keycloak-config.js +219 -0
  97. package/dist/migrate/export/keycloak-config.js.map +1 -0
  98. package/dist/migrate/export/keycloak.d.ts +155 -0
  99. package/dist/migrate/export/keycloak.js +878 -0
  100. package/dist/migrate/export/keycloak.js.map +1 -0
  101. package/dist/migrate/export/ldap.d.ts +53 -0
  102. package/dist/migrate/export/ldap.js +277 -0
  103. package/dist/migrate/export/ldap.js.map +1 -0
  104. package/dist/migrate/export/logto-config.d.ts +27 -0
  105. package/dist/migrate/export/logto-config.js +264 -0
  106. package/dist/migrate/export/logto-config.js.map +1 -0
  107. package/dist/migrate/export/logto.d.ts +150 -0
  108. package/dist/migrate/export/logto.js +809 -0
  109. package/dist/migrate/export/logto.js.map +1 -0
  110. package/dist/migrate/export/magic-config.d.ts +14 -0
  111. package/dist/migrate/export/magic-config.js +28 -0
  112. package/dist/migrate/export/magic-config.js.map +1 -0
  113. package/dist/migrate/export/magic.d.ts +31 -0
  114. package/dist/migrate/export/magic.js +93 -0
  115. package/dist/migrate/export/magic.js.map +1 -0
  116. package/dist/migrate/export/mini-yaml.d.ts +19 -0
  117. package/dist/migrate/export/mini-yaml.js +581 -0
  118. package/dist/migrate/export/mini-yaml.js.map +1 -0
  119. package/dist/migrate/export/nhost-config.d.ts +26 -0
  120. package/dist/migrate/export/nhost-config.js +360 -0
  121. package/dist/migrate/export/nhost-config.js.map +1 -0
  122. package/dist/migrate/export/nhost.d.ts +64 -0
  123. package/dist/migrate/export/nhost.js +304 -0
  124. package/dist/migrate/export/nhost.js.map +1 -0
  125. package/dist/migrate/export/onelogin.d.ts +22 -0
  126. package/dist/migrate/export/onelogin.js +123 -0
  127. package/dist/migrate/export/onelogin.js.map +1 -0
  128. package/dist/migrate/export/ory-config.d.ts +58 -0
  129. package/dist/migrate/export/ory-config.js +451 -0
  130. package/dist/migrate/export/ory-config.js.map +1 -0
  131. package/dist/migrate/export/ory.d.ts +81 -0
  132. package/dist/migrate/export/ory.js +555 -0
  133. package/dist/migrate/export/ory.js.map +1 -0
  134. package/dist/migrate/export/password-detect.d.ts +29 -0
  135. package/dist/migrate/export/password-detect.js +81 -0
  136. package/dist/migrate/export/password-detect.js.map +1 -0
  137. package/dist/migrate/export/pingone.d.ts +36 -0
  138. package/dist/migrate/export/pingone.js +218 -0
  139. package/dist/migrate/export/pingone.js.map +1 -0
  140. package/dist/migrate/export/pocketbase-config.d.ts +28 -0
  141. package/dist/migrate/export/pocketbase-config.js +180 -0
  142. package/dist/migrate/export/pocketbase-config.js.map +1 -0
  143. package/dist/migrate/export/pocketbase.d.ts +52 -0
  144. package/dist/migrate/export/pocketbase.js +243 -0
  145. package/dist/migrate/export/pocketbase.js.map +1 -0
  146. package/dist/migrate/export/project-files.d.ts +15 -0
  147. package/dist/migrate/export/project-files.js +43 -0
  148. package/dist/migrate/export/project-files.js.map +1 -0
  149. package/dist/migrate/export/propelauth-config.d.ts +18 -0
  150. package/dist/migrate/export/propelauth-config.js +58 -0
  151. package/dist/migrate/export/propelauth-config.js.map +1 -0
  152. package/dist/migrate/export/propelauth-harness.test-helper.d.ts +62 -0
  153. package/dist/migrate/export/propelauth-harness.test-helper.js +109 -0
  154. package/dist/migrate/export/propelauth-harness.test-helper.js.map +1 -0
  155. package/dist/migrate/export/propelauth.d.ts +48 -0
  156. package/dist/migrate/export/propelauth.js +255 -0
  157. package/dist/migrate/export/propelauth.js.map +1 -0
  158. package/dist/migrate/export/source-lines.d.ts +17 -0
  159. package/dist/migrate/export/source-lines.js +43 -0
  160. package/dist/migrate/export/source-lines.js.map +1 -0
  161. package/dist/migrate/export/sso-metadata.d.ts +47 -0
  162. package/dist/migrate/export/sso-metadata.js +180 -0
  163. package/dist/migrate/export/sso-metadata.js.map +1 -0
  164. package/dist/migrate/export/stytch-config.d.ts +22 -0
  165. package/dist/migrate/export/stytch-config.js +102 -0
  166. package/dist/migrate/export/stytch-config.js.map +1 -0
  167. package/dist/migrate/export/stytch.d.ts +68 -0
  168. package/dist/migrate/export/stytch.js +510 -0
  169. package/dist/migrate/export/stytch.js.map +1 -0
  170. package/dist/migrate/export/supabase-config.d.ts +48 -0
  171. package/dist/migrate/export/supabase-config.js +408 -0
  172. package/dist/migrate/export/supabase-config.js.map +1 -0
  173. package/dist/migrate/export/supabase.d.ts +86 -0
  174. package/dist/migrate/export/supabase.js +524 -0
  175. package/dist/migrate/export/supabase.js.map +1 -0
  176. package/dist/migrate/export/supertokens-config.d.ts +20 -0
  177. package/dist/migrate/export/supertokens-config.js +150 -0
  178. package/dist/migrate/export/supertokens-config.js.map +1 -0
  179. package/dist/migrate/export/supertokens.d.ts +125 -0
  180. package/dist/migrate/export/supertokens.js +464 -0
  181. package/dist/migrate/export/supertokens.js.map +1 -0
  182. package/dist/migrate/export/table.d.ts +35 -0
  183. package/dist/migrate/export/table.js +248 -0
  184. package/dist/migrate/export/table.js.map +1 -0
  185. package/dist/migrate/export/userfront-config.d.ts +15 -0
  186. package/dist/migrate/export/userfront-config.js +49 -0
  187. package/dist/migrate/export/userfront-config.js.map +1 -0
  188. package/dist/migrate/export/userfront.d.ts +38 -0
  189. package/dist/migrate/export/userfront.js +189 -0
  190. package/dist/migrate/export/userfront.js.map +1 -0
  191. package/dist/migrate/export/workos-config.d.ts +23 -0
  192. package/dist/migrate/export/workos-config.js +125 -0
  193. package/dist/migrate/export/workos-config.js.map +1 -0
  194. package/dist/migrate/export/workos.d.ts +46 -0
  195. package/dist/migrate/export/workos.js +272 -0
  196. package/dist/migrate/export/workos.js.map +1 -0
  197. package/dist/migrate/export/zitadel-config.d.ts +37 -0
  198. package/dist/migrate/export/zitadel-config.js +279 -0
  199. package/dist/migrate/export/zitadel-config.js.map +1 -0
  200. package/dist/migrate/export/zitadel.d.ts +82 -0
  201. package/dist/migrate/export/zitadel.js +447 -0
  202. package/dist/migrate/export/zitadel.js.map +1 -0
  203. package/dist/migrate/firebase/plugin.d.ts +2 -0
  204. package/dist/migrate/firebase/plugin.js +152 -0
  205. package/dist/migrate/firebase/plugin.js.map +1 -0
  206. package/dist/migrate/framework/builtins.js +35 -6
  207. package/dist/migrate/framework/builtins.js.map +1 -1
  208. package/dist/migrate/framework/orchestrator.js +3 -2
  209. package/dist/migrate/framework/orchestrator.js.map +1 -1
  210. package/dist/migrate/framework/plugin.d.ts +2 -0
  211. package/dist/migrate/frontegg/plugin.d.ts +2 -0
  212. package/dist/migrate/frontegg/plugin.js +78 -0
  213. package/dist/migrate/frontegg/plugin.js.map +1 -0
  214. package/dist/migrate/fusionauth/plugin.d.ts +2 -0
  215. package/dist/migrate/fusionauth/plugin.js +109 -0
  216. package/dist/migrate/fusionauth/plugin.js.map +1 -0
  217. package/dist/migrate/hanko/plugin.d.ts +2 -0
  218. package/dist/migrate/hanko/plugin.js +100 -0
  219. package/dist/migrate/hanko/plugin.js.map +1 -0
  220. package/dist/migrate/keycloak/plugin.d.ts +2 -0
  221. package/dist/migrate/keycloak/plugin.js +148 -0
  222. package/dist/migrate/keycloak/plugin.js.map +1 -0
  223. package/dist/migrate/ldap/plugin.d.ts +2 -0
  224. package/dist/migrate/ldap/plugin.js +73 -0
  225. package/dist/migrate/ldap/plugin.js.map +1 -0
  226. package/dist/migrate/logto/plugin.d.ts +2 -0
  227. package/dist/migrate/logto/plugin.js +131 -0
  228. package/dist/migrate/logto/plugin.js.map +1 -0
  229. package/dist/migrate/magic/plugin.d.ts +2 -0
  230. package/dist/migrate/magic/plugin.js +56 -0
  231. package/dist/migrate/magic/plugin.js.map +1 -0
  232. package/dist/migrate/nhost/plugin.d.ts +2 -0
  233. package/dist/migrate/nhost/plugin.js +115 -0
  234. package/dist/migrate/nhost/plugin.js.map +1 -0
  235. package/dist/migrate/oidc/plugin.d.ts +2 -0
  236. package/dist/migrate/oidc/plugin.js +73 -0
  237. package/dist/migrate/oidc/plugin.js.map +1 -0
  238. package/dist/migrate/onelogin/plugin.d.ts +2 -0
  239. package/dist/migrate/onelogin/plugin.js +61 -0
  240. package/dist/migrate/onelogin/plugin.js.map +1 -0
  241. package/dist/migrate/ory/plugin.d.ts +2 -0
  242. package/dist/migrate/ory/plugin.js +186 -0
  243. package/dist/migrate/ory/plugin.js.map +1 -0
  244. package/dist/migrate/ping-identity/plugin.d.ts +2 -0
  245. package/dist/migrate/ping-identity/plugin.js +100 -0
  246. package/dist/migrate/ping-identity/plugin.js.map +1 -0
  247. package/dist/migrate/pocketbase/plugin.d.ts +2 -0
  248. package/dist/migrate/pocketbase/plugin.js +99 -0
  249. package/dist/migrate/pocketbase/plugin.js.map +1 -0
  250. package/dist/migrate/propelauth/plugin.d.ts +2 -0
  251. package/dist/migrate/propelauth/plugin.js +65 -0
  252. package/dist/migrate/propelauth/plugin.js.map +1 -0
  253. package/dist/migrate/saml/plugin.d.ts +2 -0
  254. package/dist/migrate/saml/plugin.js +79 -0
  255. package/dist/migrate/saml/plugin.js.map +1 -0
  256. package/dist/migrate/stytch/plugin.d.ts +2 -0
  257. package/dist/migrate/stytch/plugin.js +97 -0
  258. package/dist/migrate/stytch/plugin.js.map +1 -0
  259. package/dist/migrate/supabase/plugin.d.ts +2 -0
  260. package/dist/migrate/supabase/plugin.js +149 -0
  261. package/dist/migrate/supabase/plugin.js.map +1 -0
  262. package/dist/migrate/supertokens/plugin.d.ts +2 -0
  263. package/dist/migrate/supertokens/plugin.js +114 -0
  264. package/dist/migrate/supertokens/plugin.js.map +1 -0
  265. package/dist/migrate/user-table/plugin.d.ts +2 -0
  266. package/dist/migrate/user-table/plugin.js +62 -0
  267. package/dist/migrate/user-table/plugin.js.map +1 -0
  268. package/dist/migrate/userfront/plugin.d.ts +2 -0
  269. package/dist/migrate/userfront/plugin.js +60 -0
  270. package/dist/migrate/userfront/plugin.js.map +1 -0
  271. package/dist/migrate/workos/plugin.d.ts +2 -0
  272. package/dist/migrate/workos/plugin.js +81 -0
  273. package/dist/migrate/workos/plugin.js.map +1 -0
  274. package/dist/migrate/zitadel/plugin.d.ts +2 -0
  275. package/dist/migrate/zitadel/plugin.js +114 -0
  276. package/dist/migrate/zitadel/plugin.js.map +1 -0
  277. package/dist/run.js +6 -0
  278. package/dist/run.js.map +1 -1
  279. package/github-action/fga-test/action.yml +43 -0
  280. package/package.json +9 -6
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.propelauthPlugin = void 0;
4
+ const propelauth_1 = require("../export/propelauth");
5
+ const propelauth_config_1 = require("../export/propelauth-config");
6
+ const plugin_kit_1 = require("../export/plugin-kit");
7
+ /**
8
+ * `atlas migrate propelauth` — users, organizations, roles and pending
9
+ * invitations through PropelAuth's backend API (auth URL + API key, on this
10
+ * machine), password hashes from the export PropelAuth support provides when
11
+ * the owner has it, and the `propelauth` bridge preset (RS256 access tokens
12
+ * verified with the project's verifier key). PropelAuth has no password-verify
13
+ * API, so there is no lazy-migration preset.
14
+ */
15
+ const AUTH_URL = { flag: '--propelauth-auth-url', env: 'PROPELAUTH_AUTH_URL', label: 'your PropelAuth auth URL (https://123456.propelauthtest.com)', required: true };
16
+ const API_KEY = { flag: '--propelauth-api-key', env: 'PROPELAUTH_API_KEY', label: 'a PropelAuth backend API key', required: true, secret: true };
17
+ const HASHES_FILE = { flag: '--propelauth-hashes-file', env: 'PROPELAUTH_HASHES_FILE', label: 'the password-hash export from PropelAuth support', required: false };
18
+ /** The auth URL from the flag or env, else the one the app already uses (`NEXT_PUBLIC_AUTH_URL`). */
19
+ function authUrl(p) {
20
+ const raw = p.credential({ ...AUTH_URL, required: false }) ?? (p.ctx.env.NEXT_PUBLIC_AUTH_URL?.trim() || (0, plugin_kit_1.need)(p, AUTH_URL));
21
+ return (0, propelauth_1.normalizeAuthUrl)(raw);
22
+ }
23
+ exports.propelauthPlugin = {
24
+ vendor: 'propelauth',
25
+ source: 'propelauth',
26
+ label: 'PropelAuth',
27
+ help: 'Move a PropelAuth project: users with their verified emails, usernames and metadata, organizations with members, roles and permissions, pending invitations, password hashes from the export PropelAuth support provides, a zero-logout bridge for PropelAuth access tokens, and the code. Your API key stays on this machine.',
28
+ config: {
29
+ reads: 'your PropelAuth project via the backend API (role mappings, organizations with SAML)',
30
+ credentials: [AUTH_URL, API_KEY],
31
+ async translate(p) {
32
+ const url = authUrl(p);
33
+ const http = (0, propelauth_1.propelauthHttp)({ authUrl: url, apiKey: (0, plugin_kit_1.need)(p, API_KEY), fetchImpl: p.fetch });
34
+ return (0, propelauth_config_1.translatePropelauthConfig)(await (0, plugin_kit_1.vendorStep)('PropelAuth', () => (0, propelauth_config_1.fetchPropelauthConfig)(http, url)));
35
+ },
36
+ },
37
+ export: {
38
+ reads: 'the PropelAuth backend API (users, organizations, invitations) and the support hash export (--propelauth-hashes-file)',
39
+ credentials: [AUTH_URL, API_KEY, HASHES_FILE],
40
+ limits: [
41
+ 'PropelAuth has no password-verify API and does not return hashes: PropelAuth support can export them on request. Pass that file with --propelauth-hashes-file; without it members set a password again on first sign-in.',
42
+ 'TOTP secrets, social-account ids and end-user API key secrets cannot be exported: members enrol their second factor again, relink social accounts by verified email and reissue API keys.',
43
+ 'SAML connections cannot be read back (the IdP settings are write-only): set each one up again in Atlas.',
44
+ 'Sessions are not exported: PropelAuth access tokens are exchanged by the propelauth bridge preset, which needs your project\'s verifier key.',
45
+ ],
46
+ async run(p, writer, resume) {
47
+ const set = await (0, plugin_kit_1.vendorStep)('PropelAuth', () => (0, propelauth_1.exportPropelauth)({
48
+ authUrl: authUrl(p),
49
+ apiKey: (0, plugin_kit_1.need)(p, API_KEY),
50
+ hashesText: (0, plugin_kit_1.localFile)(p, HASHES_FILE, 'text'),
51
+ fetchImpl: p.fetch,
52
+ onProgress: (m) => p.say(` reading ${m}`),
53
+ }));
54
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
55
+ },
56
+ },
57
+ bridge: {
58
+ preset: 'propelauth',
59
+ vars(p, t) {
60
+ return { ...t?.bridge?.vars, auth_url: t?.bridge?.vars.auth_url ?? authUrl(p) };
61
+ },
62
+ },
63
+ codemod: 'propelauth',
64
+ };
65
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/propelauth/plugin.ts"],"names":[],"mappings":";;;AAAA,qDAA0F;AAC1F,mEAA+F;AAE/F,qDAAmF;AAEnF;;;;;;;GAOG;AAEH,MAAM,QAAQ,GAAmB,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,8DAA8D,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACtL,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACjK,MAAM,WAAW,GAAmB,EA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AAC;QAC7C,MAAM,EAAE;YACN,0NAA0N;YAC1N,2LAA2L;YAC3L,yGAAyG;YACzG,8IAA8I;SAC/I;QACD,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM;YACzB,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAU,EAAC,YAAY,EAAE,GAAG,EAAE,CAC9C,IAAA,6BAAgB,EAAC;gBACf,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;gBACnB,MAAM,EAAE,IAAA,iBAAI,EAAC,CAAC,EAAE,OAAO,CAAC;gBACxB,UAAU,EAAE,IAAA,sBAAS,EAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC;gBAC7C,SAAS,EAAE,CAAC,CAAC,KAAK;gBAClB,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;aAC3C,CAAC,CACH,CAAC;YACF,MAAM,IAAA,2BAAc,EAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACnD,CAAC;KACF;IACD,MAAM,EAAE;QACN,MAAM,EAAE,YAAY;QACpB,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,CAAC;KACF;IACD,OAAO,EAAE,YAAY;CACtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { MigrationPlugin } from '../framework/plugin';
2
+ export declare const samlPlugin: MigrationPlugin;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.samlPlugin = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const errors_1 = require("../../errors");
6
+ const plugin_kit_1 = require("../export/plugin-kit");
7
+ const sso_metadata_1 = require("../export/sso-metadata");
8
+ const translate_kit_1 = require("../export/translate-kit");
9
+ /**
10
+ * `atlas migrate saml export --set saml-metadata=<file or https URL>` — any
11
+ * SAML 2.0 identity provider (Ping, OneLogin, Okta, ADFS, Entra, Shibboleth,
12
+ * Keycloak …) from its metadata: an Atlas SSO connection with the IdP's
13
+ * entity id, sign-on URL and signing certificate. The users stay in the IdP:
14
+ * they sign in through it, now via Atlas, and relink on their verified email.
15
+ */
16
+ const METADATA = { flag: 'saml-metadata', env: 'SAML_METADATA', label: 'the IdP metadata: a file, or an https:// URL', required: true };
17
+ const DOMAINS = { flag: 'saml-domains', env: 'SAML_DOMAINS', label: 'email domains that sign in through this IdP (comma separated)', required: false };
18
+ const NAME = { flag: 'saml-name', env: 'SAML_CONNECTION_NAME', label: 'a name for the connection', required: false };
19
+ const ORG = { flag: 'saml-organization', env: 'SAML_ORGANIZATION', label: 'create the connection inside an organization with this name', required: false };
20
+ async function metadata(p) {
21
+ const src = p.credential({ ...METADATA, required: true });
22
+ if (/^https:\/\//i.test(src)) {
23
+ const res = await p.fetch(src, { headers: { accept: 'application/samlmetadata+xml, application/xml, text/xml' }, redirect: 'error' });
24
+ if (res.status !== 200)
25
+ throw new errors_1.CliError(`${src} answered ${res.status}.`);
26
+ return { xml: await res.text(), url: src };
27
+ }
28
+ if (/^http:\/\//i.test(src))
29
+ throw new errors_1.CliError('The metadata URL must be https://.');
30
+ return { xml: p.ctx.readFile((0, node_path_1.resolve)(src)) };
31
+ }
32
+ function build(p, xml, url) {
33
+ const domains = (p.credential(DOMAINS) ?? '').split(',').map((d) => d.trim().toLowerCase()).filter(Boolean);
34
+ try {
35
+ return (0, sso_metadata_1.samlConnections)(xml, { name: p.credential(NAME), domains: domains.length ? domains : undefined, metadataUrl: url });
36
+ }
37
+ catch (err) {
38
+ throw new errors_1.CliError(err.message);
39
+ }
40
+ }
41
+ exports.samlPlugin = {
42
+ vendor: 'saml',
43
+ source: 'saml',
44
+ label: 'Any SAML identity provider',
45
+ help: 'Move a SAML single sign-on connection: read the IdP metadata (--set saml-metadata=<file or URL>) and create the Atlas SSO connection from it (entity id, sign-on URL, signing certificate, email domains). Afterwards give the IdP Atlas\'s entity id and ACS URL and switch the application to Atlas. The IdP\'s users are not exportable over SAML: they relink on their verified email at first sign-in.',
46
+ config: {
47
+ reads: 'the IdP metadata document',
48
+ credentials: [METADATA, DOMAINS, NAME],
49
+ async translate(p) {
50
+ const { xml, url } = await metadata(p);
51
+ const { connections, warnings } = build(p, xml, url);
52
+ const b = new translate_kit_1.ConfigBuilder();
53
+ for (const c of connections) {
54
+ b.add('mapped', 'saml', `${c.saml?.idp_entity_id}`, 'Becomes an Atlas SSO connection (atlas migrate saml export + import). Give the IdP Atlas\'s entity id and ACS URL, shown after the import.', 'sso_connections');
55
+ if (!c.domains?.length)
56
+ b.add('manual', 'saml', `${c.saml?.idp_entity_id} domains`, 'Name the email domains that sign in through this IdP (--set saml-domains=…) so Atlas routes them to it.', 'sso_connections');
57
+ }
58
+ for (const w of warnings)
59
+ b.add('differs', 'saml', 'metadata', w);
60
+ return b.result(`SAML metadata ${url ?? ''}`.trim());
61
+ },
62
+ },
63
+ export: {
64
+ reads: 'the IdP metadata document (--set saml-metadata=<file or https URL>)',
65
+ credentials: [METADATA, DOMAINS, NAME, ORG],
66
+ limits: ['A SAML identity provider exposes no user list: users sign in through it and link to Atlas accounts on their verified email.'],
67
+ async run(p, writer, resume) {
68
+ const { xml, url } = await metadata(p);
69
+ const { connections, warnings } = build(p, xml, url);
70
+ const org = p.credential(ORG);
71
+ const set = (0, sso_metadata_1.connectionSet)(connections, `SAML metadata ${url ?? ''}`.trim(), org ? { id: org.toLowerCase().replace(/[^a-z0-9]+/g, '-'), name: org } : undefined);
72
+ for (const w of warnings)
73
+ set.warn(w);
74
+ p.say(` ${connections.length} identity provider(s) in the metadata`);
75
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
76
+ },
77
+ },
78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QAAQ,CAAC,CAAC,CAAC,CAAC;YACvC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACrD,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC9B,MAAM,GAAG,GAAG,IAAA,4BAAa,EAAC,WAAW,EAAE,iBAAiB,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAChK,KAAK,MAAM,CAAC,IAAI,QAAQ;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtC,CAAC,CAAC,GAAG,CAAC,KAAK,WAAW,CAAC,MAAM,uCAAuC,CAAC,CAAC;YACtE,MAAM,IAAA,2BAAc,EAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;QACnD,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { MigrationPlugin } from '../framework/plugin';
2
+ export declare const stytchPlugin: MigrationPlugin;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stytchPlugin = void 0;
4
+ const stytch_1 = require("../export/stytch");
5
+ const stytch_config_1 = require("../export/stytch-config");
6
+ const plugin_kit_1 = require("../export/plugin-kit");
7
+ /**
8
+ * `atlas migrate stytch` — a Stytch project (consumer or B2B) through the
9
+ * Stytch API with the project id and secret (on this machine): users with
10
+ * verified emails and phones, OAuth identities, organizations, members, roles
11
+ * and SSO connections as data, RBAC as Atlas config; password hashes from the
12
+ * export Stytch support provides; the `stytch` bridge preset (session JWTs
13
+ * verified against the project's JWKS) and lazy migration through Stytch's
14
+ * password authentication.
15
+ */
16
+ const PROJECT_ID = { flag: '--stytch-project-id', env: 'STYTCH_PROJECT_ID', label: 'your Stytch project id (project-live-…)', required: true };
17
+ const SECRET = { flag: '--stytch-secret', env: 'STYTCH_SECRET', label: 'your Stytch project secret', required: true, secret: true };
18
+ const HASHES = { flag: '--stytch-hashes', env: 'STYTCH_HASHES_FILE', label: 'the password-hash export from Stytch support', required: false };
19
+ const PRODUCT = { flag: '--stytch-product', env: 'STYTCH_PRODUCT', label: 'consumer or b2b (detected when omitted)', required: false };
20
+ const BASE_URL = { flag: '--stytch-base-url', env: 'STYTCH_BASE_URL', label: 'the Stytch API base URL (custom domain)', required: false };
21
+ function baseUrl(p) {
22
+ return p.credential(BASE_URL)?.replace(/\/+$/, '');
23
+ }
24
+ function productOpt(p) {
25
+ const v = p.credential(PRODUCT)?.trim().toLowerCase();
26
+ if (v === undefined || v === '')
27
+ return undefined;
28
+ if (v !== 'consumer' && v !== 'b2b')
29
+ throw new Error(`${PRODUCT.flag} must be "consumer" or "b2b"`);
30
+ return v;
31
+ }
32
+ function http(p) {
33
+ return (0, stytch_1.stytchHttp)({ projectId: (0, plugin_kit_1.need)(p, PROJECT_ID), secret: (0, plugin_kit_1.need)(p, SECRET), baseUrl: baseUrl(p), fetchImpl: p.fetch });
34
+ }
35
+ exports.stytchPlugin = {
36
+ vendor: 'stytch',
37
+ source: 'stytch',
38
+ label: 'Stytch',
39
+ help: 'Move a Stytch project (consumer or B2B): users with verified emails and phones and OAuth identities, organizations with members, roles and SSO connections, RBAC as Atlas config, password hashes from the export Stytch support provides, a zero-logout bridge for Stytch session JWTs, lazy migration through Stytch password authentication, and the code. Your project secret stays on this machine.',
40
+ config: {
41
+ reads: 'your Stytch project via the API (RBAC policy, organizations, SSO connections)',
42
+ credentials: [PROJECT_ID, SECRET, PRODUCT, BASE_URL],
43
+ async translate(p) {
44
+ const projectId = (0, plugin_kit_1.need)(p, PROJECT_ID);
45
+ const client = http(p);
46
+ const snap = await (0, plugin_kit_1.vendorStep)('Stytch', async () => (0, stytch_config_1.fetchStytchConfig)(client, projectId, productOpt(p) ?? (await (0, stytch_1.detectStytchProduct)(client))));
47
+ return (0, stytch_config_1.translateStytchConfig)(snap);
48
+ },
49
+ },
50
+ export: {
51
+ reads: 'the Stytch API (users, or organizations, members and SSO connections, plus the RBAC policy) and, if you have one, the support hash export (--stytch-hashes)',
52
+ credentials: [PROJECT_ID, SECRET, HASHES, PRODUCT, BASE_URL],
53
+ limits: [
54
+ 'Stytch only provides password hashes through support (support@stytch.com): pass that file with --stytch-hashes; otherwise passwords move by lazy migration (checked against Stytch on each user\'s first sign-in).',
55
+ 'TOTP secrets, passkeys (WebAuthn) and crypto wallets are not exportable: users enrol again.',
56
+ 'SCIM bearer tokens and OIDC client secrets are not returned: recreate those connections in Atlas.',
57
+ 'Sessions are not exported: Stytch session JWTs are exchanged by the stytch bridge preset.',
58
+ ],
59
+ async run(p, writer, resume) {
60
+ const set = await (0, plugin_kit_1.vendorStep)('Stytch', () => (0, stytch_1.exportStytch)({
61
+ projectId: (0, plugin_kit_1.need)(p, PROJECT_ID),
62
+ secret: (0, plugin_kit_1.need)(p, SECRET),
63
+ product: productOpt(p),
64
+ baseUrl: baseUrl(p),
65
+ hashesText: (0, plugin_kit_1.localFile)(p, HASHES, 'text'),
66
+ fetchImpl: p.fetch,
67
+ onProgress: (m) => p.say(` reading ${m}`),
68
+ }));
69
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
70
+ },
71
+ },
72
+ bridge: {
73
+ preset: 'stytch',
74
+ vars(p, t) {
75
+ if (t?.bridge)
76
+ return t.bridge.vars;
77
+ const projectId = (0, plugin_kit_1.need)(p, PROJECT_ID);
78
+ return {
79
+ project_id: projectId,
80
+ ...(projectId.startsWith('project-test-') ? { api_host: 'test.stytch.com' } : {}),
81
+ ...(productOpt(p) === 'b2b' ? { jwks_path: 'b2b/sessions' } : {}),
82
+ };
83
+ },
84
+ },
85
+ lazy: {
86
+ preset: 'stytch',
87
+ config(p, t) {
88
+ if (t?.lazy)
89
+ return t.lazy.config;
90
+ const product = productOpt(p);
91
+ return { project_id: (0, plugin_kit_1.need)(p, PROJECT_ID), ...(product ? { product } : {}) };
92
+ },
93
+ secret: SECRET,
94
+ },
95
+ codemod: 'stytch',
96
+ };
97
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/stytch/plugin.ts"],"names":[],"mappings":";;;AAAA,6CAAqG;AACrG,2DAAmF;AAEnF,qDAAmF;AAEnF;;;;;;;;GAQG;AAEH,MAAM,UAAU,GAAmB,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,yCAAyC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/J,MAAM,MAAM,GAAmB,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACpJ,MAAM,MAAM,GAAmB,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,8CAA8C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC9J,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,yCAAyC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACvJ,MAAM,QAAQ,GAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,yCAAyC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAE1J,SAAS,OAAO,CAAC,CAAgB;IAC/B,OAAO,CAAC,CAAC,UAAU,CAAC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AAI,CAAC,EAAE,MAAM;gBAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;YACpC,MAAM,SAAS,GAAG,IAAA,iBAAI,EAAC,CAAC,EAAE,UAAU,CAAC,CAAC;YACtC,OAAO;gBACL,UAAU,EAAE,SAAS;gBACrB,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjF,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAClE,CAAC;QACJ,CAAC;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,QAAQ;QAChB,MAAM,CAAC,CAAC,EAAE,CAAC;YACT,IAAI,CAAC,EAAE,IAAI;gBAAE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;YAClC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO,EAAE,UAAU,EAAE,IAAA,iBAAI,EAAC,CAAC,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9E,CAAC;QACD,MAAM,EAAE,MAAM;KACf;IACD,OAAO,EAAE,QAAQ;CAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { MigrationPlugin } from '../framework/plugin';
2
+ export declare const supabasePlugin: MigrationPlugin;
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supabasePlugin = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const supabase_1 = require("../export/supabase");
6
+ const supabase_config_1 = require("../export/supabase-config");
7
+ const errors_1 = require("../../errors");
8
+ const plugin_kit_1 = require("../export/plugin-kit");
9
+ /**
10
+ * `atlas migrate supabase` — Supabase Auth, hosted or self-hosted: its
11
+ * `config.toml` (or the hosted project's settings through the Management
12
+ * API) as Atlas config; users with their bcrypt / argon2 / Firebase-scrypt
13
+ * hashes, identities, SAML connections, TOTP secrets, phone and WebAuthn
14
+ * factors, recovery-code hashes and live sessions from a dump of the auth
15
+ * schema made on this machine; the `supabase` bridge preset (a Supabase
16
+ * access token becomes an Atlas session); lazy migration when only the Admin
17
+ * API is available; and the code. Nothing here connects to the database.
18
+ */
19
+ const PROJECT_URL = { flag: '--supabase-url', env: 'SUPABASE_URL', label: 'your project URL (https://<ref>.supabase.co)', required: false };
20
+ const DUMP = { flag: '--supabase-dump', env: 'SUPABASE_DUMP_DIR', label: 'a folder of auth-schema table dumps (users.csv, identities.csv, …)', required: false };
21
+ const SERVICE_ROLE = { flag: '--supabase-service-role-key', env: 'SUPABASE_SERVICE_ROLE_KEY', label: 'the service_role / secret key (Admin API export only)', required: false, secret: true };
22
+ const CONFIG_FILE = { flag: '--supabase-config', env: 'SUPABASE_CONFIG_TOML', label: 'supabase/config.toml', required: false };
23
+ const ACCESS_TOKEN = { flag: '--supabase-access-token', env: 'SUPABASE_ACCESS_TOKEN', label: 'a personal access token (Management API)', required: false, secret: true };
24
+ const PROJECT_REF = { flag: '--supabase-project-ref', env: 'SUPABASE_PROJECT_REF', label: 'the project ref (the subdomain of <ref>.supabase.co)', required: false };
25
+ const ANONYMOUS = { flag: '--supabase-anonymous', env: 'SUPABASE_ANONYMOUS', label: '"include" to export anonymous users too', required: false };
26
+ const ANON_KEY = { flag: '--supabase-anon-key', env: 'SUPABASE_ANON_KEY', label: 'the anon / publishable key, for lazy migration', required: false };
27
+ const DB_KEYS = { flag: '--supabase-db-encryption-keys', env: 'GOTRUE_SECURITY_DB_ENCRYPTION_KEYS', label: 'GoTrue column-encryption keys, comma-separated key_id:key (only when GOTRUE_SECURITY_DB_ENCRYPTION_ENCRYPT is on)', required: false, secret: true };
28
+ const BRIDGE = { flag: '--supabase-bridge', env: 'SUPABASE_BRIDGE', label: 'what the bridge exchanges: access-token (default; up to a week past expiry) or refresh-token (the sessions the dump imported)', required: false };
29
+ const AUTH_URL = { flag: '--supabase-auth-url', env: 'SUPABASE_AUTH_URL', label: 'self-hosted or custom domain: the Auth URL (https://db.example.com/auth/v1)', required: false };
30
+ const COOKIE_NAME = { flag: '--supabase-cookie-name', env: 'SUPABASE_COOKIE_NAME', label: 'self-hosted: the SSR cookie name (sb-<first label of the host>-auth-token)', required: false };
31
+ const RP_ID = { flag: '--rp-id', env: 'ATLAS_MIGRATE_RP_ID', label: 'the WebAuthn relying party id passkeys were registered for', required: false };
32
+ /** The project ref, from the flag or a hosted URL. */
33
+ function refOf(p) {
34
+ const ref = p.credential(PROJECT_REF);
35
+ if (ref)
36
+ return ref.trim();
37
+ const url = p.credential(PROJECT_URL);
38
+ return url ? /^https:\/\/([a-z0-9]+)\.supabase\.co\/?$/.exec(url.trim())?.[1] : undefined;
39
+ }
40
+ /**
41
+ * `supabase` (hosted access tokens), `supabase_self_hosted` (an Auth URL of
42
+ * your own) or `supabase_refresh_token` (refresh tokens among the sessions the
43
+ * dump imported; hosted cookie names).
44
+ */
45
+ function bridgePreset(p) {
46
+ const mode = (p.credential(BRIDGE) ?? 'access-token').trim().toLowerCase();
47
+ if (mode === 'refresh-token') {
48
+ if (p.credential(AUTH_URL))
49
+ throw new errors_1.CliError('Supabase: --set supabase-bridge=refresh-token reads the hosted cookie (sb-<ref>-auth-token); for a self-hosted project use the access-token bridge, or set the preset and cookie name through the bridge API.');
50
+ return 'supabase_refresh_token';
51
+ }
52
+ if (mode !== 'access-token')
53
+ throw new errors_1.CliError(`Supabase: --set supabase-bridge takes access-token or refresh-token (got ${mode}).`);
54
+ return p.credential(AUTH_URL) ? 'supabase_self_hosted' : 'supabase';
55
+ }
56
+ exports.supabasePlugin = {
57
+ vendor: 'supabase',
58
+ source: 'supabase',
59
+ label: 'Supabase Auth',
60
+ help: 'Move Supabase Auth (hosted or self-hosted): config.toml or the hosted project settings as Atlas config; users with their password hashes, social and SAML identities, TOTP secrets, phone and WebAuthn factors and live sessions from a dump of the auth schema you make with psql; a zero-logout bridge for Supabase access tokens; lazy migration when you only have the Admin API; and the code. Database access stays on this machine.',
61
+ config: {
62
+ reads: 'supabase/config.toml (or the hosted project through the Management API)',
63
+ credentials: [CONFIG_FILE, ACCESS_TOKEN, PROJECT_REF, PROJECT_URL],
64
+ async translate(p) {
65
+ const token = p.credential(ACCESS_TOKEN);
66
+ const ref = refOf(p);
67
+ if (token && ref) {
68
+ return (0, supabase_config_1.translateSupabaseConfig)(await (0, plugin_kit_1.vendorStep)('Supabase', () => (0, supabase_config_1.fetchSupabaseAuthConfig)({ projectRef: ref, accessToken: token, fetchImpl: p.fetch })));
69
+ }
70
+ const path = p.credential(CONFIG_FILE) ?? `${p.project}/supabase/config.toml`;
71
+ let text;
72
+ try {
73
+ text = p.ctx.readFile((0, node_path_1.resolve)(path));
74
+ }
75
+ catch {
76
+ throw new errors_1.CliError(`Supabase: no config.toml at ${path}. Pass --set supabase-config=<path>, or a personal access token and project ref to read the hosted project.`);
77
+ }
78
+ const settings = (0, supabase_config_1.settingsFromToml)(text, path);
79
+ return (0, supabase_config_1.translateSupabaseConfig)(ref ? { ...settings, projectRef: ref } : settings);
80
+ },
81
+ },
82
+ export: {
83
+ reads: 'a dump of the auth schema (psql \\copy of auth.users, identities, mfa_factors, sessions, refresh_tokens, sso_*, webauthn_credentials) or the Admin API',
84
+ credentials: [DUMP, PROJECT_URL, SERVICE_ROLE, ANONYMOUS, RP_ID, DB_KEYS],
85
+ limits: [
86
+ 'Password hashes, TOTP secrets and sessions live only in the database: dump the auth schema (see the guide). The Admin API export has none of them, and passwords then move by lazy migration.',
87
+ 'Values encrypted with GoTrue column encryption (GOTRUE_SECURITY_DB_ENCRYPTION_*) are decrypted on this machine with --set supabase-db-encryption-keys=<key_id>:<key>; without the keys those passwords move by lazy migration and those TOTP users enrol again.',
88
+ 'Recovery codes move as their argon2id hashes; passkeys and WebAuthn factors only with --rp-id and when Atlas serves sign-in on that domain.',
89
+ 'Refresh tokens in the newer signed format (no auth.refresh_tokens row) cannot be exported; the supabase bridge still exchanges the access token.',
90
+ ],
91
+ async run(p, writer, resume) {
92
+ const dump = p.credential(DUMP);
93
+ const url = p.credential(PROJECT_URL);
94
+ const key = dump ? undefined : p.credential(SERVICE_ROLE);
95
+ if (!dump && !(url && key)) {
96
+ throw new errors_1.CliError('Supabase: pass a folder of auth-schema dumps (--set supabase-dump=<folder>), or the project URL and service_role key for an Admin API export without password hashes.');
97
+ }
98
+ const set = await (0, plugin_kit_1.vendorStep)('Supabase', () => (0, supabase_1.exportSupabase)({
99
+ dumpDir: dump ? (0, node_path_1.resolve)(dump) : undefined,
100
+ url,
101
+ serviceRoleKey: key,
102
+ rpId: p.credential(RP_ID),
103
+ includeAnonymous: p.credential(ANONYMOUS) === 'include',
104
+ dbEncryptionKeys: p.credential(DB_KEYS)?.split(',').map((k) => k.trim()).filter(Boolean),
105
+ fetchImpl: p.fetch,
106
+ onProgress: (m) => p.say(` reading ${m}`),
107
+ }));
108
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
109
+ },
110
+ },
111
+ bridge: {
112
+ preset: 'supabase',
113
+ presetFor: bridgePreset,
114
+ vars(p, t) {
115
+ const vars = { ...t?.bridge?.vars };
116
+ const preset = bridgePreset(p);
117
+ if (preset === 'supabase_self_hosted') {
118
+ const authUrl = p.credential(AUTH_URL).trim().replace(/\/+$/, '');
119
+ delete vars.project_ref;
120
+ vars.auth_url = authUrl;
121
+ const host = /^https?:\/\/([^/:]+)/i.exec(authUrl)?.[1];
122
+ if (!host)
123
+ throw new errors_1.CliError(`Supabase: --set supabase-auth-url must be an https URL ending in /auth/v1 (got ${authUrl}).`);
124
+ // @supabase/ssr names the cookie after the first label of the project host.
125
+ vars.cookie_name = p.credential(COOKIE_NAME)?.trim() ?? `sb-${host.split('.')[0]}-auth-token`;
126
+ return vars;
127
+ }
128
+ const ref = refOf(p);
129
+ if (ref)
130
+ vars.project_ref = ref;
131
+ return vars;
132
+ },
133
+ },
134
+ lazy: {
135
+ preset: 'supabase',
136
+ config(p, t) {
137
+ const config = { ...t?.lazy?.config };
138
+ const url = p.credential(PROJECT_URL);
139
+ if (url)
140
+ config.url = url.trim().replace(/\/+$/, '');
141
+ const anon = p.credential(ANON_KEY);
142
+ if (anon)
143
+ config.anon_key = anon;
144
+ return config;
145
+ },
146
+ },
147
+ codemod: 'supabase',
148
+ };
149
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/supabase/plugin.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,iDAAoD;AACpD,+DAA+G;AAC/G,yCAAwC;AAExC,qDAAkE;AAElE;;;;;;;;;GASG;AAEH,MAAM,WAAW,GAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,8CAA8C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC5J,MAAM,IAAI,GAAmB,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,oEAAoE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACjL,MAAM,YAAY,GAAmB,EAAE,IAAI,EAAE,6BAA6B,EAAE,GAAG,EAAE,2BAA2B,EAAE,KAAK,EAAE,uDAAuD,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC9M,MAAM,WAAW,GAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC/I,MAAM,YAAY,GAAmB,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,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AAE,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YAC9D,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YACtC,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACrD,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,IAAI;gBAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;YACjC,OAAO,MAAM,CAAC;QAChB,CAAC;KACF;IACD,OAAO,EAAE,UAAU;CACpB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { MigrationPlugin } from '../framework/plugin';
2
+ export declare const supertokensPlugin: MigrationPlugin;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supertokensPlugin = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const errors_1 = require("../../errors");
6
+ const tables_1 = require("../export/frameworks/tables");
7
+ const plugin_kit_1 = require("../export/plugin-kit");
8
+ const supertokens_1 = require("../export/supertokens");
9
+ const supertokens_config_1 = require("../export/supertokens-config");
10
+ /**
11
+ * `atlas migrate supertokens` — a SuperTokens core (self-hosted or the managed
12
+ * service): the core's recipes, providers and token settings as Atlas config;
13
+ * users with their linked login methods, verified emails, third-party links,
14
+ * metadata, roles and tenants through the core API with its API key (on this
15
+ * machine) or from a dump of the core database, which also carries bcrypt /
16
+ * Argon2 password hashes and TOTP secrets; the `supertokens` bridge preset (the
17
+ * session's access token verified against your backend's JWKS); lazy migration
18
+ * through the core's own sign-in; and the code.
19
+ */
20
+ const CONNECTION_URI = { flag: '--supertokens-connection-uri', env: 'SUPERTOKENS_CONNECTION_URI', label: 'the core address (https://st-dev-xxxx.aws.supertokens.io, or http://localhost:3567)', required: false };
21
+ const API_KEY = { flag: '--supertokens-api-key', env: 'SUPERTOKENS_API_KEY', label: 'the core API key', required: false, secret: true };
22
+ const DUMP = { flag: '--supertokens-dump', env: 'SUPERTOKENS_DUMP_DIR', label: 'a folder of core database table dumps (all_auth_recipe_users.csv, emailpassword_users.csv, …)', required: false };
23
+ const APP_ID = { flag: '--supertokens-app-id', env: 'SUPERTOKENS_APP_ID', label: 'the SuperTokens app id (multi-app cores; default public)', required: false };
24
+ const TENANT_ID = { flag: '--supertokens-tenant-id', env: 'SUPERTOKENS_TENANT_ID', label: 'the tenant the lazy-migration sign-in runs on (default public)', required: false };
25
+ const PREFIX = { flag: '--supertokens-table-prefix', env: 'SUPERTOKENS_TABLE_PREFIX', label: 'the core\'s table_names_prefix, when it has one', required: false };
26
+ const API_DOMAIN = { flag: '--supertokens-api-domain', env: 'SUPERTOKENS_API_DOMAIN', label: 'your backend\'s apiDomain (https://api.example.com), the issuer of your access tokens', required: false };
27
+ const API_BASE_PATH = { flag: '--supertokens-api-base-path', env: 'SUPERTOKENS_API_BASE_PATH', label: 'your backend\'s apiBasePath without slashes (default auth)', required: false };
28
+ function coreUri(p, required) {
29
+ const raw = p.credential({ ...CONNECTION_URI, required });
30
+ if (!raw)
31
+ return undefined;
32
+ try {
33
+ return (0, supertokens_1.normalizeCoreUri)(raw);
34
+ }
35
+ catch {
36
+ throw new errors_1.CliError(`SuperTokens: ${raw} is not a core address (https://host or http://host:3567).`);
37
+ }
38
+ }
39
+ exports.supertokensPlugin = {
40
+ vendor: 'supertokens',
41
+ source: 'supertokens',
42
+ label: 'SuperTokens',
43
+ help: 'Move a SuperTokens core (self-hosted or managed): its recipes, third-party providers and token settings as Atlas config; users with linked login methods, verified emails, third-party links, metadata, roles and tenants through the core API with its API key (on this machine) or from a dump of the core database, which also carries bcrypt and Argon2 password hashes and TOTP secrets; a zero-logout bridge on your access tokens; lazy migration through the core\'s own sign-in; and the code.',
44
+ config: {
45
+ reads: 'your SuperTokens core via its HTTP API',
46
+ credentials: [CONNECTION_URI, API_KEY, APP_ID],
47
+ async translate(p) {
48
+ const uri = coreUri(p, true);
49
+ const appId = p.credential(APP_ID)?.trim() || 'public';
50
+ const http = (0, supertokens_1.supertokensHttp)({ connectionUri: uri, apiKey: p.credential(API_KEY), fetchImpl: p.fetch });
51
+ return (0, supertokens_config_1.translateSupertokensConfig)(await (0, plugin_kit_1.vendorStep)('SuperTokens', () => (0, supertokens_config_1.fetchSupertokensConfig)(http, uri, appId)));
52
+ },
53
+ },
54
+ export: {
55
+ reads: 'the SuperTokens core API (API key) or a dump of the core database',
56
+ credentials: [CONNECTION_URI, API_KEY, DUMP, APP_ID, PREFIX],
57
+ limits: [
58
+ 'The core API never returns password hashes or TOTP secrets: export from the core database (--set supertokens-dump=<folder>) to carry bcrypt and Argon2 hashes and verified TOTP devices; the managed service has no database access, so those users move by lazy migration and enrol their authenticator app again.',
59
+ 'Sessions are not exported: the core keeps only a double hash of each refresh token. The bridge exchanges the access-token JWT a user still holds, verified against your backend\'s JWKS.',
60
+ 'A password hash that is not bcrypt or Argon2 (for example one imported from Firebase) cannot be verified by Atlas: those users reset their password or move by lazy migration.',
61
+ 'Tenants become organizations; a tenant\'s own enabled recipes and providers do not carry over (configure SSO connections per organization).',
62
+ 'Code in supertokens.init (override functions, custom claims, MFA requirements, email and SMS delivery) is not visible to the core: it is listed in the config report as manual.',
63
+ ],
64
+ async run(p, writer, resume) {
65
+ const dumpDir = p.credential(DUMP);
66
+ const uri = coreUri(p, false);
67
+ if (!dumpDir && !uri) {
68
+ throw new errors_1.CliError('SuperTokens: pass a core database dump (--set supertokens-dump=<folder>), or the core address with its API key (--set supertokens-connection-uri=… and SUPERTOKENS_API_KEY).');
69
+ }
70
+ const set = await (0, plugin_kit_1.vendorStep)('SuperTokens', async () => (0, supertokens_1.exportSupertokens)({
71
+ tables: dumpDir ? (0, tables_1.readDumpDir)((0, node_path_1.resolve)(dumpDir)) : undefined,
72
+ connectionUri: uri,
73
+ apiKey: p.credential(API_KEY),
74
+ appId: p.credential(APP_ID)?.trim(),
75
+ tablePrefix: p.credential(PREFIX)?.trim(),
76
+ fetchImpl: p.fetch,
77
+ onProgress: (m) => p.say(` reading ${m}`),
78
+ }));
79
+ await (0, plugin_kit_1.writeRecordSet)(set, writer, resume, p.say);
80
+ },
81
+ },
82
+ bridge: {
83
+ preset: 'supertokens',
84
+ vars(p, t) {
85
+ const vars = { ...t?.bridge?.vars };
86
+ const domain = p.credential(API_DOMAIN)?.trim();
87
+ if (domain)
88
+ vars.base_url = domain;
89
+ const basePath = p.credential(API_BASE_PATH)?.trim().replace(/^\/+|\/+$/g, '');
90
+ if (basePath)
91
+ vars.api_base_path = basePath;
92
+ return vars;
93
+ },
94
+ },
95
+ lazy: {
96
+ preset: 'supertokens',
97
+ config(p, t) {
98
+ const config = { ...t?.lazy?.config };
99
+ const uri = coreUri(p, false);
100
+ if (uri)
101
+ config.base_url = uri;
102
+ const tenant = p.credential(TENANT_ID)?.trim();
103
+ if (tenant)
104
+ config.tenant_id = tenant;
105
+ const app = p.credential(APP_ID)?.trim();
106
+ if (app)
107
+ config.app_id = app;
108
+ return config;
109
+ },
110
+ secret: API_KEY,
111
+ },
112
+ codemod: 'supertokens',
113
+ };
114
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/migrate/supertokens/plugin.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,yCAAwC;AACxC,wDAA0D;AAC1D,qDAAkE;AAClE,uDAA6F;AAC7F,qEAAkG;AAGlG;;;;;;;;;GASG;AAEH,MAAM,cAAc,GAAmB,EAAE,IAAI,EAAE,8BAA8B,EAAE,GAAG,EAAE,4BAA4B,EAAE,KAAK,EAAE,qFAAqF,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAClO,MAAM,OAAO,GAAmB,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,kBAAkB,E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