@rebasepro/server-postgres 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.
@@ -46,7 +46,7 @@
46
46
  *
47
47
  * @module
48
48
  */
49
- import type { CompiledTable } from "@rebasepro/types";
49
+ import type { CompiledTable, TableDescriptor } from "@rebasepro/types";
50
50
  import type { PostgresTableRegistry } from "../model/PostgresTableRegistry.js";
51
51
  import type { RawSqlRunner } from "./rls-enforcement.js";
52
52
  /** A declared table the database does not protect, and how to protect it. */
@@ -89,7 +89,19 @@ export interface NarrowedServedTable {
89
89
  export interface ServedTableProtection {
90
90
  unprotected: UnprotectedServedTable[];
91
91
  narrowed: NarrowedServedTable[];
92
+ /**
93
+ * Tables the database does not protect that are served anyway, because
94
+ * their declaration does not require it (`rlsRequired: false`, or their
95
+ * database's `rls: { required: false }`): what the boot names, not withholds.
96
+ */
97
+ servedUnprotected: UnprotectedServedTable[];
92
98
  }
99
+ /**
100
+ * Whether the server refuses to serve this table when the database does not
101
+ * enforce its `rls`: the table's `rlsRequired`, else its database's
102
+ * `rls.required`, else yes.
103
+ */
104
+ export declare function rlsRequiredFor(descriptor: Pick<TableDescriptor, "rls" | "database">): boolean;
93
105
  /** What {@link findUnprotectedServedTables} renders the policies with — the boot's admin switch. */
94
106
  export interface ServedTableProtectionOptions {
95
107
  /** The driver's admin switch is live: admin policies go `TO rebase_admin`. */
@@ -116,6 +128,11 @@ export declare function withheldTableMessage(table: Pick<UnprotectedServedTable,
116
128
  * per table, with the statements that protect it, and what to run instead.
117
129
  */
118
130
  export declare function withholdUnprotectedTables(registry: PostgresTableRegistry, found: readonly UnprotectedServedTable[]): void;
131
+ /**
132
+ * Say, in one line, which tables are served although the database does not
133
+ * protect them, because their declaration does not require it.
134
+ */
135
+ export declare function warnServedUnprotectedTables(found: readonly UnprotectedServedTable[]): void;
119
136
  /**
120
137
  * Say, once per table, that it is served with some of its declared permissive
121
138
  * policies missing: those callers are refused rows the schema grants them. It
@@ -1,7 +1,7 @@
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 reapSilentSockets, at as SQL_RESULT_BYTE_BUDGET, ct as resolveNestedPath, it as sqlRoleRanAs, j as terminateIfBacklogged, k as budgetSendBuffers, lt as assertReadRequestReadable, nt as effectiveSqlRole, ot as SqlResultTooLargeError, st as isNestedPath } from "./open-rebase-OB4hhQuk.js";
4
+ import { A as reapSilentSockets, at as SQL_RESULT_BYTE_BUDGET, ct as resolveNestedPath, it as sqlRoleRanAs, j as terminateIfBacklogged, k as budgetSendBuffers, lt as assertReadRequestReadable, nt as effectiveSqlRole, ot as SqlResultTooLargeError, st as isNestedPath } from "./open-rebase-x3yAPy5g.js";
5
5
  import { r as BranchingUnsupportedError } from "./BranchService-Bdin0Wxh.js";
6
6
  import { ApiError, DATABASE_UNAVAILABLE_MESSAGE, RUNTIME_DEFAULT_MAX_BODY_SIZE, assertFieldOpsValid, assertNestedWriteAllowed, assertNoFieldOpsOnCreate, assertNoUserUpsert, assertUserCreationBodyValid, assertWriteRequestValid, createUserThroughAuthTable, decideImpersonation, declaredErrorAnswer, extractUserFromToken, getAccessModel, isAuthTable, isDatabaseUnreachable, logger, resolveConflictTarget, resolveRequireAuth, safeCompare } from "@rebasepro/server";
7
7
  import { ANONYMOUS_USER_ID, ListLimitError, hasAdminRole, isSQLAdmin, isSchemaAdmin, resolveClientListLimit, scopeGrants, scopesForRoles } from "@rebasepro/types";
@@ -1709,4 +1709,4 @@ function createPostgresWebSocket(server, realtimeService, driver, authConfig, au
1709
1709
  //#endregion
1710
1710
  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 };
1711
1711
 
1712
- //# sourceMappingURL=websocket-kZixcOXt.js.map
1712
+ //# sourceMappingURL=websocket-DAVDn7Ki.js.map