seamless-cli 0.12.1 → 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 (69) hide show
  1. package/README.md +98 -26
  2. package/dist/commands/adminShared.js +43 -0
  3. package/dist/commands/adminShared.js.map +1 -1
  4. package/dist/commands/check.js +67 -42
  5. package/dist/commands/check.js.map +1 -1
  6. package/dist/commands/config.js +7 -2
  7. package/dist/commands/config.js.map +1 -1
  8. package/dist/commands/helpTopics.js +35 -13
  9. package/dist/commands/helpTopics.js.map +1 -1
  10. package/dist/commands/init.js +71 -42
  11. package/dist/commands/init.js.map +1 -1
  12. package/dist/commands/org.js +9 -3
  13. package/dist/commands/org.js.map +1 -1
  14. package/dist/commands/sessions.js +8 -3
  15. package/dist/commands/sessions.js.map +1 -1
  16. package/dist/commands/users.js +6 -10
  17. package/dist/commands/users.js.map +1 -1
  18. package/dist/commands/verify.js +3 -2
  19. package/dist/commands/verify.js.map +1 -1
  20. package/dist/commands/whoami.js +21 -3
  21. package/dist/commands/whoami.js.map +1 -1
  22. package/dist/core/admin.js +20 -4
  23. package/dist/core/admin.js.map +1 -1
  24. package/dist/core/authClient.js +71 -5
  25. package/dist/core/authClient.js.map +1 -1
  26. package/dist/core/config.js +55 -3
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/errors.js +32 -0
  29. package/dist/core/errors.js.map +1 -0
  30. package/dist/core/fetch.js +17 -1
  31. package/dist/core/fetch.js.map +1 -1
  32. package/dist/core/images.js +9 -3
  33. package/dist/core/images.js.map +1 -1
  34. package/dist/core/interactiveLogin.js +12 -13
  35. package/dist/core/interactiveLogin.js.map +1 -1
  36. package/dist/core/jwksKid.js +40 -0
  37. package/dist/core/jwksKid.js.map +1 -0
  38. package/dist/core/keychain.js +13 -26
  39. package/dist/core/keychain.js.map +1 -1
  40. package/dist/core/loginFlow.js +39 -14
  41. package/dist/core/loginFlow.js.map +1 -1
  42. package/dist/core/output.js +9 -29
  43. package/dist/core/output.js.map +1 -1
  44. package/dist/core/redact.js +68 -0
  45. package/dist/core/redact.js.map +1 -0
  46. package/dist/core/secrets.js +0 -3
  47. package/dist/core/secrets.js.map +1 -1
  48. package/dist/core/systemConfig.js +39 -4
  49. package/dist/core/systemConfig.js.map +1 -1
  50. package/dist/core/templates.js +6 -4
  51. package/dist/core/templates.js.map +1 -1
  52. package/dist/generators/admin/admin.js +102 -1
  53. package/dist/generators/admin/admin.js.map +1 -1
  54. package/dist/generators/auth/auth.js +2 -59
  55. package/dist/generators/auth/auth.js.map +1 -1
  56. package/dist/generators/docker/docker.js +0 -20
  57. package/dist/generators/docker/docker.js.map +1 -1
  58. package/dist/index.js +4 -3
  59. package/dist/index.js.map +1 -1
  60. package/dist/prompts/projectSetup.js +1 -12
  61. package/dist/prompts/projectSetup.js.map +1 -1
  62. package/package.json +2 -2
  63. package/verify/adapter-app/package.json +1 -1
  64. package/verify/adapter-fastify-app/package.json +1 -1
  65. package/verify/docker-compose.verify.yml +22 -20
  66. package/dist/core/jwks.js +0 -19
  67. package/dist/core/jwks.js.map +0 -1
  68. package/dist/utils/writeEnv.js +0 -9
  69. package/dist/utils/writeEnv.js.map +0 -1
@@ -1,15 +1,19 @@
1
1
  # Conformance stack for `seamless verify`.
2
- # Brings up Postgres + the auth API + the Express adapter from local source
3
- # (paths supplied by the verify command via env) so the Playwright harness can
4
- # drive every auth flow. NODE_ENV=test enables the API's external-delivery seam
5
- # so OTP / magic-link tokens are returned in responses (no real email/SMS).
6
2
  #
7
- # Required env (the `seamless verify` command writes these into .env.verify):
8
- # SEAMLESS_API_DIR absolute path to seamless-auth-api source
9
- # SEAMLESS_ADAPTER_DIR absolute path to the express adapter source
10
- # API_SERVICE_TOKEN shared secret between API and adapter
11
- # JWKS_KID key id the adapter expects (must match the API's active kid)
12
- # OWNER_EMAIL tenant owner; this email gets the admin role at signup
3
+ # Postgres, the auth API built from local source, and two adopter backends that are
4
+ # deliberate twins (Express on 3000, Fastify on 3001) so a failure is attributable to
5
+ # one framework. The web starter is behind the `react` profile, since the api and
6
+ # adapter layers need no browser.
7
+ #
8
+ # Env comes from the `seamless verify` process, not a file:
9
+ # SEAMLESS_API_DIR absolute path to the seamless-auth-api source (build context)
10
+ # SEAMLESS_REACT_DIR absolute path to the web template to serve (react profile only)
11
+ # API_SERVICE_TOKEN shared secret between the API and both adapters
12
+ # JWKS_KID key id the adapters expect (must match the API's active kid)
13
+ # OWNER_EMAIL tenant owner; this email gets the admin role at signup
14
+ #
15
+ # The adapters are built from ./adapter-app and ./adapter-fastify-app in this repo,
16
+ # so they take no path from the environment.
13
17
 
14
18
  name: seamless-verify
15
19
 
@@ -30,19 +34,17 @@ services:
30
34
  retries: 20
31
35
 
32
36
  auth-api:
33
- # Built with the production Dockerfile (compiles dist/), but run with
34
- # NODE_ENV=test so signing keys auto-generate and prod-only env (JWKS keys)
35
- # is skipped. validateEnvs.sh gates startup on the env below.
37
+ # Built with the production Dockerfile (compiles dist/). Its validateEnvs.sh
38
+ # entrypoint runs the migrations and gates startup on the env below.
36
39
  build:
37
40
  context: ${SEAMLESS_API_DIR}
38
41
  dockerfile: Dockerfile
39
42
  ports:
40
43
  - '5312:5312'
41
44
  environment:
42
- # `development` (not `test`): the API's JWKS endpoint only serves the
43
- # auto-generated dev public key when NODE_ENV === 'development', even though
44
- # signing treats any non-production env as dev. Running as development keeps
45
- # JWKS publication working so the adapter/SDKs can verify tokens.
45
+ # `development`, not `test`: signing treats any non-production env as dev, but
46
+ # the JWKS endpoint only serves the auto-generated dev public key under
47
+ # `development`. The adapters and SDKs need that key to verify tokens.
46
48
  NODE_ENV: development
47
49
  PORT: '5312'
48
50
  APP_NAME: Seamless Verify
@@ -54,9 +56,9 @@ services:
54
56
  DEFAULT_ROLES: user
55
57
  AVAILABLE_ROLES: user,admin
56
58
  LOGIN_METHODS: passkey,magic_link,email_otp,phone_otp,oauth
57
- # Required system config as of auth-api 0.3.0: the base URL for emailed
58
- # magic links. Without it (and with a fresh DB, so system_config isn't seeded)
59
- # the server exits at startup. The browser-visible web app runs on 5173.
59
+ # The base URL for emailed magic links, required at boot: with a fresh DB
60
+ # there is no seeded system_config row to fall back on, so the server exits
61
+ # without it. The browser-visible web app runs on 5173.
60
62
  FRONTEND_URL: http://localhost:5173
61
63
  DB_LOGGING: 'false'
62
64
  ACCESS_TOKEN_TTL: 15m
package/dist/core/jwks.js DELETED
@@ -1,19 +0,0 @@
1
- import { generateKeyPairSync } from "crypto";
2
- export function generateJWKS() {
3
- const { publicKey, privateKey } = generateKeyPairSync("rsa", {
4
- modulusLength: 2048,
5
- publicKeyEncoding: {
6
- type: "spki",
7
- format: "pem",
8
- },
9
- privateKeyEncoding: {
10
- type: "pkcs8",
11
- format: "pem",
12
- },
13
- });
14
- return {
15
- publicKey,
16
- privateKey,
17
- };
18
- }
19
- //# sourceMappingURL=jwks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jwks.js","sourceRoot":"","sources":["../../src/core/jwks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,UAAU,YAAY;IAC1B,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,mBAAmB,CAAC,KAAK,EAAE;QAC3D,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,KAAK;SACd;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,KAAK;SACd;KACF,CAAC,CAAC;IAEH,OAAO;QACL,SAAS;QACT,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -1,9 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- export function writeEnv(dir, values) {
4
- const env = Object.entries(values)
5
- .map(([k, v]) => `${k}=${v}`)
6
- .join("\n");
7
- fs.writeFileSync(path.join(dir, ".env"), env + "\n");
8
- }
9
- //# sourceMappingURL=writeEnv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writeEnv.js","sourceRoot":"","sources":["../../src/utils/writeEnv.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,MAA2B;IAC/D,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;SAC5B,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC;AACvD,CAAC"}