@omnibase/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 (199) hide show
  1. package/dist/commands/auth.d.ts +1 -1
  2. package/dist/commands/auth.d.ts.map +1 -1
  3. package/dist/commands/auth.js +4 -4
  4. package/dist/commands/auth.js.map +1 -1
  5. package/dist/commands/cloud.d.ts +21 -2
  6. package/dist/commands/cloud.d.ts.map +1 -1
  7. package/dist/commands/cloud.js +211 -116
  8. package/dist/commands/cloud.js.map +1 -1
  9. package/dist/commands/db/index.d.ts +1 -1
  10. package/dist/commands/db/index.d.ts.map +1 -1
  11. package/dist/commands/db/index.js +5 -5
  12. package/dist/commands/db/index.js.map +1 -1
  13. package/dist/commands/db/migrate.d.ts +1 -1
  14. package/dist/commands/db/migrate.d.ts.map +1 -1
  15. package/dist/commands/db/migrate.js +54 -5
  16. package/dist/commands/db/migrate.js.map +1 -1
  17. package/dist/commands/db/policy.d.ts +1 -1
  18. package/dist/commands/db/policy.d.ts.map +1 -1
  19. package/dist/commands/db/policy.js +21 -19
  20. package/dist/commands/db/policy.js.map +1 -1
  21. package/dist/commands/docs.d.ts +3 -0
  22. package/dist/commands/docs.d.ts.map +1 -0
  23. package/dist/commands/docs.js +105 -0
  24. package/dist/commands/docs.js.map +1 -0
  25. package/dist/commands/email.d.ts +1 -1
  26. package/dist/commands/email.d.ts.map +1 -1
  27. package/dist/commands/email.js +4 -4
  28. package/dist/commands/email.js.map +1 -1
  29. package/dist/commands/environment.d.ts +1 -1
  30. package/dist/commands/environment.d.ts.map +1 -1
  31. package/dist/commands/environment.js +6 -2
  32. package/dist/commands/environment.js.map +1 -1
  33. package/dist/commands/migrate.d.ts +1 -1
  34. package/dist/commands/migrate.d.ts.map +1 -1
  35. package/dist/commands/migrate.js +7 -6
  36. package/dist/commands/migrate.js.map +1 -1
  37. package/dist/commands/permissions.d.ts +2 -2
  38. package/dist/commands/permissions.d.ts.map +1 -1
  39. package/dist/commands/permissions.js +71 -30
  40. package/dist/commands/permissions.js.map +1 -1
  41. package/dist/commands/restart.d.ts +1 -1
  42. package/dist/commands/restart.d.ts.map +1 -1
  43. package/dist/commands/restart.js +24 -8
  44. package/dist/commands/restart.js.map +1 -1
  45. package/dist/commands/stripe.d.ts +1 -1
  46. package/dist/commands/stripe.d.ts.map +1 -1
  47. package/dist/commands/stripe.js +151 -35
  48. package/dist/commands/stripe.js.map +1 -1
  49. package/dist/commands/sync.d.ts +1 -1
  50. package/dist/commands/sync.d.ts.map +1 -1
  51. package/dist/commands/sync.js +11 -7
  52. package/dist/commands/sync.js.map +1 -1
  53. package/dist/config/services.js.map +1 -1
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +208 -48
  56. package/dist/index.js.map +1 -1
  57. package/dist/lib/omnibase.d.ts.map +1 -1
  58. package/dist/lib/omnibase.js.map +1 -1
  59. package/dist/schemas/kratos-config.v25.4.0.schema.json +3182 -0
  60. package/dist/schemas/kratos-tracing-config.v25.4.0.schema.json +152 -0
  61. package/dist/services/db/generate/generate.d.ts.map +1 -1
  62. package/dist/services/db/generate/generate.js +5 -5
  63. package/dist/services/db/generate/generate.js.map +1 -1
  64. package/dist/services/db/generate/policies.d.ts.map +1 -1
  65. package/dist/services/db/generate/policies.js.map +1 -1
  66. package/dist/services/db/generate/rls/compile.d.ts.map +1 -1
  67. package/dist/services/db/generate/rls/compile.js +6 -2
  68. package/dist/services/db/generate/rls/compile.js.map +1 -1
  69. package/dist/services/db/generate/rls/diff.d.ts.map +1 -1
  70. package/dist/services/db/generate/rls/diff.js +6 -4
  71. package/dist/services/db/generate/rls/diff.js.map +1 -1
  72. package/dist/services/db/generate/rls/emit.d.ts.map +1 -1
  73. package/dist/services/db/generate/rls/emit.js +1 -1
  74. package/dist/services/db/generate/rls/emit.js.map +1 -1
  75. package/dist/services/db/generate/rls/schema.d.ts.map +1 -1
  76. package/dist/services/db/generate/rls/schema.js +1 -1
  77. package/dist/services/db/generate/rls/schema.js.map +1 -1
  78. package/dist/services/db/generate/rls-policies.d.ts +2 -2
  79. package/dist/services/db/generate/rls-policies.d.ts.map +1 -1
  80. package/dist/services/db/generate/rls-policies.js +5 -5
  81. package/dist/services/db/generate/rls-policies.js.map +1 -1
  82. package/dist/services/db/generate/utils.d.ts.map +1 -1
  83. package/dist/services/db/generate/utils.js.map +1 -1
  84. package/dist/services/db/migrate.d.ts +26 -7
  85. package/dist/services/db/migrate.d.ts.map +1 -1
  86. package/dist/services/db/migrate.js +72 -67
  87. package/dist/services/db/migrate.js.map +1 -1
  88. package/dist/services/db/utils.d.ts.map +1 -1
  89. package/dist/services/db/utils.js +8 -6
  90. package/dist/services/db/utils.js.map +1 -1
  91. package/dist/services/docs/client.d.ts +28 -0
  92. package/dist/services/docs/client.d.ts.map +1 -0
  93. package/dist/services/docs/client.js +139 -0
  94. package/dist/services/docs/client.js.map +1 -0
  95. package/dist/utils/agent-files.d.ts +2 -0
  96. package/dist/utils/agent-files.d.ts.map +1 -0
  97. package/dist/utils/agent-files.js +70 -0
  98. package/dist/utils/agent-files.js.map +1 -0
  99. package/dist/utils/api-client.d.ts +2 -2
  100. package/dist/utils/api-client.d.ts.map +1 -1
  101. package/dist/utils/api-client.js +1 -1
  102. package/dist/utils/api-client.js.map +1 -1
  103. package/dist/utils/auth-env.d.ts +9 -0
  104. package/dist/utils/auth-env.d.ts.map +1 -0
  105. package/dist/utils/auth-env.js +244 -0
  106. package/dist/utils/auth-env.js.map +1 -0
  107. package/dist/utils/config.d.ts +7 -19
  108. package/dist/utils/config.d.ts.map +1 -1
  109. package/dist/utils/config.js +23 -45
  110. package/dist/utils/config.js.map +1 -1
  111. package/dist/utils/context.d.ts +2 -2
  112. package/dist/utils/context.d.ts.map +1 -1
  113. package/dist/utils/context.js.map +1 -1
  114. package/dist/utils/credentials.d.ts.map +1 -1
  115. package/dist/utils/credentials.js +4 -4
  116. package/dist/utils/credentials.js.map +1 -1
  117. package/dist/utils/docker.d.ts +9 -2
  118. package/dist/utils/docker.d.ts.map +1 -1
  119. package/dist/utils/docker.js +101 -42
  120. package/dist/utils/docker.js.map +1 -1
  121. package/dist/utils/environment.d.ts +5 -2
  122. package/dist/utils/environment.d.ts.map +1 -1
  123. package/dist/utils/environment.js +34 -7
  124. package/dist/utils/environment.js.map +1 -1
  125. package/dist/utils/errors.js +1 -1
  126. package/dist/utils/errors.js.map +1 -1
  127. package/dist/utils/logger.d.ts.map +1 -1
  128. package/dist/utils/logger.js +5 -5
  129. package/dist/utils/logger.js.map +1 -1
  130. package/dist/utils/permission-namespaces.d.ts +33 -0
  131. package/dist/utils/permission-namespaces.d.ts.map +1 -0
  132. package/dist/utils/permission-namespaces.js +328 -0
  133. package/dist/utils/permission-namespaces.js.map +1 -0
  134. package/dist/utils/platform-requirements.d.ts +36 -0
  135. package/dist/utils/platform-requirements.d.ts.map +1 -0
  136. package/dist/utils/platform-requirements.js +135 -0
  137. package/dist/utils/platform-requirements.js.map +1 -0
  138. package/dist/utils/start-summary.d.ts +21 -0
  139. package/dist/utils/start-summary.d.ts.map +1 -0
  140. package/dist/utils/start-summary.js +55 -0
  141. package/dist/utils/start-summary.js.map +1 -0
  142. package/dist/utils/user-input.d.ts.map +1 -1
  143. package/dist/utils/user-input.js.map +1 -1
  144. package/dist/utils/versions.d.ts +10 -0
  145. package/dist/utils/versions.d.ts.map +1 -0
  146. package/dist/utils/versions.js +77 -0
  147. package/dist/utils/versions.js.map +1 -0
  148. package/docker/db/000022_drop_stripe_id_mappings.down.sql +18 -0
  149. package/docker/db/000022_drop_stripe_id_mappings.up.sql +1 -0
  150. package/docker/db/000023_email_tenant_templates.down.sql +30 -0
  151. package/docker/db/000023_email_tenant_templates.up.sql +48 -0
  152. package/docker/db/000024_email_history.down.sql +1 -0
  153. package/docker/db/000024_email_history.up.sql +15 -0
  154. package/docker/db/000025_manage_billing.down.sql +4 -0
  155. package/docker/db/000025_manage_billing.up.sql +5 -0
  156. package/docker/db/000026_authenticated_role.down.sql +2 -0
  157. package/docker/db/000026_authenticated_role.up.sql +21 -0
  158. package/docker/db/000027_unique_active_tenant.down.sql +1 -0
  159. package/docker/db/000027_unique_active_tenant.up.sql +13 -0
  160. package/docker/db/000028_drop_enterprise_pricing.down.sql +7 -0
  161. package/docker/db/000028_drop_enterprise_pricing.up.sql +8 -0
  162. package/docker/docker-compose.base.yml +35 -58
  163. package/docker/docker-compose.dev.yml +0 -36
  164. package/docker/docker-compose.perf-test.yml +0 -32
  165. package/docker/docker-compose.test.yml +0 -36
  166. package/docker/keto/permissions.yml +10 -0
  167. package/package.json +63 -62
  168. package/templates/.env.example +36 -0
  169. package/templates/AGENTS.md +41 -0
  170. package/templates/CLAUDE.md +1 -0
  171. package/templates/auth/identity.schema.json +47 -0
  172. package/templates/auth/oidc/apple.jsonnet +17 -0
  173. package/templates/auth/oidc/github.jsonnet +17 -0
  174. package/templates/auth/oidc/google.jsonnet +13 -0
  175. package/templates/auth/oidc/microsoft.jsonnet +22 -0
  176. package/templates/db/README.md +7 -3
  177. package/templates/db/policies/example.ts +11 -11
  178. package/templates/db/policies/index.ts +1 -1
  179. package/templates/email/auth/recovery/invalid/email.body.gotmpl +35 -0
  180. package/templates/email/auth/recovery/invalid/email.body.plaintext.gotmpl +19 -0
  181. package/templates/email/auth/recovery/invalid/email.subject.gotmpl +1 -0
  182. package/templates/email/auth/recovery/valid/email.body.gotmpl +85 -0
  183. package/templates/email/auth/recovery/valid/email.body.plaintext.gotmpl +10 -0
  184. package/templates/email/auth/recovery/valid/email.subject.gotmpl +1 -0
  185. package/templates/email/auth/verification/invalid/email.body.gotmpl +34 -0
  186. package/templates/email/auth/verification/invalid/email.body.plaintext.gotmpl +18 -0
  187. package/templates/email/auth/verification/invalid/email.subject.gotmpl +1 -0
  188. package/templates/email/auth/verification/valid/email.body.gotmpl +85 -0
  189. package/templates/email/auth/verification/valid/email.body.plaintext.gotmpl +10 -0
  190. package/templates/email/auth/verification/valid/email.subject.gotmpl +1 -0
  191. package/templates/omnibase.toml +90 -13
  192. package/templates/stripe/example.config.json +39 -33
  193. package/templates/tsconfig.json +17 -17
  194. package/templates/workers/package.json +21 -21
  195. package/templates/workers/src/index.ts +10 -10
  196. package/templates/workers/tsconfig.json +24 -24
  197. package/templates/permissions/storage.ts +0 -50
  198. package/templates/permissions/tenants.ts +0 -120
  199. package/templates/permissions/types.ts +0 -16
package/package.json CHANGED
@@ -1,64 +1,65 @@
1
1
  {
2
- "name": "@omnibase/cli",
3
- "version": "0.12.0",
4
- "description": "OmniBase CLI - Manage Docker Compose services and environment configuration",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/PhoenixSolutionsGroup/omnibase"
8
- },
9
- "main": "dist/index.js",
10
- "exports": {
11
- ".": "./dist/index.js",
12
- "./db/policies": "./dist/services/db/generate/policies.js",
13
- "./db/rls-policies": "./dist/services/db/generate/rls-policies.js",
14
- "./db/generate": "./dist/services/db/generate/generate.js"
15
- },
16
- "bin": {
17
- "omnibase": "./dist/index.js"
18
- },
19
- "files": [
20
- "dist/",
21
- "templates/",
22
- "docker/"
23
- ],
24
- "scripts": {
25
- "build": "rm -rf dist && tsc && chmod +x dist/index.js",
26
- "dev": "NODE_ENV=development bun src/index.ts",
27
- "test": "bun test",
28
- "start": "node dist/index.js",
29
- "prepare": "npm run build"
30
- },
31
- "keywords": [
32
- "cli",
33
- "docker",
34
- "compose",
35
- "omnibase"
36
- ],
37
- "author": "Phoenix Solutions Group",
38
- "license": "MIT",
39
- "dependencies": {
40
- "@inquirer/prompts": "^8.1.0",
41
- "@omnibase/core-js": "0.21.0",
42
- "@ory/client": "^1.14.3",
43
- "adm-zip": "^0.5.16",
44
- "axios": "^1.6.0",
45
- "chalk": "^5.6.2",
46
- "commander": "^11.1.0",
47
- "dotenv": "^16.3.1",
48
- "form-data": "^4.0.0",
49
- "jszip": "^3.10.1",
50
- "ora": "^9.0.0",
51
- "smol-toml": "^1.7.0",
52
- "tsx": "^4.19.0",
53
- "uuid": "^14.0.1"
54
- },
55
- "devDependencies": {
56
- "@prisma/client": "^6.0.0",
57
- "@types/adm-zip": "^0.5.8",
58
- "@types/bun": "latest",
59
- "@types/node": "^20.10.0",
60
- "@types/uuid": "^11.0.0",
61
- "ts-node": "^10.9.2",
62
- "typescript": "^5.3.3"
63
- }
2
+ "name": "@omnibase/cli",
3
+ "version": "0.14.0",
4
+ "description": "OmniBase CLI - Manage Docker Compose services and environment configuration",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/PhoenixSolutionsGroup/omnibase"
8
+ },
9
+ "main": "dist/index.js",
10
+ "exports": {
11
+ ".": "./dist/index.js",
12
+ "./db/policies": "./dist/services/db/generate/policies.js",
13
+ "./db/rls-policies": "./dist/services/db/generate/rls-policies.js",
14
+ "./db/generate": "./dist/services/db/generate/generate.js"
15
+ },
16
+ "bin": {
17
+ "omnibase": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist/",
21
+ "templates/",
22
+ "docker/"
23
+ ],
24
+ "scripts": {
25
+ "build": "rm -rf dist && tsc && chmod +x dist/index.js",
26
+ "dev": "NODE_ENV=development bun src/index.ts",
27
+ "test": "bun test",
28
+ "start": "node dist/index.js",
29
+ "prepare": "bun run --cwd ../../sdk/core/js build && npm run build"
30
+ },
31
+ "keywords": [
32
+ "cli",
33
+ "docker",
34
+ "compose",
35
+ "omnibase"
36
+ ],
37
+ "author": "Phoenix Solutions Group",
38
+ "license": "MIT",
39
+ "dependencies": {
40
+ "@inquirer/prompts": "^8.1.0",
41
+ "@omnibase/core-js": "0.25.0",
42
+ "@ory/client": "^1.14.3",
43
+ "adm-zip": "^0.5.16",
44
+ "ajv": "^8.17.1",
45
+ "axios": "^1.6.0",
46
+ "chalk": "^5.6.2",
47
+ "commander": "^11.1.0",
48
+ "dotenv": "^16.3.1",
49
+ "form-data": "^4.0.0",
50
+ "jszip": "^3.10.1",
51
+ "ora": "^9.0.0",
52
+ "smol-toml": "^1.7.0",
53
+ "tsx": "^4.19.0",
54
+ "typescript": "^5.3.3",
55
+ "uuid": "^14.0.1"
56
+ },
57
+ "devDependencies": {
58
+ "@prisma/client": "^6.0.0",
59
+ "@types/adm-zip": "^0.5.8",
60
+ "@types/bun": "latest",
61
+ "@types/node": "^20.10.0",
62
+ "@types/uuid": "^11.0.0",
63
+ "ts-node": "^10.9.2"
64
+ }
64
65
  }
@@ -0,0 +1,36 @@
1
+ # OmniBase API Configuration
2
+ OMNIBASE_API_URL=http://localhost:8080
3
+ OMNIBASE_SERVICE_KEY=VERY_SECRET_KEY
4
+
5
+ # Required: Auth Configuration
6
+ WEBSITE_URL=http://127.0.0.1:3000
7
+ COOKIE_SECRET=PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
8
+ CIPHER_SECRET=32-LONG-SECRET-NOT-SECURE-AT-ALL
9
+
10
+ # Stripe Configuration (update with your keys)
11
+ STRIPE_SECRET_KEY=stripe-secret-key
12
+ STRIPE_PUBLISHABLE_KEY=stripe-publishable-key
13
+
14
+ # Optional: Uncomment and customize as needed
15
+ # Invite link origins (defaults to FRONTEND_URL, then WEBSITE_URL)
16
+ # INVITE_ALLOWED_ORIGINS=https://app.example.com,https://admin.example.com
17
+ # Auth URLs (defaults shown)
18
+ # AUTH_LOG_LEVEL=info
19
+ # AUTH_URL=http://127.0.0.1:4433
20
+ # AUTH_ADMIN_URL=http://kratos:4434
21
+
22
+ # Website Auth Flow URLs (all default to ${WEBSITE_URL}/auth/<flow>)
23
+ # WEBSITE_AUTH_ERROR_URL=http://127.0.0.1:3000/auth/error
24
+ # WEBSITE_SETTING_URL=http://127.0.0.1:3000/auth/settings
25
+ # WEBSITE_RECOVERY_URL=http://127.0.0.1:3000/auth/recovery
26
+ # WEBSITE_VERIFICATION_RECOVERY_URL=http://127.0.0.1:3000/auth/verification
27
+ # WEBSITE_LOGIN_URL=http://127.0.0.1:3000/auth/login
28
+ # WEBSITE_REGISTRATION_URL=http://127.0.0.1:3000/auth/registration
29
+
30
+ # SMTP Configuration
31
+ # SMTP_CONNECTION_URI=smtps://test:test@mailslurper:1025/?skip_ssl_verify=true
32
+
33
+ # OIDC Provider Configuration
34
+ # OIDC_GOOGLE_ENABLED=false
35
+ # GOOGLE_CLIENT_ID=
36
+ # GOOGLE_CLIENT_SECRET=
@@ -0,0 +1,41 @@
1
+ # OmniBase
2
+
3
+ This project uses OmniBase, an open-source backend for authentication, multi-tenancy, permissions, storage, payments, email, and edge workers.
4
+
5
+ ## What OmniBase offers
6
+
7
+ - **Auth** — sessions, identities, OIDC login, API keys, and tenant switching.
8
+ - **Multi-tenancy** — tenants, invitations, and tenant isolation.
9
+ - **Permissions** — role-based access control with relationship-based policies.
10
+ - **Database** — Postgres with a Prisma schema, SQL migrations, RLS, and type generation.
11
+ - **Storage** — S3-compatible uploads, downloads, and public objects. Paths are bucket-wide; prefix them with the tenant ID.
12
+ - **Payments** — Stripe checkout, invoices, subscriptions, metered usage, and customer portal.
13
+ - **Email** — templates and send APIs.
14
+ - **Workers** — Bun edge functions, cron jobs, and queues. The deployment `path` in `omnibase/omnibase.toml` points at the worker directory, which can be the whole application.
15
+ - **Managed hosting** — branches, domains, environment variables, and deploys through `omnibase cloud`.
16
+ - **SDKs** — `@omnibase/core-js`, `@omnibase/nextjs`, `@omnibase/react`, and `@omnibase/shadcn`.
17
+
18
+ ## Project layout
19
+
20
+ - `omnibase/omnibase.toml` — project and deployment configuration
21
+ - `omnibase/.env.local` — local secrets
22
+ - `omnibase/db/` — Prisma schema, migrations, and RLS policies
23
+ - `omnibase/permissions/` — RBAC namespaces
24
+ - `omnibase/auth/` — Kratos identity schema and OIDC mappers
25
+ - `omnibase/email/` — email templates
26
+ - `omnibase/stripe/` — Stripe product configuration
27
+ - Application code — wherever the deployment `path` points in `omnibase/omnibase.toml`; this can be the whole project, not only a directory inside `omnibase/`.
28
+
29
+ ## Documentation
30
+
31
+ Do not guess OmniBase APIs or configuration. Query the current docs with the CLI:
32
+
33
+ ```bash
34
+ omnibase docs list # latest docs pages
35
+ omnibase docs search "storage upload" # ranked results with snippets
36
+ omnibase docs get guides/storage # full markdown page
37
+ omnibase docs get /api/latest/storage/uploadFile
38
+ omnibase docs search "tenant jwt" --json # agent-friendly output
39
+ ```
40
+
41
+ Results are cached for one hour; add `--refresh` to bypass the cache. Set `OMNIBASE_DOCS_URL` to use a different docs deployment.
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -0,0 +1,47 @@
1
+ {
2
+ "$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "title": "Person",
5
+ "type": "object",
6
+ "properties": {
7
+ "traits": {
8
+ "type": "object",
9
+ "properties": {
10
+ "email": {
11
+ "type": "string",
12
+ "format": "email",
13
+ "title": "Email",
14
+ "minLength": 3,
15
+ "ory.sh/kratos": {
16
+ "credentials": {
17
+ "password": {
18
+ "identifier": true
19
+ }
20
+ },
21
+ "verification": {
22
+ "via": "email"
23
+ },
24
+ "recovery": {
25
+ "via": "email"
26
+ }
27
+ }
28
+ },
29
+ "name": {
30
+ "type": "object",
31
+ "properties": {
32
+ "first": {
33
+ "title": "First Name",
34
+ "type": "string"
35
+ },
36
+ "last": {
37
+ "title": "Last Name",
38
+ "type": "string"
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "required": ["email", "name"],
44
+ "additionalProperties": false
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,17 @@
1
+ local claims = {
2
+ email_verified: false,
3
+ } + std.extVar('claims');
4
+
5
+ {
6
+ identity: {
7
+ traits: {
8
+ // Allowing unverified email addresses enables account
9
+ // enumeration attacks, if the value is used for
10
+ // verification or as a password login identifier.
11
+ //
12
+ // Therefore we only return the email if it (a) exists and (b) is marked verified
13
+ // by Apple.
14
+ [if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
15
+ },
16
+ },
17
+ }
@@ -0,0 +1,17 @@
1
+ local claims = {
2
+ email_verified: false,
3
+ } + std.extVar('claims');
4
+
5
+ {
6
+ identity: {
7
+ traits: {
8
+ // Allowing unverified email addresses enables account
9
+ // enumeration attacks, if the value is used for
10
+ // verification or as a password login identifier.
11
+ //
12
+ // Therefore we only return the email if it (a) exists and (b) is marked verified
13
+ // by GitHub.
14
+ [if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
15
+ },
16
+ },
17
+ }
@@ -0,0 +1,13 @@
1
+ local claims = std.extVar('claims');
2
+
3
+ {
4
+ identity: {
5
+ traits: {
6
+ email: claims.email,
7
+ name: {
8
+ first: claims.given_name,
9
+ last: claims.family_name,
10
+ },
11
+ },
12
+ },
13
+ }
@@ -0,0 +1,22 @@
1
+ local claims = std.extVar('claims');
2
+
3
+ {
4
+ identity: {
5
+ traits: {
6
+ // Allowing unverified email addresses enables account
7
+ // enumeration attacks, if the value is used for
8
+ // verification or as a password login identifier.
9
+ //
10
+ // If connecting only to your organization (one tenant), claims.email is safe to use
11
+ // if you haven't actively disabled e-mail verification during sign-up.
12
+ //
13
+ // The email might be empty if the account isn't linked to an email address.
14
+ // For a human readable identifier, consider using the "preferred_username" claim.
15
+ [if 'email' in claims then 'email' else null]: claims.email,
16
+ name: {
17
+ first: claims.given_name,
18
+ last: claims.family_name,
19
+ },
20
+ },
21
+ },
22
+ }
@@ -30,14 +30,16 @@ omnibase db migrate apply
30
30
  ## File Naming Convention
31
31
 
32
32
  Migration files are automatically named with timestamps when using `omnibase db migrate new`:
33
+
33
34
  - `{TIMESTAMP}_{description}.sql` (e.g., `1729507200_create_users_table.sql`)
34
35
 
35
36
  For manual creation, you can use simple numeric prefixes:
37
+
36
38
  - `001-seed.sql`
37
39
  - `002-rls.sql`
38
40
  - `003-feature.sql`
39
41
 
40
- All files will be automatically converted to golang-migrate format (`001_seed.up.sql`, etc.) when uploaded.
42
+ Uploaded migrations are applied with Atlas. Existing golang-migrate histories are baselined automatically on their first Atlas push, so already-applied migrations are not run again.
41
43
 
42
44
  ## Commands
43
45
 
@@ -75,7 +77,8 @@ omnibase db migrate push --env prod
75
77
  When you run `omnibase db migrate new`, a file is created with this template:
76
78
 
77
79
  **1729507200_create_users.sql:**
78
- ```sql
80
+
81
+ ````sql
79
82
  -- Migration: create users
80
83
  -- Created: 2024-10-21T10:00:00.000Z
81
84
 
@@ -85,4 +88,5 @@ When you run `omnibase db migrate new`, a file is created with this template:
85
88
  -- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
86
89
  -- email TEXT NOT NULL UNIQUE,
87
90
  -- created_at TIMESTAMP DEFAULT NOW()
88
- -- );
91
+ -- );```
92
+ ````
@@ -1,15 +1,15 @@
1
1
  import { definePolicy } from "@omnibase/cli/db/policies";
2
- import { Prisma } from "./generated";
2
+ import type { Prisma } from "./generated";
3
3
 
4
4
  definePolicy<Prisma.Projects>("projects", {
5
- // `anon` is required on every op (security-sensitive). Use `anon: false` to
6
- // deny anonymous access, or a static filter (e.g. `{ published: true }`) to
7
- // allow it. `auth` is a filter scoped to the request's tenant.
8
- select: {
9
- anon: { published: true },
10
- auth: (a) => ({ tenant_id: a.tenantId }),
11
- },
12
- insert: { anon: false, auth: (a) => ({ tenant_id: a.tenantId }) },
13
- update: { anon: false, auth: (a) => ({ tenant_id: a.tenantId }) },
14
- delete: { anon: false, auth: true },
5
+ // `anon` is required on every op (security-sensitive). Use `anon: false` to
6
+ // deny anonymous access, or a static filter (e.g. `{ published: true }`) to
7
+ // allow it. `auth` is a filter scoped to the request's tenant.
8
+ select: {
9
+ anon: { published: true },
10
+ auth: (a) => ({ tenant_id: a.tenantId }),
11
+ },
12
+ insert: { anon: false, auth: (a) => ({ tenant_id: a.tenantId }) },
13
+ update: { anon: false, auth: (a) => ({ tenant_id: a.tenantId }) },
14
+ delete: { anon: false, auth: true },
15
15
  });
@@ -4,4 +4,4 @@ export * from "./generated";
4
4
  import { loadSchema } from "@omnibase/cli/db/rls-policies";
5
5
  import { Prisma } from "./generated";
6
6
 
7
- loadSchema(Prisma.dmmf)
7
+ loadSchema(Prisma.dmmf);
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Recovery Link Expired</title>
7
+ </head>
8
+ <body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
9
+ <div style="background-color: #f8f9fa; padding: 20px; border-radius: 5px; border-left: 4px solid #dc3545;">
10
+ <h2 style="color: #dc3545; margin-top: 0;">Recovery Link Expired</h2>
11
+
12
+ <p>Hi there,</p>
13
+
14
+ <p>The account recovery link you tried to use has expired or is no longer valid.</p>
15
+
16
+ <p>For security reasons, recovery links expire after a set period of time.</p>
17
+
18
+ <p><strong>What to do next:</strong></p>
19
+ <ul>
20
+ <li>Return to the login page</li>
21
+ <li>Click "Forgot password?" or "Recover account"</li>
22
+ <li>Enter your email address to receive a new recovery link</li>
23
+ <li>Use the new link within the time limit to reset your password</li>
24
+ </ul>
25
+
26
+ <p>If you continue to experience issues, please contact our support team.</p>
27
+
28
+ <hr style="border: none; border-top: 1px solid #dee2e6; margin: 20px 0;">
29
+
30
+ <p style="font-size: 12px; color: #6c757d;">
31
+ If you didn't request this account recovery, please secure your account immediately and contact support.
32
+ </p>
33
+ </div>
34
+ </body>
35
+ </html>
@@ -0,0 +1,19 @@
1
+ Recovery Link Expired
2
+
3
+ Hi there,
4
+
5
+ The account recovery link you tried to use has expired or is no longer valid.
6
+
7
+ For security reasons, recovery links expire after a set period of time.
8
+
9
+ What to do next:
10
+ - Return to the login page
11
+ - Click "Forgot password?" or "Recover account"
12
+ - Enter your email address to receive a new recovery link
13
+ - Use the new link within the time limit to reset your password
14
+
15
+ If you continue to experience issues, please contact our support team.
16
+
17
+ ---
18
+
19
+ If you didn't request this account recovery, please secure your account immediately and contact support.
@@ -0,0 +1 @@
1
+ Recovery Link Expired
@@ -0,0 +1,85 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Reset your password</title>
7
+ <style>
8
+ body {
9
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
+ line-height: 1.6;
11
+ color: #333;
12
+ max-width: 600px;
13
+ margin: 0 auto;
14
+ padding: 20px;
15
+ background-color: #f4f4f4;
16
+ }
17
+ .container {
18
+ background-color: #ffffff;
19
+ border-radius: 8px;
20
+ padding: 40px;
21
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
22
+ }
23
+ h1 {
24
+ color: #2c3e50;
25
+ margin-top: 0;
26
+ font-size: 24px;
27
+ }
28
+ .code-box {
29
+ background-color: #f8f9fa;
30
+ border-left: 4px solid #dc3545;
31
+ padding: 15px;
32
+ margin: 20px 0;
33
+ font-size: 24px;
34
+ font-weight: bold;
35
+ letter-spacing: 2px;
36
+ text-align: center;
37
+ }
38
+ .btn {
39
+ display: inline-block;
40
+ padding: 12px 24px;
41
+ background-color: #dc3545;
42
+ color: #ffffff;
43
+ text-decoration: none;
44
+ border-radius: 4px;
45
+ margin: 20px 0;
46
+ font-weight: 600;
47
+ }
48
+ .btn:hover {
49
+ background-color: #c82333;
50
+ }
51
+ .footer {
52
+ margin-top: 30px;
53
+ padding-top: 20px;
54
+ border-top: 1px solid #e9ecef;
55
+ font-size: 14px;
56
+ color: #6c757d;
57
+ }
58
+ </style>
59
+ </head>
60
+ <body>
61
+ <div class="container">
62
+ <h1>Reset your password 🔒</h1>
63
+
64
+ <p>We received a request to reset your password. Use the code below to continue:</p>
65
+
66
+ <div class="code-box">
67
+ {{.RecoveryCode}}
68
+ </div>
69
+
70
+ <p>Or click the button below to reset your password automatically:</p>
71
+
72
+ <a href="{{.RecoveryURL}}" class="btn">Reset Password</a>
73
+
74
+ <p style="margin-top: 20px; font-size: 14px; color: #6c757d;">
75
+ Or copy and paste this link into your browser:<br>
76
+ <span style="word-break: break-all;">{{.RecoveryURL}}</span>
77
+ </p>
78
+
79
+ <div class="footer">
80
+ <p>This password reset link will expire soon.</p>
81
+ <p>If you didn't request this, please ignore this email. Your password won't be changed.</p>
82
+ </div>
83
+ </div>
84
+ </body>
85
+ </html>
@@ -0,0 +1,10 @@
1
+ Reset your password
2
+
3
+ We received a request to reset your password. Use the code below to continue:
4
+
5
+ Recovery Code: {{.RecoveryCode}}
6
+
7
+ Or click this link: {{.RecoveryURL}}
8
+
9
+ This password reset link will expire soon.
10
+ If you didn't request this, please ignore this email. Your password won't be changed.
@@ -0,0 +1 @@
1
+ Reset your password
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Verification Link Expired</title>
7
+ </head>
8
+ <body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
9
+ <div style="background-color: #f8f9fa; padding: 20px; border-radius: 5px; border-left: 4px solid #dc3545;">
10
+ <h2 style="color: #dc3545; margin-top: 0;">Verification Link Expired</h2>
11
+
12
+ <p>Hi there,</p>
13
+
14
+ <p>The verification link you tried to use has expired or is no longer valid.</p>
15
+
16
+ <p>For security reasons, verification links expire after a set period of time.</p>
17
+
18
+ <p><strong>What to do next:</strong></p>
19
+ <ul>
20
+ <li>Return to the application and request a new verification email</li>
21
+ <li>Check your inbox for the new verification link</li>
22
+ <li>Complete the verification process within the time limit</li>
23
+ </ul>
24
+
25
+ <p>If you continue to experience issues, please contact our support team.</p>
26
+
27
+ <hr style="border: none; border-top: 1px solid #dee2e6; margin: 20px 0;">
28
+
29
+ <p style="font-size: 12px; color: #6c757d;">
30
+ If you didn't request this verification, you can safely ignore this email.
31
+ </p>
32
+ </div>
33
+ </body>
34
+ </html>
@@ -0,0 +1,18 @@
1
+ Verification Link Expired
2
+
3
+ Hi there,
4
+
5
+ The verification link you tried to use has expired or is no longer valid.
6
+
7
+ For security reasons, verification links expire after a set period of time.
8
+
9
+ What to do next:
10
+ - Return to the application and request a new verification email
11
+ - Check your inbox for the new verification link
12
+ - Complete the verification process within the time limit
13
+
14
+ If you continue to experience issues, please contact our support team.
15
+
16
+ ---
17
+
18
+ If you didn't request this verification, you can safely ignore this email.
@@ -0,0 +1 @@
1
+ Verification Link Expired