gencow 0.1.299 → 0.2.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/bin/gencow.mjs +0 -6
- package/core/package.json +1 -1
- package/docs/packaging.md +14 -4
- package/lib/cli-artifact-guard.mjs +53 -3
- package/lib/cli-dev-runtime.mjs +1 -0
- package/lib/cli-project-runtime.mjs +26 -14
- package/lib/codegen-command.mjs +16 -0
- package/lib/coding-guardrails.mjs +2 -0
- package/lib/dashboard-artifact.mjs +65 -0
- package/lib/dashboard-assets.mjs +20 -0
- package/lib/db-command.mjs +121 -80
- package/lib/db-migration-command-steps.mjs +19 -16
- package/lib/db-push-command.mjs +1 -1
- package/lib/deploy-codegen-preflight.mjs +1 -0
- package/lib/dev-cloud-command.mjs +1 -1
- package/lib/dev-local-command.mjs +19 -56
- package/lib/document-local-converter.mjs +11 -0
- package/lib/local-dashboard-plan.mjs +60 -0
- package/lib/local-database-commands.mjs +127 -0
- package/lib/local-development-migrations.mjs +157 -0
- package/lib/local-drizzle-database.config.mjs +10 -0
- package/lib/local-runtime-features.mjs +12 -0
- package/lib/rag-selection.mjs +7 -0
- package/lib/runtime-local-worker.mjs +116 -0
- package/lib/runtime-mode.mjs +3 -0
- package/lib/standalone-codegen-adapter.mjs +91 -0
- package/lib/ts-codegen-import-extension.mjs +228 -19
- package/package.json +16 -9
- package/runtime/config.mjs +218 -2
- package/runtime/engine/chunk-2HA4CUMS.mjs +90 -0
- package/runtime/engine/chunk-2JLO3KMM.mjs +305 -0
- package/runtime/engine/chunk-2SR2M7SR.mjs +1045 -0
- package/runtime/engine/chunk-3D7MHEUC.mjs +253 -0
- package/runtime/engine/chunk-3R7COBWG.mjs +309 -0
- package/runtime/engine/chunk-3ZKA54UW.mjs +1560 -0
- package/runtime/engine/chunk-45I4YR2J.mjs +9 -0
- package/runtime/engine/chunk-4MLRXO7F.mjs +74 -0
- package/runtime/engine/chunk-5575APCJ.mjs +215 -0
- package/runtime/engine/chunk-5GUJZQF3.mjs +114 -0
- package/runtime/engine/chunk-5MXY3T75.mjs +428 -0
- package/runtime/engine/chunk-5TACQ2US.mjs +44 -0
- package/runtime/engine/chunk-66G4YEDT.mjs +3104 -0
- package/runtime/engine/chunk-67YO53WW.mjs +1426 -0
- package/runtime/engine/chunk-6GQRM7XY.mjs +87 -0
- package/runtime/engine/chunk-6JO72SPP.mjs +68 -0
- package/runtime/engine/chunk-6W653LXI.mjs +13 -0
- package/runtime/engine/chunk-7ITSMI3S.mjs +69 -0
- package/runtime/engine/chunk-7KUJ2H2S.mjs +128 -0
- package/runtime/engine/chunk-A5BMQ5IC.mjs +45 -0
- package/runtime/engine/chunk-ADF3UR6L.mjs +428 -0
- package/runtime/engine/chunk-AEBW7XZJ.mjs +4510 -0
- package/runtime/engine/chunk-AGPQ5XIV.mjs +156 -0
- package/runtime/engine/chunk-CPU4OZSX.mjs +753 -0
- package/runtime/engine/chunk-CSWPPWBL.mjs +50 -0
- package/runtime/engine/chunk-DPWXSMWO.mjs +53 -0
- package/runtime/engine/chunk-EAIELFKU.mjs +151 -0
- package/runtime/engine/chunk-EDU5CBKT.mjs +10 -0
- package/runtime/engine/chunk-EQCTAET7.mjs +173 -0
- package/runtime/engine/chunk-EQCXDF2Z.mjs +70 -0
- package/runtime/engine/chunk-F3G4UGV4.mjs +330 -0
- package/runtime/engine/chunk-F62NUNOO.mjs +26 -0
- package/runtime/engine/chunk-FKPNIFRP.mjs +2492 -0
- package/runtime/engine/chunk-FM23RGVI.mjs +81 -0
- package/runtime/engine/chunk-FW5AK4YP.mjs +1041 -0
- package/runtime/engine/chunk-GDWYAGWV.mjs +23 -0
- package/runtime/engine/chunk-GO5PZUYW.mjs +53 -0
- package/runtime/engine/chunk-GOLP7OSG.mjs +340 -0
- package/runtime/engine/chunk-GSLM44EF.mjs +242 -0
- package/runtime/engine/chunk-GYAJ7OX2.mjs +125 -0
- package/runtime/engine/chunk-I3GWR43K.mjs +14 -0
- package/runtime/engine/chunk-IFMOTJNU.mjs +106 -0
- package/runtime/engine/chunk-IKQKBE2G.mjs +128 -0
- package/runtime/engine/chunk-ITH2NEKM.mjs +282 -0
- package/runtime/engine/chunk-J6SDRCG4.mjs +96 -0
- package/runtime/engine/chunk-JODRNM3S.mjs +29596 -0
- package/runtime/engine/chunk-JUDKX53X.mjs +137 -0
- package/runtime/engine/chunk-K2YZVPJ4.mjs +827 -0
- package/runtime/engine/chunk-KEZJUXEE.mjs +151 -0
- package/runtime/engine/chunk-KVLTJFCH.mjs +234 -0
- package/runtime/engine/chunk-KX2PRQPS.mjs +126 -0
- package/runtime/engine/chunk-LEW5ZMLR.mjs +76 -0
- package/runtime/engine/chunk-LINVSJEM.mjs +175 -0
- package/runtime/engine/chunk-M7K2ICSM.mjs +11 -0
- package/runtime/engine/chunk-MZXDXSDC.mjs +292 -0
- package/runtime/engine/chunk-N2TA2IK2.mjs +678 -0
- package/runtime/engine/chunk-N4LTCKJP.mjs +695 -0
- package/runtime/engine/chunk-N6GCLOUX.mjs +13 -0
- package/runtime/engine/chunk-NAG2OXS5.mjs +37 -0
- package/runtime/engine/chunk-NNZ2QJUG.mjs +381 -0
- package/runtime/engine/chunk-NZPPLDNW.mjs +15 -0
- package/runtime/engine/chunk-ODWM57W6.mjs +138 -0
- package/runtime/engine/chunk-P5IIXAIE.mjs +23 -0
- package/runtime/engine/chunk-PBOXB2BV.mjs +6 -0
- package/runtime/engine/chunk-PMOJLN2P.mjs +8 -0
- package/runtime/engine/chunk-PZFMKFHO.mjs +180 -0
- package/runtime/engine/chunk-QL2TQX2N.mjs +114 -0
- package/runtime/engine/chunk-RITT2RSJ.mjs +258 -0
- package/runtime/engine/chunk-RODBVJ5M.mjs +135 -0
- package/runtime/engine/chunk-RW65MPVY.mjs +261 -0
- package/runtime/engine/chunk-S67UYPB6.mjs +25 -0
- package/runtime/engine/chunk-SVJCOUI3.mjs +47 -0
- package/runtime/engine/chunk-TCN3ZASV.mjs +957 -0
- package/runtime/engine/chunk-U2NRG6KC.mjs +32 -0
- package/runtime/engine/chunk-UM3F7HUV.mjs +432 -0
- package/runtime/engine/chunk-VWU7JJ3P.mjs +146 -0
- package/runtime/engine/chunk-WDTKPPMU.mjs +310 -0
- package/runtime/engine/chunk-WJOO4XTB.mjs +31 -0
- package/runtime/engine/chunk-XNFVL2OY.mjs +63 -0
- package/runtime/engine/chunk-XPWJXP2J.mjs +58 -0
- package/runtime/engine/chunk-Y3HSBJ3I.mjs +1132 -0
- package/runtime/engine/chunk-YMH4RYSX.mjs +317 -0
- package/runtime/engine/chunk-YNOMPSGS.mjs +8 -0
- package/runtime/engine/chunk-YRBAYTEZ.mjs +251 -0
- package/runtime/engine/chunk-YRHM272W.mjs +528 -0
- package/runtime/engine/chunk-ZQUZAGIQ.mjs +149 -0
- package/runtime/engine/chunk-ZXMM7QFP.mjs +176 -0
- package/runtime/engine/chunk-ZZJSIPV2.mjs +262 -0
- package/runtime/engine/composition.mjs +325 -0
- package/runtime/engine/document-local.mjs +504 -0
- package/runtime/engine/graph.json +4134 -0
- package/runtime/engine/index.mjs +265 -0
- package/runtime/engine/local-postgres-support.mjs +69 -0
- package/runtime/engine/local.mjs +3275 -0
- package/runtime/engine/pglite-directory-lock.mjs +8 -0
- package/runtime/engine/rag.mjs +11 -0
- package/runtime/engine/search.mjs +18 -0
- package/runtime/framework-migrations/foundation-bootstrap/rag.sql +115 -0
- package/runtime/framework-migrations/foundation-bootstrap/workflow.sql +194 -0
- package/runtime/framework-migrations/journal-bootstrap/migration.sql +26 -0
- package/runtime/framework-migrations/manifest.json +56 -0
- package/runtime/framework-migrations/rag/20261006111509_mushy_warhawk/migration.sql +121 -0
- package/runtime/framework-migrations/rag/20261013234621_rag_v2_lifecycle_markers/migration.sql +6 -0
- package/runtime/framework-migrations/workflow/20261006111508_perpetual_star_brand/migration.sql +31 -0
- package/runtime/runtime-metadata.json +27 -0
- package/runtime/tooling.mjs +10399 -8951
- package/scripts/bundle-runtime-config.mjs +23 -0
- package/scripts/bundle-runtime.mjs +100 -0
- package/scripts/bundle-runtime.test.mjs +33 -0
- package/scripts/bundle-shared.mjs +3 -0
- package/scripts/copy-dashboard.mjs +16 -0
- package/scripts/pre-publish-check.mjs +23 -11
- package/templateFeature/sso/sso-auth-callback.tsx +37 -5
- package/templateFeature/tools/manifest.json +2 -1
- package/templateFeature/tools/tools.ts +3 -3
- package/runtime/server.mjs +0 -14389
- package/scripts/bundle-server.mjs +0 -223
- package/server/config.js +0 -1
- package/server/index.js +0 -1
- package/server/package.json +0 -6
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import {
|
|
2
|
+
captureDatabaseSecurityPolicy,
|
|
3
|
+
evaluateDatabaseSecurityPolicy,
|
|
4
|
+
verifyCapturedDatabaseSecurityPolicy
|
|
5
|
+
} from "./chunk-ITH2NEKM.mjs";
|
|
6
|
+
import {
|
|
7
|
+
isServerCompatibleLocalStartup
|
|
8
|
+
} from "./chunk-I3GWR43K.mjs";
|
|
9
|
+
import {
|
|
10
|
+
RuntimeDatabaseRlsError,
|
|
11
|
+
RuntimeDiagnosticError
|
|
12
|
+
} from "./chunk-AEBW7XZJ.mjs";
|
|
13
|
+
|
|
14
|
+
// ../runtime/dist/adapters/database/postgres-local-security.js
|
|
15
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
16
|
+
|
|
17
|
+
// ../runtime/dist/adapters/database/postgres-startup-errors.js
|
|
18
|
+
import { randomUUID } from "node:crypto";
|
|
19
|
+
function postgresStartupCapacity(error) {
|
|
20
|
+
if (!(error instanceof Error) || Reflect.get(error, "code") !== "53300" && Reflect.get(error, "errno") !== "53300")
|
|
21
|
+
return;
|
|
22
|
+
return new RuntimeDiagnosticError({
|
|
23
|
+
code: "RUNTIME_DATABASE_CONNECTION_CAPACITY_EXCEEDED",
|
|
24
|
+
stage: "startup",
|
|
25
|
+
capability: "database",
|
|
26
|
+
servingStarted: false,
|
|
27
|
+
dataImpact: "none",
|
|
28
|
+
retryable: false,
|
|
29
|
+
retryPrecondition: "Reduce the combined pool budget across running Runtime generations, or wait until the database owner restores available connection capacity, before restarting.",
|
|
30
|
+
nextAction: "Review the max URL parameter in both PostgreSQL login bindings. Each Runtime generation owns two pools; their combined budgets must fit the database owner's available connection capacity. Reduce max before restarting, or wait for capacity restoration. Existing serving generations and user data were not changed.",
|
|
31
|
+
correlationId: randomUUID()
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ../runtime/dist/adapters/database/postgres-local-security.js
|
|
36
|
+
function observed(value) {
|
|
37
|
+
return Object.freeze({ status: "observed", value });
|
|
38
|
+
}
|
|
39
|
+
var unavailable = Object.freeze({ status: "unavailable" });
|
|
40
|
+
function assessLocalPostgresSecurityPolicy(candidate, facts, warnings) {
|
|
41
|
+
const evaluation = evaluateDatabaseSecurityPolicy(candidate, facts);
|
|
42
|
+
try {
|
|
43
|
+
warnings?.observePolicyAssessment?.(evaluation);
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
return evaluation;
|
|
47
|
+
}
|
|
48
|
+
function policyError(candidate, result) {
|
|
49
|
+
const admitted = verifyCapturedDatabaseSecurityPolicy(candidate);
|
|
50
|
+
const policy = admitted.ok ? admitted.policy : void 0;
|
|
51
|
+
const failure = result.ok ? void 0 : result.reason;
|
|
52
|
+
const denied = result.ok ? result.denials : [];
|
|
53
|
+
const unavailableFinding = denied.some(({ id }) => id === "security-evidence-unavailable");
|
|
54
|
+
const code = !result.ok || denied.length === 0 ? "RUNTIME_DATABASE_SECURITY_POLICY_INVALID" : unavailableFinding ? "RUNTIME_DATABASE_SECURITY_POLICY_EVIDENCE_UNAVAILABLE" : "RUNTIME_DATABASE_SECURITY_POLICY_DENIED";
|
|
55
|
+
const priorityFinding = denied.find(({ id }) => id === "security-evidence-unavailable") ?? denied[0];
|
|
56
|
+
const nextAction = priorityFinding?.nextAction ?? "Use a matching Runtime and CLI policy definition, restore trusted PostgreSQL security metadata visibility, and restart before relying on the local database. Preserve application data and applied migration history.";
|
|
57
|
+
return new RuntimeDiagnosticError({
|
|
58
|
+
code,
|
|
59
|
+
stage: "startup",
|
|
60
|
+
servingStarted: false,
|
|
61
|
+
dataImpact: "none",
|
|
62
|
+
capability: "database",
|
|
63
|
+
retryable: false,
|
|
64
|
+
retryPrecondition: unavailableFinding || failure === "facts-invalid" ? "Restore trusted PostgreSQL security metadata visibility and restart for a fresh assessment." : "Correct trusted local database policy selection or the observed database role posture before restarting.",
|
|
65
|
+
nextAction,
|
|
66
|
+
correlationId: randomUUID2(),
|
|
67
|
+
...policy ? { databaseSecurityPolicy: { id: policy.id, version: policy.version } } : {},
|
|
68
|
+
...result.ok ? { databaseSecurityStage: result.stage, databaseSecurityComplete: result.complete } : {},
|
|
69
|
+
...result.ok ? { databaseSecurityFindingIds: Object.freeze([...new Set(denied.map(({ id }) => id))]) } : {},
|
|
70
|
+
...failure ? { databaseSecurityPolicyFailure: failure } : {}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function assertLocalPostgresSecurityPolicy(candidate, facts, warnings) {
|
|
74
|
+
const evaluation = assessLocalPostgresSecurityPolicy(candidate, facts, warnings);
|
|
75
|
+
if (!isServerCompatibleLocalStartup() && (!evaluation.ok || evaluation.denials.length > 0))
|
|
76
|
+
throw policyError(candidate, evaluation);
|
|
77
|
+
return evaluation;
|
|
78
|
+
}
|
|
79
|
+
async function identity(client) {
|
|
80
|
+
const rows = await client`SELECT current_user, pg_catalog.current_database()`;
|
|
81
|
+
if (!rows[0]?.current_user || !rows[0].current_database)
|
|
82
|
+
throw new Error("identity unavailable");
|
|
83
|
+
return rows[0];
|
|
84
|
+
}
|
|
85
|
+
async function securityIdentity(client) {
|
|
86
|
+
try {
|
|
87
|
+
const rows = await client`SELECT current_user, pg_catalog.current_database()`;
|
|
88
|
+
return rows[0]?.current_user && rows[0].current_database ? rows[0] : void 0;
|
|
89
|
+
} catch {
|
|
90
|
+
return void 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function applicationSecurity(client, role) {
|
|
94
|
+
try {
|
|
95
|
+
const rows = await client`
|
|
96
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
97
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
98
|
+
UNION
|
|
99
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
100
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
101
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
102
|
+
)
|
|
103
|
+
SELECT
|
|
104
|
+
actor.rolsuper OR actor.rolbypassrls OR EXISTS (
|
|
105
|
+
SELECT 1 FROM pg_catalog.pg_roles elevated WHERE (elevated.rolsuper OR elevated.rolbypassrls)
|
|
106
|
+
AND elevated.oid IN (SELECT oid FROM reachable_roles)) AS bypass,
|
|
107
|
+
EXISTS (SELECT 1 FROM pg_catalog.pg_class relation JOIN pg_catalog.pg_namespace namespace ON namespace.oid=relation.relnamespace
|
|
108
|
+
WHERE namespace.nspname NOT IN ('pg_catalog','information_schema') AND namespace.nspname NOT LIKE 'pg_toast%'
|
|
109
|
+
AND relation.relkind IN ('r','p') AND relation.relowner=actor.oid) AS owner,
|
|
110
|
+
EXISTS (SELECT 1 FROM pg_catalog.pg_class relation JOIN pg_catalog.pg_namespace namespace ON namespace.oid=relation.relnamespace
|
|
111
|
+
WHERE namespace.nspname NOT IN ('pg_catalog','information_schema') AND namespace.nspname NOT LIKE 'pg_toast%'
|
|
112
|
+
AND relation.relkind IN ('r','p') AND relation.relowner<>actor.oid AND EXISTS (
|
|
113
|
+
SELECT 1 FROM reachable_roles candidate WHERE candidate.oid=relation.relowner OR pg_catalog.pg_has_role(candidate.oid,relation.relowner,'USAGE'))) AS owner_membership,
|
|
114
|
+
EXISTS (SELECT 1 FROM pg_catalog.pg_class relation JOIN pg_catalog.pg_namespace namespace ON namespace.oid=relation.relnamespace
|
|
115
|
+
WHERE namespace.nspname NOT IN ('pg_catalog','information_schema') AND namespace.nspname NOT LIKE 'pg_toast%'
|
|
116
|
+
AND relation.relkind IN ('r','p') AND relation.relrowsecurity AND relation.relowner<>actor.oid AND EXISTS (
|
|
117
|
+
SELECT 1 FROM reachable_roles candidate WHERE candidate.oid=relation.relowner OR pg_catalog.pg_has_role(candidate.oid,relation.relowner,'USAGE'))) AS rls_owner_membership,
|
|
118
|
+
EXISTS (SELECT 1 FROM pg_catalog.pg_namespace namespace WHERE namespace.nspname NOT IN ('pg_catalog','information_schema')
|
|
119
|
+
AND namespace.nspname NOT LIKE 'pg_%' AND EXISTS (SELECT 1 FROM reachable_roles candidate
|
|
120
|
+
WHERE pg_catalog.has_schema_privilege(candidate.oid,namespace.oid,'CREATE'))) AS schema_create
|
|
121
|
+
FROM pg_catalog.pg_roles actor WHERE actor.rolname=${role}
|
|
122
|
+
`;
|
|
123
|
+
const row = rows[0];
|
|
124
|
+
if (!row || [row.bypass, row.owner, row.owner_membership, row.rls_owner_membership, row.schema_create].some((value) => typeof value !== "boolean"))
|
|
125
|
+
return void 0;
|
|
126
|
+
return row;
|
|
127
|
+
} catch {
|
|
128
|
+
return void 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async function maintenanceSecurity(client, role, applicationRole) {
|
|
132
|
+
try {
|
|
133
|
+
const rows = await client`
|
|
134
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
135
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
136
|
+
UNION
|
|
137
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
138
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
139
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
140
|
+
)
|
|
141
|
+
SELECT actor.rolbypassrls OR actor.rolsuper OR EXISTS (
|
|
142
|
+
SELECT 1 FROM pg_catalog.pg_roles elevated WHERE (elevated.rolsuper OR elevated.rolbypassrls)
|
|
143
|
+
AND elevated.oid IN (SELECT oid FROM reachable_roles)) AS bypass,
|
|
144
|
+
actor.rolsuper AS superuser,
|
|
145
|
+
(SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${applicationRole}) IN (SELECT oid FROM reachable_roles) AS can_assume_application
|
|
146
|
+
FROM pg_catalog.pg_roles actor WHERE actor.rolname=${role}
|
|
147
|
+
`;
|
|
148
|
+
const row = rows[0];
|
|
149
|
+
if (!row || [row.bypass, row.superuser, row.can_assume_application].some((value) => typeof value !== "boolean"))
|
|
150
|
+
return void 0;
|
|
151
|
+
return row;
|
|
152
|
+
} catch {
|
|
153
|
+
return void 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async function setupSecurity(client, role, applicationRole, maintenanceRole) {
|
|
157
|
+
try {
|
|
158
|
+
const rows = await client`
|
|
159
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
160
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
161
|
+
UNION
|
|
162
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
163
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
164
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
165
|
+
)
|
|
166
|
+
SELECT actor.rolsuper AS superuser,
|
|
167
|
+
(SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${applicationRole}) IN (SELECT oid FROM reachable_roles) AS can_assume_application,
|
|
168
|
+
(SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${maintenanceRole}) IN (SELECT oid FROM reachable_roles) AS can_assume_maintenance
|
|
169
|
+
FROM pg_catalog.pg_roles actor WHERE actor.rolname=${role}
|
|
170
|
+
`;
|
|
171
|
+
const row = rows[0];
|
|
172
|
+
if (!row || [row.superuser, row.can_assume_application, row.can_assume_maintenance].some((value) => typeof value !== "boolean"))
|
|
173
|
+
return void 0;
|
|
174
|
+
return row;
|
|
175
|
+
} catch {
|
|
176
|
+
return void 0;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function canReachRole(client, role, targetRole) {
|
|
180
|
+
try {
|
|
181
|
+
const rows = await client`
|
|
182
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
183
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
184
|
+
UNION
|
|
185
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
186
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
187
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
188
|
+
)
|
|
189
|
+
SELECT (SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${targetRole}) IN (SELECT oid FROM reachable_roles) AS reachable
|
|
190
|
+
`;
|
|
191
|
+
return typeof rows[0]?.reachable === "boolean" ? rows[0].reachable : void 0;
|
|
192
|
+
} catch {
|
|
193
|
+
return void 0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async function relationOwnerReachability(client, role, relation, expectedOwner) {
|
|
197
|
+
try {
|
|
198
|
+
const rows = await client`
|
|
199
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
200
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
201
|
+
UNION
|
|
202
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
203
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
204
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
205
|
+
)
|
|
206
|
+
SELECT pg_catalog.pg_get_userbyid(relation.relowner) AS owner,
|
|
207
|
+
EXISTS (SELECT 1 FROM reachable_roles candidate WHERE candidate.oid=relation.relowner
|
|
208
|
+
OR pg_catalog.pg_has_role(candidate.oid,relation.relowner,'USAGE')) AS reachable
|
|
209
|
+
FROM pg_catalog.pg_class relation JOIN pg_catalog.pg_namespace namespace ON namespace.oid=relation.relnamespace
|
|
210
|
+
WHERE namespace.nspname=${relation.schema} AND relation.relname=${relation.name} AND relation.relkind IN ('r','p')
|
|
211
|
+
`;
|
|
212
|
+
const row = rows[0];
|
|
213
|
+
if (!row)
|
|
214
|
+
return Object.freeze({ exists: false });
|
|
215
|
+
if (typeof row.owner !== "string" || typeof row.reachable !== "boolean" || expectedOwner && row.owner !== expectedOwner)
|
|
216
|
+
return void 0;
|
|
217
|
+
return Object.freeze({ exists: true, owner: row.owner, reachable: row.reachable });
|
|
218
|
+
} catch {
|
|
219
|
+
return void 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async function journalMutationPrivilege(client, role, relation, expectedOwner) {
|
|
223
|
+
try {
|
|
224
|
+
const rows = await client`
|
|
225
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
226
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
227
|
+
UNION
|
|
228
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
229
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
230
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
231
|
+
)
|
|
232
|
+
SELECT pg_catalog.pg_get_userbyid(relation.relowner) AS owner,
|
|
233
|
+
relation.relowner IN (SELECT oid FROM reachable_roles) OR EXISTS (
|
|
234
|
+
SELECT 1 FROM reachable_roles candidate WHERE pg_catalog.has_table_privilege(candidate.oid,relation.oid,'INSERT')
|
|
235
|
+
OR pg_catalog.has_table_privilege(candidate.oid,relation.oid,'UPDATE')
|
|
236
|
+
OR pg_catalog.has_table_privilege(candidate.oid,relation.oid,'DELETE')
|
|
237
|
+
OR pg_catalog.has_table_privilege(candidate.oid,relation.oid,'TRUNCATE')) AS can_mutate
|
|
238
|
+
FROM pg_catalog.pg_class relation JOIN pg_catalog.pg_namespace namespace ON namespace.oid=relation.relnamespace
|
|
239
|
+
WHERE namespace.nspname=${relation.schema} AND relation.relname=${relation.name} AND relation.relkind IN ('r','p')
|
|
240
|
+
`;
|
|
241
|
+
const row = rows[0];
|
|
242
|
+
if (!row)
|
|
243
|
+
return void 0;
|
|
244
|
+
if (typeof row.owner !== "string" || typeof row.can_mutate !== "boolean" || expectedOwner && row.owner !== expectedOwner)
|
|
245
|
+
return void 0;
|
|
246
|
+
return row.can_mutate;
|
|
247
|
+
} catch {
|
|
248
|
+
return void 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async function defaultJournalMutationPrivilege(client, role, setupRole, schema) {
|
|
252
|
+
try {
|
|
253
|
+
const rows = await client`
|
|
254
|
+
WITH RECURSIVE reachable_roles(oid) AS (
|
|
255
|
+
SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${role}
|
|
256
|
+
UNION
|
|
257
|
+
SELECT candidate.oid FROM pg_catalog.pg_roles candidate JOIN reachable_roles actor ON
|
|
258
|
+
pg_catalog.pg_has_role(actor.oid,candidate.oid,CASE WHEN pg_catalog.current_setting('server_version_num')::integer >= 160000 THEN 'SET' ELSE 'MEMBER' END)
|
|
259
|
+
OR pg_catalog.pg_has_role(actor.oid,candidate.oid,'MEMBER WITH ADMIN OPTION')
|
|
260
|
+
)
|
|
261
|
+
SELECT EXISTS (
|
|
262
|
+
SELECT 1 FROM pg_catalog.pg_default_acl defaults
|
|
263
|
+
CROSS JOIN LATERAL pg_catalog.aclexplode(defaults.defaclacl) acl
|
|
264
|
+
WHERE defaults.defaclrole=(SELECT oid FROM pg_catalog.pg_roles WHERE rolname=${setupRole})
|
|
265
|
+
AND defaults.defaclobjtype='r'
|
|
266
|
+
AND (defaults.defaclnamespace=0 OR defaults.defaclnamespace=COALESCE(
|
|
267
|
+
(SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=${schema}),0))
|
|
268
|
+
AND acl.privilege_type IN ('INSERT','UPDATE','DELETE','TRUNCATE')
|
|
269
|
+
AND (acl.grantee=0 OR acl.grantee IN (SELECT oid FROM reachable_roles))
|
|
270
|
+
) AS can_mutate
|
|
271
|
+
`;
|
|
272
|
+
return typeof rows[0]?.can_mutate === "boolean" ? rows[0].can_mutate : void 0;
|
|
273
|
+
} catch {
|
|
274
|
+
return void 0;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function validRelation(value) {
|
|
278
|
+
return typeof value.schema === "string" && typeof value.name === "string" && Buffer.byteLength(value.schema, "utf8") > 0 && Buffer.byteLength(value.schema, "utf8") <= 63 && Buffer.byteLength(value.name, "utf8") > 0 && Buffer.byteLength(value.name, "utf8") <= 63;
|
|
279
|
+
}
|
|
280
|
+
async function collectLocalPostgresSecurityObservation(input, knownIdentities) {
|
|
281
|
+
const [applicationActor, maintenanceActor, setupActor] = knownIdentities ? [
|
|
282
|
+
knownIdentities.application,
|
|
283
|
+
knownIdentities.maintenance,
|
|
284
|
+
input.setup ? await securityIdentity(input.setup) : void 0
|
|
285
|
+
] : await Promise.all([
|
|
286
|
+
securityIdentity(input.application),
|
|
287
|
+
securityIdentity(input.maintenance),
|
|
288
|
+
input.setup ? securityIdentity(input.setup) : Promise.resolve(void 0)
|
|
289
|
+
]);
|
|
290
|
+
const identities = Object.freeze({
|
|
291
|
+
...applicationActor ? { application: applicationActor } : {},
|
|
292
|
+
...maintenanceActor ? { maintenance: maintenanceActor } : {},
|
|
293
|
+
...setupActor ? { setup: setupActor } : {}
|
|
294
|
+
});
|
|
295
|
+
const actorsShareTarget = Boolean(applicationActor && maintenanceActor && applicationActor.current_database === maintenanceActor.current_database && (!input.setup || setupActor && setupActor.current_database === applicationActor.current_database));
|
|
296
|
+
const selectedObjectEvidence = input.setup ?? input.application;
|
|
297
|
+
const appSecurity = actorsShareTarget && applicationActor ? await applicationSecurity(selectedObjectEvidence, applicationActor.current_user) : void 0;
|
|
298
|
+
const maintenanceFacts = actorsShareTarget && maintenanceActor && applicationActor ? await maintenanceSecurity(selectedObjectEvidence, maintenanceActor.current_user, applicationActor.current_user) : void 0;
|
|
299
|
+
const setupFacts = actorsShareTarget && setupActor && applicationActor && maintenanceActor ? await setupSecurity(input.setup, setupActor.current_user, applicationActor.current_user, maintenanceActor.current_user) : void 0;
|
|
300
|
+
const facts = {
|
|
301
|
+
"shared-operational-principal": actorsShareTarget && applicationActor && maintenanceActor ? observed(applicationActor.current_user === maintenanceActor.current_user) : unavailable,
|
|
302
|
+
"setup-shares-operational-principal": !input.setup ? Object.freeze({ status: "not-applicable" }) : actorsShareTarget && setupActor && applicationActor && maintenanceActor ? observed(setupActor.current_user === applicationActor.current_user || setupActor.current_user === maintenanceActor.current_user) : unavailable,
|
|
303
|
+
"application-owns-nonsystem-table": appSecurity ? observed(appSecurity.owner || appSecurity.owner_membership) : unavailable,
|
|
304
|
+
"application-reaches-rls-owner": appSecurity ? observed(appSecurity.rls_owner_membership) : unavailable,
|
|
305
|
+
"application-privileged": appSecurity ? observed(appSecurity.bypass) : unavailable,
|
|
306
|
+
"application-can-create-schema": appSecurity ? observed(appSecurity.schema_create) : unavailable,
|
|
307
|
+
"maintenance-bypasses-rls": maintenanceFacts ? observed(maintenanceFacts.bypass) : unavailable,
|
|
308
|
+
"maintenance-unauthorized-elevation": maintenanceFacts ? observed(maintenanceFacts.superuser || maintenanceFacts.can_assume_application) : unavailable,
|
|
309
|
+
"setup-unauthorized-elevation": !input.setup ? Object.freeze({ status: "not-applicable" }) : setupFacts ? observed(setupFacts.superuser || setupFacts.can_assume_application || setupFacts.can_assume_maintenance) : unavailable
|
|
310
|
+
};
|
|
311
|
+
const legacyReasons = [];
|
|
312
|
+
if (facts["shared-operational-principal"]?.status === "observed" && facts["shared-operational-principal"].value)
|
|
313
|
+
legacyReasons.push("shared-serving-role");
|
|
314
|
+
if (appSecurity?.bypass)
|
|
315
|
+
legacyReasons.push("application-rls-bypass");
|
|
316
|
+
if (appSecurity?.owner)
|
|
317
|
+
legacyReasons.push("application-owner");
|
|
318
|
+
if (appSecurity?.owner_membership)
|
|
319
|
+
legacyReasons.push("application-owner-membership");
|
|
320
|
+
if (appSecurity?.schema_create)
|
|
321
|
+
legacyReasons.push("application-schema-create");
|
|
322
|
+
if (!appSecurity || !maintenanceFacts || input.setup && !setupFacts)
|
|
323
|
+
legacyReasons.push("security-observation-unavailable");
|
|
324
|
+
if (!input.selectedRag?.length) {
|
|
325
|
+
facts["serving-reaches-selected-rag-owner"] = Object.freeze({ status: "not-applicable" });
|
|
326
|
+
} else if (!applicationActor || !actorsShareTarget || input.selectedRag.some((relation) => !validRelation(relation))) {
|
|
327
|
+
facts["serving-reaches-selected-rag-owner"] = unavailable;
|
|
328
|
+
} else {
|
|
329
|
+
let reachable = false;
|
|
330
|
+
let unavailableEvidence = false;
|
|
331
|
+
let observedRelations = 0;
|
|
332
|
+
for (const relation of input.selectedRag) {
|
|
333
|
+
const result = await relationOwnerReachability(selectedObjectEvidence, applicationActor.current_user, relation);
|
|
334
|
+
if (result?.exists) {
|
|
335
|
+
observedRelations++;
|
|
336
|
+
reachable ||= result.reachable === true;
|
|
337
|
+
} else if (result && !result.exists && setupActor) {
|
|
338
|
+
const prospective = await canReachRole(selectedObjectEvidence, applicationActor.current_user, setupActor.current_user);
|
|
339
|
+
if (prospective === true)
|
|
340
|
+
reachable = true;
|
|
341
|
+
else if (prospective === void 0)
|
|
342
|
+
unavailableEvidence = true;
|
|
343
|
+
} else if (result && !result.exists && input.stage === "preparation" && !input.setup) {
|
|
344
|
+
} else
|
|
345
|
+
unavailableEvidence = true;
|
|
346
|
+
}
|
|
347
|
+
facts["serving-reaches-selected-rag-owner"] = reachable ? observed(true) : unavailableEvidence ? unavailable : observedRelations === 0 && input.stage === "preparation" && !input.setup ? Object.freeze({ status: "not-applicable" }) : observed(false);
|
|
348
|
+
}
|
|
349
|
+
if (!input.frameworkJournal) {
|
|
350
|
+
facts["application-reaches-framework-journal-owner"] = Object.freeze({ status: "not-applicable" });
|
|
351
|
+
facts["application-can-mutate-framework-journal"] = Object.freeze({ status: "not-applicable" });
|
|
352
|
+
} else if (!applicationActor || !actorsShareTarget || !validRelation(input.frameworkJournal)) {
|
|
353
|
+
facts["application-reaches-framework-journal-owner"] = unavailable;
|
|
354
|
+
facts["application-can-mutate-framework-journal"] = unavailable;
|
|
355
|
+
} else {
|
|
356
|
+
const relation = input.frameworkJournal;
|
|
357
|
+
const owner = await relationOwnerReachability(selectedObjectEvidence, applicationActor.current_user, relation, relation.owner);
|
|
358
|
+
if (owner?.exists) {
|
|
359
|
+
facts["application-reaches-framework-journal-owner"] = observed(owner.reachable === true);
|
|
360
|
+
const canMutate = await journalMutationPrivilege(selectedObjectEvidence, applicationActor.current_user, relation, relation.owner);
|
|
361
|
+
facts["application-can-mutate-framework-journal"] = typeof canMutate === "boolean" ? observed(canMutate) : unavailable;
|
|
362
|
+
} else if (owner && !owner.exists && setupActor) {
|
|
363
|
+
const prospective = await canReachRole(selectedObjectEvidence, applicationActor.current_user, setupActor.current_user);
|
|
364
|
+
facts["application-reaches-framework-journal-owner"] = typeof prospective === "boolean" ? observed(prospective) : unavailable;
|
|
365
|
+
if (prospective === true)
|
|
366
|
+
facts["application-can-mutate-framework-journal"] = observed(true);
|
|
367
|
+
else {
|
|
368
|
+
const canMutate = await defaultJournalMutationPrivilege(selectedObjectEvidence, applicationActor.current_user, setupActor.current_user, relation.schema);
|
|
369
|
+
facts["application-can-mutate-framework-journal"] = typeof canMutate === "boolean" ? observed(canMutate) : unavailable;
|
|
370
|
+
}
|
|
371
|
+
} else if (owner && !owner.exists && input.stage === "preparation" && !input.setup) {
|
|
372
|
+
facts["application-reaches-framework-journal-owner"] = Object.freeze({ status: "not-applicable" });
|
|
373
|
+
facts["application-can-mutate-framework-journal"] = Object.freeze({ status: "not-applicable" });
|
|
374
|
+
} else {
|
|
375
|
+
facts["application-reaches-framework-journal-owner"] = unavailable;
|
|
376
|
+
facts["application-can-mutate-framework-journal"] = unavailable;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return Object.freeze({
|
|
380
|
+
facts: Object.freeze({
|
|
381
|
+
stage: input.stage,
|
|
382
|
+
capabilities: Object.freeze({ maintenanceBypassRls: input.maintenanceBypassRls }),
|
|
383
|
+
facts: Object.freeze(facts)
|
|
384
|
+
}),
|
|
385
|
+
identities,
|
|
386
|
+
legacyReasons: Object.freeze(legacyReasons)
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
async function observeLocalPostgresSecurityFacts(input) {
|
|
390
|
+
return (await collectLocalPostgresSecurityObservation(input)).facts;
|
|
391
|
+
}
|
|
392
|
+
async function inspectLocalPostgresReadiness(application, maintenance, warnings, selectedPolicy) {
|
|
393
|
+
const captured = selectedPolicy ? verifyCapturedDatabaseSecurityPolicy(selectedPolicy) : captureDatabaseSecurityPolicy();
|
|
394
|
+
if (!captured.ok) {
|
|
395
|
+
const result = evaluateDatabaseSecurityPolicy(selectedPolicy, {
|
|
396
|
+
stage: "resource-admission",
|
|
397
|
+
capabilities: { maintenanceBypassRls: false },
|
|
398
|
+
facts: {}
|
|
399
|
+
});
|
|
400
|
+
throw policyError(selectedPolicy, result);
|
|
401
|
+
}
|
|
402
|
+
const policy = captured.policy;
|
|
403
|
+
let actors;
|
|
404
|
+
try {
|
|
405
|
+
actors = await Promise.all([identity(application), identity(maintenance)]);
|
|
406
|
+
} catch (error) {
|
|
407
|
+
throw postgresStartupCapacity(error) ?? new RuntimeDatabaseRlsError("RUNTIME_DATABASE_RLS_ROLE_CONFIG_INVALID", "startup", "Verify the configured database bindings can connect, then restart.");
|
|
408
|
+
}
|
|
409
|
+
if (actors[0].current_database !== actors[1].current_database)
|
|
410
|
+
throw new RuntimeDatabaseRlsError("RUNTIME_DATABASE_RLS_ROLE_CONFIG_INVALID", "startup", "Configure application and maintenance bindings for the same database, then restart.");
|
|
411
|
+
const observation = await collectLocalPostgresSecurityObservation({
|
|
412
|
+
application,
|
|
413
|
+
maintenance,
|
|
414
|
+
stage: "resource-admission",
|
|
415
|
+
maintenanceBypassRls: false
|
|
416
|
+
}, { application: actors[0], maintenance: actors[1] });
|
|
417
|
+
warnings.observe(observation.legacyReasons);
|
|
418
|
+
assertLocalPostgresSecurityPolicy(policy, observation.facts, warnings);
|
|
419
|
+
return Object.freeze([actors[0].current_user, actors[1].current_user]);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export {
|
|
423
|
+
postgresStartupCapacity,
|
|
424
|
+
assessLocalPostgresSecurityPolicy,
|
|
425
|
+
assertLocalPostgresSecurityPolicy,
|
|
426
|
+
observeLocalPostgresSecurityFacts,
|
|
427
|
+
inspectLocalPostgresReadiness
|
|
428
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RuntimeDiagnosticError
|
|
3
|
+
} from "./chunk-AEBW7XZJ.mjs";
|
|
4
|
+
|
|
5
|
+
// ../runtime/dist/rag/scope-input.js
|
|
6
|
+
var ragCorpusMaxLength = 1024;
|
|
7
|
+
function snapshotRagScopeInput(input) {
|
|
8
|
+
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
9
|
+
throw new Error("Invalid RAG scope");
|
|
10
|
+
const raw = input;
|
|
11
|
+
const corpus = raw.corpus, visibility = raw.visibility, owner = raw.ownerUserId;
|
|
12
|
+
if (typeof corpus !== "string" || corpus.length > ragCorpusMaxLength || !corpus.trim() || corpus.includes("\0") || typeof visibility !== "string" || !["private", "shared", "public"].includes(visibility) || owner !== void 0 && (typeof owner !== "string" || owner.includes("\0")))
|
|
13
|
+
throw new Error("Invalid RAG scope");
|
|
14
|
+
const ownerUserId = typeof owner === "string" ? owner.trim() || void 0 : void 0;
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
corpus: corpus.trim(),
|
|
17
|
+
visibility,
|
|
18
|
+
...ownerUserId === void 0 ? {} : { ownerUserId }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ../runtime/dist/rag/operation-errors.js
|
|
23
|
+
function ragOperationError(code, dataImpact = "none") {
|
|
24
|
+
const actions = {
|
|
25
|
+
RAG_INPUT_INVALID: "Supply a nonempty corpus, private/shared/public visibility, and JSON-object metadata. No RAG write was admitted for this invalid input.",
|
|
26
|
+
RAG_SCOPE_FORBIDDEN: "Use the authenticated owner's corpus scope. Do not supply another user's ownerUserId; no RAG write was admitted for this scope.",
|
|
27
|
+
RAG_OPERATION_UNAVAILABLE: "Inspect the same corpus policy and database readiness before retrying. A failed mutation acknowledgement does not prove rollback; do not recreate or delete existing RAG data."
|
|
28
|
+
};
|
|
29
|
+
return new RuntimeDiagnosticError({
|
|
30
|
+
code,
|
|
31
|
+
stage: "request",
|
|
32
|
+
capability: "application",
|
|
33
|
+
servingStarted: "unchanged",
|
|
34
|
+
dataImpact,
|
|
35
|
+
retryable: false,
|
|
36
|
+
retryPrecondition: code === "RAG_OPERATION_UNAVAILABLE" ? "Verify current policy and the selected database's availability before repeating the intended operation." : "Correct the input or authenticate as the intended corpus owner before resubmitting.",
|
|
37
|
+
nextAction: actions[code]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
snapshotRagScopeInput,
|
|
43
|
+
ragOperationError
|
|
44
|
+
};
|