@rebasepro/server-postgres 0.29.2 → 0.30.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.
- package/dist/{BranchService-X9R505mP.js → BranchService-CrXvcES2.js} +3 -3
- package/dist/{BranchService-X9R505mP.js.map → BranchService-CrXvcES2.js.map} +1 -1
- package/dist/PostgresBootstrapper.d.ts +7 -0
- package/dist/{backup-cli-CwiJEp_J.js → backup-cli-CTKCOLpX.js} +3 -3
- package/dist/{backup-cli-CwiJEp_J.js.map → backup-cli-CTKCOLpX.js.map} +1 -1
- package/dist/{boot-ddl-CbZj9ovZ.js → boot-ddl-CqGIwSYx.js} +2 -2
- package/dist/{boot-ddl-CbZj9ovZ.js.map → boot-ddl-CqGIwSYx.js.map} +1 -1
- package/dist/{cli-console-DDkNetCz.js → cli-console-DBPw-oAz.js} +5 -5
- package/dist/{cli-console-DDkNetCz.js.map → cli-console-DBPw-oAz.js.map} +1 -1
- package/dist/{cli-errors-C73Qy7WJ.js → cli-errors-DYTxnLbW.js} +5 -5
- package/dist/{cli-errors-C73Qy7WJ.js.map → cli-errors-DYTxnLbW.js.map} +1 -1
- package/dist/cli.js +62 -42
- package/dist/cli.js.map +1 -1
- package/dist/{database-preflight-DIauc8i5.js → database-preflight-iBpT7-vv.js} +2 -2
- package/dist/{database-preflight-DIauc8i5.js.map → database-preflight-iBpT7-vv.js.map} +1 -1
- package/dist/{deferred-index-build-DDdnjaOW.js → deferred-index-build-BCU9RoHK.js} +6 -6
- package/dist/{deferred-index-build-DDdnjaOW.js.map → deferred-index-build-BCU9RoHK.js.map} +1 -1
- package/dist/{doctor-DwMXljiq.js → doctor-Kg1oUK0Q.js} +6 -6
- package/dist/{doctor-DwMXljiq.js.map → doctor-Kg1oUK0Q.js.map} +1 -1
- package/dist/{ensure-collection-policies-DJsOMpaI.js → ensure-collection-policies-Bo-_fDAy.js} +12 -12
- package/dist/ensure-collection-policies-Bo-_fDAy.js.map +1 -0
- package/dist/{ensure-collection-tables-h1mUO7Uu.js → ensure-collection-tables-DCJINkT_.js} +9 -9
- package/dist/{ensure-collection-tables-h1mUO7Uu.js.map → ensure-collection-tables-DCJINkT_.js.map} +1 -1
- package/dist/{ensure-tables-CUqYgMvo.js → ensure-tables-BPGaGh0y.js} +4 -4
- package/dist/{ensure-tables-CUqYgMvo.js.map → ensure-tables-BPGaGh0y.js.map} +1 -1
- package/dist/{enum-labels-kept-z7ustOl_.js → enum-labels-kept-YAgOZS4I.js} +3 -3
- package/dist/{enum-labels-kept-z7ustOl_.js.map → enum-labels-kept-YAgOZS4I.js.map} +1 -1
- package/dist/{generate-drizzle-schema-BIUqhSzh.js → generate-drizzle-schema-DcrFr7YX.js} +2 -2
- package/dist/{generate-drizzle-schema-BIUqhSzh.js.map → generate-drizzle-schema-DcrFr7YX.js.map} +1 -1
- package/dist/{generate-drizzle-schema-logic-BBXjxm5z.js → generate-drizzle-schema-logic-LTLZvt6r.js} +2 -2
- package/dist/{generate-drizzle-schema-logic-BBXjxm5z.js.map → generate-drizzle-schema-logic-LTLZvt6r.js.map} +1 -1
- package/dist/{generate-files-BkiRFoV1.js → generate-files-CsaVzatS.js} +3 -3
- package/dist/{generate-files-BkiRFoV1.js.map → generate-files-CsaVzatS.js.map} +1 -1
- package/dist/{generate-postgres-ddl-logic-G9PvjHrr.js → generate-postgres-ddl-logic-Dg0bcENZ.js} +39 -6
- package/dist/generate-postgres-ddl-logic-Dg0bcENZ.js.map +1 -0
- package/dist/{generated-schema-diff-D2soazQU.js → generated-schema-diff-By4dxyTH.js} +2 -2
- package/dist/{generated-schema-diff-D2soazQU.js.map → generated-schema-diff-By4dxyTH.js.map} +1 -1
- package/dist/index.es.js +12 -12
- package/dist/{migrate-baseline-CveNQli3.js → migrate-baseline-CmWXL7qx.js} +2 -2
- package/dist/{migrate-baseline-CveNQli3.js.map → migrate-baseline-CmWXL7qx.js.map} +1 -1
- package/dist/{migrate-policy-stamps-C4qbQ0jK.js → migrate-policy-stamps-BN_Qad6c.js} +6 -6
- package/dist/{migrate-policy-stamps-C4qbQ0jK.js.map → migrate-policy-stamps-BN_Qad6c.js.map} +1 -1
- package/dist/{open-rebase-Cvid3iwR.js → open-rebase-40paQfVW.js} +31 -24
- package/dist/{open-rebase-Cvid3iwR.js.map → open-rebase-40paQfVW.js.map} +1 -1
- package/dist/{pg-error-utils-80uTIHQs.js → pg-error-utils-DJHjCF7-.js} +2 -2
- package/dist/{pg-error-utils-80uTIHQs.js.map → pg-error-utils-DJHjCF7-.js.map} +1 -1
- package/dist/{plan-schema-CMhNYEYF.js → plan-schema-vJd3UEmT.js} +24 -9
- package/dist/plan-schema-vJd3UEmT.js.map +1 -0
- package/dist/{policy-drift-Bx6663KD.js → policy-drift-C-m0uWHH.js} +53 -8
- package/dist/policy-drift-C-m0uWHH.js.map +1 -0
- package/dist/{push-index-adoption-C-TpM445.js → push-index-adoption-Cp7oZxSl.js} +3 -3
- package/dist/{push-index-adoption-C-TpM445.js.map → push-index-adoption-Cp7oZxSl.js.map} +1 -1
- package/dist/{push-index-prebuild-xbpgZEJK.js → push-index-prebuild-DbwKGtQT.js} +4 -4
- package/dist/{push-index-prebuild-xbpgZEJK.js.map → push-index-prebuild-DbwKGtQT.js.map} +1 -1
- package/dist/{push-kept-defaults-D-JEv0Gn.js → push-kept-defaults-CLcgsEPt.js} +2 -2
- package/dist/{push-kept-defaults-D-JEv0Gn.js.map → push-kept-defaults-CLcgsEPt.js.map} +1 -1
- package/dist/{push-legacy-renames-7UKspspl.js → push-legacy-renames-BthD0E9W.js} +4 -4
- package/dist/{push-legacy-renames-7UKspspl.js.map → push-legacy-renames-BthD0E9W.js.map} +1 -1
- package/dist/{push-policy-plan-BOw5PtU8.js → push-policy-plan-BgcrroxQ.js} +3 -3
- package/dist/{push-policy-plan-BOw5PtU8.js.map → push-policy-plan-BgcrroxQ.js.map} +1 -1
- package/dist/{render-ddl-Di-fTGti.js → render-ddl-Ci3S_SoI.js} +23 -5
- package/dist/render-ddl-Ci3S_SoI.js.map +1 -0
- package/dist/{request-role-cli-Bxxskru9.js → request-role-cli-Dy1EgJU9.js} +8 -8
- package/dist/{request-role-cli-Bxxskru9.js.map → request-role-cli-Dy1EgJU9.js.map} +1 -1
- package/dist/{request-role-migration-BCW4v0rq.js → request-role-migration-GHTJnPMV.js} +2 -2
- package/dist/{request-role-migration-BCW4v0rq.js.map → request-role-migration-GHTJnPMV.js.map} +1 -1
- package/dist/{rls-bootstrap-sql-CxszeSc7.js → rls-bootstrap-sql-kPX4-MB1.js} +18 -3
- package/dist/rls-bootstrap-sql-kPX4-MB1.js.map +1 -0
- package/dist/{rls-enforcement-CyUCPDH8.js → rls-enforcement-Cc_UhOxb.js} +109 -6
- package/dist/rls-enforcement-Cc_UhOxb.js.map +1 -0
- package/dist/schema/doctor-cli.js +7 -7
- package/dist/schema/ensure-collection-policies.d.ts +8 -0
- package/dist/schema/generate-drizzle-schema.js +1 -1
- package/dist/schema/generate-postgres-ddl-logic.d.ts +9 -0
- package/dist/schema/generate-postgres-ddl.js +1 -1
- package/dist/schema/introspect-db.js +1 -1
- package/dist/schema/plan/types.d.ts +13 -0
- package/dist/schema/rls-bootstrap-sql.d.ts +6 -0
- package/dist/security/policy-drift.d.ts +13 -1
- package/dist/security/rls-enforcement.d.ts +31 -0
- package/dist/{websocket-BSYV_KSw.js → websocket-B7ex6AQM.js} +3 -3
- package/dist/{websocket-BSYV_KSw.js.map → websocket-B7ex6AQM.js.map} +1 -1
- package/package.json +7 -7
- package/dist/ensure-collection-policies-DJsOMpaI.js.map +0 -1
- package/dist/generate-postgres-ddl-logic-G9PvjHrr.js.map +0 -1
- package/dist/plan-schema-CMhNYEYF.js.map +0 -1
- package/dist/policy-drift-Bx6663KD.js.map +0 -1
- package/dist/render-ddl-Di-fTGti.js.map +0 -1
- package/dist/rls-bootstrap-sql-CxszeSc7.js.map +0 -1
- package/dist/rls-enforcement-CyUCPDH8.js.map +0 -1
|
@@ -454,7 +454,38 @@ export declare function settleAdminSwitch(run: RawSqlRunner, schemas: string[],
|
|
|
454
454
|
}): Promise<{
|
|
455
455
|
request: RequestIdentity;
|
|
456
456
|
adminPoliciesLive: boolean;
|
|
457
|
+
adminRequestPoliciesLive: boolean;
|
|
457
458
|
}>;
|
|
459
|
+
/**
|
|
460
|
+
* Make {@link REBASE_ADMIN_REQUEST_ROLE} the admin request roles' alone, and
|
|
461
|
+
* say whether it is — which decides whether the admin-only policies get their
|
|
462
|
+
* `USING (true)` companions, and with them an admin request's index plans.
|
|
463
|
+
*
|
|
464
|
+
* The companions admit every member of that role to every row the admin
|
|
465
|
+
* policies grant, so membership is the whole boundary, and it is checked, not
|
|
466
|
+
* assumed. From PostgreSQL 16 each admin request role is granted it `WITH
|
|
467
|
+
* INHERIT TRUE, SET FALSE`; the connection holds those roles `WITH INHERIT
|
|
468
|
+
* FALSE` and so not this one. Before 16 inheritance is a property of the role,
|
|
469
|
+
* the connection would inherit it through them, and nothing is granted. Then
|
|
470
|
+
* the catalogue is asked who holds its privileges: anyone but the admin
|
|
471
|
+
* request roles — the connection by `createrole_self_grant`, a request role, a
|
|
472
|
+
* grant by hand — and the answer is `false`, the companions are not planned,
|
|
473
|
+
* and the policies step drops any it finds. A role that bypasses RLS anyway
|
|
474
|
+
* (a superuser, BYPASSRLS) gains nothing from them and does not count.
|
|
475
|
+
*
|
|
476
|
+
* A boot that provisions nothing creates and grants nothing, and only reads.
|
|
477
|
+
*/
|
|
478
|
+
export declare function settleAdminRequestGroup(run: RawSqlRunner, adminRoles: readonly string[], options: {
|
|
479
|
+
provision: boolean;
|
|
480
|
+
}): Promise<boolean>;
|
|
481
|
+
/**
|
|
482
|
+
* Whether a companion found in the database may stay: the admin switch would
|
|
483
|
+
* be live for this database's request roles, and nothing but their admin
|
|
484
|
+
* roles holds {@link REBASE_ADMIN_REQUEST_ROLE}. `db push` and `rebase doctor`
|
|
485
|
+
* ask this before taking a live companion for Rebase's own — otherwise it is
|
|
486
|
+
* an orphan, and push drops it. Anything it cannot read answers `false`.
|
|
487
|
+
*/
|
|
488
|
+
export declare function adminRequestCompanionsSafeForCli(run: RawSqlRunner): Promise<boolean>;
|
|
458
489
|
/**
|
|
459
490
|
* Where `db push` and `rebase doctor` expect the server-or-admin policies, for
|
|
460
491
|
* the request roles this database records (or the configured ones): `TO
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "module";
|
|
2
2
|
__createRequire(import.meta.url);
|
|
3
3
|
import { i as __exportAll } from "./cli-prompt-DXG0yk-h.js";
|
|
4
|
-
import { A as budgetSendBuffers, M as terminateIfBacklogged, N as assertReadRequestReadable, ct as SqlResultTooLargeError, it as effectiveSqlRole, j as reapSilentSockets, lt as isNestedPath, ot as sqlRoleRanAs, st as SQL_RESULT_BYTE_BUDGET, ut as resolveNestedPath } from "./open-rebase-
|
|
5
|
-
import { r as BranchingUnsupportedError } from "./BranchService-
|
|
4
|
+
import { A as budgetSendBuffers, M as terminateIfBacklogged, N as assertReadRequestReadable, ct as SqlResultTooLargeError, it as effectiveSqlRole, j as reapSilentSockets, lt as isNestedPath, ot as sqlRoleRanAs, st as SQL_RESULT_BYTE_BUDGET, ut as resolveNestedPath } from "./open-rebase-40paQfVW.js";
|
|
5
|
+
import { r as BranchingUnsupportedError } from "./BranchService-CrXvcES2.js";
|
|
6
6
|
import { ApiError, DATABASE_UNAVAILABLE_MESSAGE, RUNTIME_DEFAULT_MAX_BODY_SIZE, assertFieldOpsValid, assertNestedWriteAllowed, assertNoFieldOpsOnCreate, assertNoUserUpsert, assertUserCreationBodyValid, assertWriteRequestValid, createUserThroughAuthCollection, decideImpersonation, declaredErrorAnswer, extractUserFromToken, getAccessModel, isDatabaseUnreachable, logger, resolveConflictTarget, resolveRequireAuth, safeCompare } from "@rebasepro/server";
|
|
7
7
|
import { ANONYMOUS_USER_ID, ListLimitError, hasAdminRole, isSQLAdmin, isSchemaAdmin, resolveClientListLimit, scopeGrants, scopesForRoles } from "@rebasepro/types";
|
|
8
8
|
import { UnknownFilterOperatorError, deserializeFilter, redactSqlLiterals } from "@rebasepro/common";
|
|
@@ -1698,4 +1698,4 @@ function createPostgresWebSocket(server, realtimeService, driver, authConfig, au
|
|
|
1698
1698
|
//#endregion
|
|
1699
1699
|
export { createPostgresWebSocket as a, websocket_exports as c, TOO_MANY_SOCKETS_CLOSE_CODE as i, PUBLIC_TYPES as n, isSocketRealtimeService as o, SESSION_ENDED_CLOSE_CODE as r, socketRealtimeMissing as s, ADMIN_PLANE_TYPES as t };
|
|
1700
1700
|
|
|
1701
|
-
//# sourceMappingURL=websocket-
|
|
1701
|
+
//# sourceMappingURL=websocket-B7ex6AQM.js.map
|