@rebasepro/types 0.33.0 → 0.33.1

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.
@@ -242,6 +242,12 @@ export interface RlsDescriptor {
242
242
  * gets it.
243
243
  */
244
244
  declaredDefaultPolicies?: true;
245
+ /**
246
+ * The table wrote `rlsRequired`: whether the server refuses to serve it
247
+ * when the database does not enforce its policies. Absent, its database's
248
+ * `rls.required` decides (required unless that says `false`).
249
+ */
250
+ required?: boolean;
245
251
  /**
246
252
  * The policies Postgres holds for the table, when the server includes them
247
253
  * (admins and `schema:read` holders): the Studio's RLS editor reads these.
@@ -51,6 +51,18 @@ export interface TableConfig<C extends ColumnsShape, R extends RelationsShape =
51
51
  * database's declaration decides.
52
52
  */
53
53
  defaultPolicies?: boolean;
54
+ /**
55
+ * `false` serves the table even when the database does not enforce its
56
+ * `rls`: row-level security off, or its declared policies missing. For a
57
+ * table whose schema something else owns (Alembic, Prisma, a DBA) and
58
+ * whose access the app enforces itself. The boot names every table it
59
+ * serves this way. A boot that provisions still writes the declared
60
+ * policies; this only stops a boot that provisions nothing from refusing
61
+ * the table. `true` requires it even when the table's database says
62
+ * `database({ rls: { required: false } })`. Absent, the database's
63
+ * declaration decides (required by default).
64
+ */
65
+ rlsRequired?: boolean;
54
66
  /**
55
67
  * Scope every row to a tenant: a column key, or a `belongsTo` relation's
56
68
  * name, which stands for its foreign-key column (as the compiler reads it).
@@ -88,6 +88,7 @@ export interface TableOptionValues {
88
88
  indexes: readonly TableIndex[];
89
89
  strictWrites: false;
90
90
  defaultPolicies: boolean;
91
+ rlsRequired: boolean;
91
92
  metadata: Record<string, unknown>;
92
93
  }
93
94
  /**
@@ -82,6 +82,14 @@ export interface DatabaseRlsOptions {
82
82
  policyTarget?: "public" | "requestRole";
83
83
  adminPolicies?: "adminRole" | "public";
84
84
  defaultPolicies?: boolean;
85
+ /**
86
+ * `false` serves this database's declared tables even when it does not
87
+ * enforce their `rls` (row-level security off, declared policies
88
+ * missing): for a database whose schema something else owns and whose
89
+ * access the app enforces. A table's own `rlsRequired` wins. Default
90
+ * `true`: such a table is withheld (503 TABLE_WITHHELD).
91
+ */
92
+ required?: boolean;
85
93
  inheritRoles?: string[];
86
94
  identity?: "rebase" | "supabase";
87
95
  sharedRole?: "warn" | "refuse" | "ignore";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/types",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "Rebase type definitions — shared interfaces and controller types",
5
5
  "keywords": [
6
6
  "rebase",