@rebasepro/types 0.29.2 → 0.29.3

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.
@@ -85,6 +85,29 @@ export declare const RLS_ROLES_SQL = "rebase.roles()";
85
85
  * same in every deployment and every generated migration. FROZEN.
86
86
  */
87
87
  export declare const REBASE_ADMIN_ROLE = "rebase_admin";
88
+ /**
89
+ * The role the admin request roles ({@link adminRequestRoleFor}) inherit and
90
+ * nothing else does, so an admin-only grant can apply to admin REQUESTS alone.
91
+ *
92
+ * {@link REBASE_ADMIN_ROLE} cannot do that job: the connection inherits it for
93
+ * the server context, and so would any process on it that does not switch
94
+ * roles. Its policies therefore keep their test (`rebase.uid() IS NULL` or the
95
+ * `admin` role) — and any policy expression that is not a constant is a
96
+ * security barrier, behind which Postgres will not evaluate a non-leakproof
97
+ * operator as an index condition. An admin's `tags && $1`, `name ~ $1` or
98
+ * jsonb filter scanned the whole table where the owner's used the index.
99
+ *
100
+ * Each admin-only grant gets a companion `TO` this role `USING (true)`.
101
+ * Postgres folds the OR of the permissive policies to `true` for a member, the
102
+ * barrier goes, and an admin request plans as the owner's does; restrictive
103
+ * policies still apply. Membership is the boundary: only the admin request
104
+ * roles hold it, granted `WITH INHERIT TRUE, SET FALSE`, and only from
105
+ * PostgreSQL 16, whose per-grant INHERIT keeps the connection (which holds
106
+ * those roles `WITH INHERIT FALSE`) out. A boot that finds the connection with
107
+ * its privileges revokes every membership, and the companions admit nobody.
108
+ * One fixed name, as {@link REBASE_ADMIN_ROLE}. FROZEN.
109
+ */
110
+ export declare const REBASE_ADMIN_REQUEST_ROLE = "rebase_admin_request";
88
111
  /**
89
112
  * The role an admin request runs as, for a signed-in request role: it inherits
90
113
  * that role (its grants and every policy written for it) and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/types",
3
- "version": "0.29.2",
3
+ "version": "0.29.3",
4
4
  "description": "Rebase type definitions — shared interfaces and controller types",
5
5
  "keywords": [
6
6
  "rebase",