@opengeni/db 3.4.0-canary.2 → 3.5.2-canary.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/canonical-human-identities.d.ts +20 -0
- package/dist/canonical-human-identities.js +7 -3
- package/dist/{chunk-C2AFP7SB.js → chunk-6NYKC5DD.js} +6507 -6040
- package/dist/chunk-6NYKC5DD.js.map +1 -0
- package/dist/{chunk-O6FTELKH.js → chunk-FJHEWYV5.js} +3 -3
- package/dist/{chunk-ZWRIPCTR.js → chunk-NRGUX3M5.js} +2 -2
- package/dist/{chunk-TRBOWUG3.js → chunk-ORKVXHL2.js} +2 -2
- package/dist/{chunk-PYMY3AJW.js → chunk-PERPE2UY.js} +172 -7
- package/dist/chunk-PERPE2UY.js.map +1 -0
- package/dist/chunk-TRCYF26N.js +299 -0
- package/dist/chunk-TRCYF26N.js.map +1 -0
- package/dist/{chunk-V3TRUXFJ.js → chunk-U7NKCX5E.js} +72 -19
- package/dist/chunk-U7NKCX5E.js.map +1 -0
- package/dist/{chunk-H7MXYG7R.js → chunk-X6T2P3L3.js} +2 -2
- package/dist/{chunk-HY3F5Q4E.js → chunk-Y44FKTYU.js} +3 -3
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +21 -3
- package/dist/index.js +1698 -995
- package/dist/index.js.map +1 -1
- package/dist/managed-auth-session-set-schema.d.ts +1399 -0
- package/dist/managed-auth-session-sets.d.ts +145 -0
- package/dist/managed-auth-session-sets.js +50 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/organization-recovery-schema.d.ts +2144 -0
- package/dist/organization-recovery.d.ts +186 -0
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +5 -3
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +37 -1
- package/dist/session-background-commands.js +3 -3
- package/dist/session-control.d.ts +5 -3
- package/dist/session-queue-commands.d.ts +2 -0
- package/dist/session-tenancy.js +3 -3
- package/dist/video-generation.js +3 -3
- package/drizzle/0362_managed_auth_session_sets.sql +2347 -0
- package/drizzle/0363_organization_recovery_custody.sql +2418 -0
- package/drizzle/0364_workspace_learning_policy_snapshot_lock_order.sql +221 -0
- package/package.json +10 -6
- package/src/canonical-human-identities.ts +105 -27
- package/src/index.ts +420 -103
- package/src/managed-auth-session-set-schema.ts +176 -0
- package/src/managed-auth-session-sets.ts +430 -0
- package/src/organization-recovery-schema.ts +277 -0
- package/src/organization-recovery.ts +424 -0
- package/src/provision-roles.ts +49 -0
- package/src/runtime-posture.ts +132 -6
- package/src/schema.ts +2 -0
- package/src/session-control.ts +255 -16
- package/src/session-queue-commands.ts +10 -1
- package/src/session-tool-call-settlement.ts +6 -1
- package/dist/chunk-C2AFP7SB.js.map +0 -1
- package/dist/chunk-PYMY3AJW.js.map +0 -1
- package/dist/chunk-V3TRUXFJ.js.map +0 -1
- /package/dist/{chunk-O6FTELKH.js.map → chunk-FJHEWYV5.js.map} +0 -0
- /package/dist/{chunk-ZWRIPCTR.js.map → chunk-NRGUX3M5.js.map} +0 -0
- /package/dist/{chunk-TRBOWUG3.js.map → chunk-ORKVXHL2.js.map} +0 -0
- /package/dist/{chunk-H7MXYG7R.js.map → chunk-X6T2P3L3.js.map} +0 -0
- /package/dist/{chunk-HY3F5Q4E.js.map → chunk-Y44FKTYU.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRlsContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X6T2P3L3.js";
|
|
4
4
|
import {
|
|
5
5
|
sandboxRetainedProcesses,
|
|
6
6
|
sessionBackgroundCommands,
|
|
7
7
|
sessions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6NYKC5DD.js";
|
|
9
9
|
|
|
10
10
|
// src/session-background-commands.ts
|
|
11
11
|
import { and, desc, eq, inArray, sql } from "drizzle-orm";
|
|
@@ -513,4 +513,4 @@ export {
|
|
|
513
513
|
settleSessionBackgroundCommandForRetainedProcess,
|
|
514
514
|
settleConnectedMachineSessionBackgroundCommand
|
|
515
515
|
};
|
|
516
|
-
//# sourceMappingURL=chunk-
|
|
516
|
+
//# sourceMappingURL=chunk-FJHEWYV5.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rawRows,
|
|
3
3
|
withRlsContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X6T2P3L3.js";
|
|
5
5
|
|
|
6
6
|
// src/editable-artifacts.ts
|
|
7
7
|
import { createHash } from "crypto";
|
|
@@ -3540,4 +3540,4 @@ export {
|
|
|
3540
3540
|
PostgresEditableArtifactStore,
|
|
3541
3541
|
PostgresEditableArtifactLiveReadStore
|
|
3542
3542
|
};
|
|
3543
|
-
//# sourceMappingURL=chunk-
|
|
3543
|
+
//# sourceMappingURL=chunk-NRGUX3M5.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
withWorkspaceRls,
|
|
6
6
|
withWorkspaceSubjectRls,
|
|
7
7
|
withWorkspaceSubjectSessionActivityRls
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-X6T2P3L3.js";
|
|
9
9
|
|
|
10
10
|
// src/session-tenancy.ts
|
|
11
11
|
import { createHash } from "crypto";
|
|
@@ -481,4 +481,4 @@ export {
|
|
|
481
481
|
forkSessionContent,
|
|
482
482
|
replayAppliedSessionFork
|
|
483
483
|
};
|
|
484
|
-
//# sourceMappingURL=chunk-
|
|
484
|
+
//# sourceMappingURL=chunk-ORKVXHL2.js.map
|
|
@@ -381,6 +381,49 @@ var CANONICAL_HUMAN_IDENTITY_AUTHORITY_TABLES = [
|
|
|
381
381
|
"canonical_human_login_bindings",
|
|
382
382
|
"canonical_human_identity_operations"
|
|
383
383
|
];
|
|
384
|
+
var MANAGED_AUTH_SESSION_SET_ROUTINES = [
|
|
385
|
+
"get_canonical_human_exact_login_binding(text, text)",
|
|
386
|
+
"managed_auth_session_set_authority_state(text)",
|
|
387
|
+
"managed_auth_session_set_snapshot(text, text, boolean, boolean, boolean)",
|
|
388
|
+
"managed_auth_session_set_bootstrap(text, text, text, text, uuid, text, bigint, bigint)",
|
|
389
|
+
"managed_auth_session_set_begin_transaction(text, text, text, uuid, text, bigint, uuid, bigint, text, text, uuid, uuid, text, timestamp with time zone)",
|
|
390
|
+
"managed_auth_session_set_complete_transaction(text, text, uuid, text, bigint, bigint, uuid, text, text, text)",
|
|
391
|
+
"managed_auth_session_set_mutate(text, text, uuid, text, bigint, bigint, text, uuid, uuid, uuid, text, text)",
|
|
392
|
+
"managed_auth_actor_mutation_fence(text, bigint, uuid)",
|
|
393
|
+
"managed_auth_actor_mutation_lease_acquire(text, bigint, uuid, integer)",
|
|
394
|
+
"managed_auth_actor_mutation_lease_release(text, uuid)",
|
|
395
|
+
"managed_auth_actor_mutation_lease_validate(text, bigint, uuid)",
|
|
396
|
+
"managed_auth_adopted_session_snapshot(text)",
|
|
397
|
+
"managed_auth_isolated_session_reap(integer)",
|
|
398
|
+
"managed_auth_expired_session_set_reap(integer)",
|
|
399
|
+
"managed_auth_session_set_operation_receipt(text, uuid, text, text)"
|
|
400
|
+
];
|
|
401
|
+
var MANAGED_AUTH_SESSION_SET_AUTHORITY_TABLES = [
|
|
402
|
+
"managed_auth_actor_mutation_leases",
|
|
403
|
+
"managed_auth_browser_installations",
|
|
404
|
+
"managed_auth_session_sets",
|
|
405
|
+
"managed_auth_login_slots",
|
|
406
|
+
"managed_auth_login_return_intents",
|
|
407
|
+
"managed_auth_login_transaction_rate_limits",
|
|
408
|
+
"managed_auth_login_transactions",
|
|
409
|
+
"managed_auth_session_set_operations"
|
|
410
|
+
];
|
|
411
|
+
var ORGANIZATION_RECOVERY_ROUTINES = [
|
|
412
|
+
"get_organization_recovery_overview(uuid, text, jsonb, text, text)",
|
|
413
|
+
"organization_recovery_command(jsonb)"
|
|
414
|
+
];
|
|
415
|
+
var ORGANIZATION_RECOVERY_AUTHORITY_TABLES = [
|
|
416
|
+
"organization_recovery_approvals",
|
|
417
|
+
"organization_recovery_command_receipts",
|
|
418
|
+
"organization_recovery_custodian_acceptances",
|
|
419
|
+
"organization_recovery_custodians",
|
|
420
|
+
"organization_recovery_events",
|
|
421
|
+
"organization_recovery_notification_attempts",
|
|
422
|
+
"organization_recovery_notification_outbox",
|
|
423
|
+
"organization_recovery_operations",
|
|
424
|
+
"organization_recovery_policies",
|
|
425
|
+
"organization_recovery_policy_heads"
|
|
426
|
+
];
|
|
384
427
|
var SESSION_PRIVATE_ACTOR_VISIBLE_ROUTINE = "session_private_actor_visible(uuid, uuid, uuid, text)";
|
|
385
428
|
var SESSION_REFERENCE_VISIBLE_ROUTINE = "session_reference_visible(uuid, uuid, uuid)";
|
|
386
429
|
var TASK_NOTE_CAPABILITY_ROUTINES = [
|
|
@@ -551,6 +594,8 @@ var RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES = [
|
|
|
551
594
|
...SCOPED_COMPUTE_AUTHORITY_ROUTINES,
|
|
552
595
|
...SCHEDULED_PERSONAL_RESOURCE_ROUTINES,
|
|
553
596
|
...CANONICAL_HUMAN_IDENTITY_ROUTINES,
|
|
597
|
+
...MANAGED_AUTH_SESSION_SET_ROUTINES,
|
|
598
|
+
...ORGANIZATION_RECOVERY_ROUTINES,
|
|
554
599
|
...TASK_NOTE_CAPABILITY_ROUTINES,
|
|
555
600
|
SESSION_PRIVATE_ACTOR_VISIBLE_ROUTINE,
|
|
556
601
|
SESSION_REFERENCE_VISIBLE_ROUTINE,
|
|
@@ -726,6 +771,14 @@ var FORCE_RLS_TABLES = [
|
|
|
726
771
|
"machine_metrics_latest",
|
|
727
772
|
"machine_metrics_series",
|
|
728
773
|
"machine_removal_operations",
|
|
774
|
+
"managed_auth_actor_mutation_leases",
|
|
775
|
+
"managed_auth_browser_installations",
|
|
776
|
+
"managed_auth_login_return_intents",
|
|
777
|
+
"managed_auth_login_slots",
|
|
778
|
+
"managed_auth_login_transaction_rate_limits",
|
|
779
|
+
"managed_auth_login_transactions",
|
|
780
|
+
"managed_auth_session_set_operations",
|
|
781
|
+
"managed_auth_session_sets",
|
|
729
782
|
"memory_slack_publication_configurations",
|
|
730
783
|
"memory_slack_publication_receipts",
|
|
731
784
|
"memory_slack_publications",
|
|
@@ -740,6 +793,16 @@ var FORCE_RLS_TABLES = [
|
|
|
740
793
|
"organization_private_session_setting_events",
|
|
741
794
|
"organization_private_session_settings",
|
|
742
795
|
"organization_profile_events",
|
|
796
|
+
"organization_recovery_approvals",
|
|
797
|
+
"organization_recovery_command_receipts",
|
|
798
|
+
"organization_recovery_custodian_acceptances",
|
|
799
|
+
"organization_recovery_custodians",
|
|
800
|
+
"organization_recovery_events",
|
|
801
|
+
"organization_recovery_notification_attempts",
|
|
802
|
+
"organization_recovery_notification_outbox",
|
|
803
|
+
"organization_recovery_operations",
|
|
804
|
+
"organization_recovery_policies",
|
|
805
|
+
"organization_recovery_policy_heads",
|
|
743
806
|
"organization_shared_workspace_administration_capabilities",
|
|
744
807
|
"organization_user_resource_authorities",
|
|
745
808
|
"organization_user_resource_grants",
|
|
@@ -1201,6 +1264,14 @@ var PROTECTED_NO_DIRECT_DML_TABLES = [
|
|
|
1201
1264
|
"host_export_cursor_state",
|
|
1202
1265
|
"host_export_dead_letters",
|
|
1203
1266
|
"host_export_outbox",
|
|
1267
|
+
"managed_auth_actor_mutation_leases",
|
|
1268
|
+
"managed_auth_browser_installations",
|
|
1269
|
+
"managed_auth_login_return_intents",
|
|
1270
|
+
"managed_auth_login_slots",
|
|
1271
|
+
"managed_auth_login_transaction_rate_limits",
|
|
1272
|
+
"managed_auth_login_transactions",
|
|
1273
|
+
"managed_auth_session_set_operations",
|
|
1274
|
+
"managed_auth_session_sets",
|
|
1204
1275
|
"organization_invitation_binding_events",
|
|
1205
1276
|
"organization_membership_invitations",
|
|
1206
1277
|
"organization_membership_lifecycle_events",
|
|
@@ -1209,6 +1280,16 @@ var PROTECTED_NO_DIRECT_DML_TABLES = [
|
|
|
1209
1280
|
"organization_private_session_setting_events",
|
|
1210
1281
|
"organization_private_session_settings",
|
|
1211
1282
|
"organization_profile_events",
|
|
1283
|
+
"organization_recovery_approvals",
|
|
1284
|
+
"organization_recovery_command_receipts",
|
|
1285
|
+
"organization_recovery_custodian_acceptances",
|
|
1286
|
+
"organization_recovery_custodians",
|
|
1287
|
+
"organization_recovery_events",
|
|
1288
|
+
"organization_recovery_notification_attempts",
|
|
1289
|
+
"organization_recovery_notification_outbox",
|
|
1290
|
+
"organization_recovery_operations",
|
|
1291
|
+
"organization_recovery_policies",
|
|
1292
|
+
"organization_recovery_policy_heads",
|
|
1212
1293
|
"organization_shared_workspace_administration_capabilities",
|
|
1213
1294
|
"organization_user_resource_authorities",
|
|
1214
1295
|
"organization_user_resource_grants",
|
|
@@ -1308,6 +1389,8 @@ function difference(left, right) {
|
|
|
1308
1389
|
}
|
|
1309
1390
|
async function inspectRuntimeDatabasePosture(db, options) {
|
|
1310
1391
|
const targetSchema = options.targetSchema?.trim() || "public";
|
|
1392
|
+
const targetSchemaCapabilityRoutines = options.targetSchemaCapabilityRoutines ?? RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES;
|
|
1393
|
+
const targetSchemaForbiddenRoutines = options.targetSchemaForbiddenRoutines ?? RUNTIME_TARGET_SCHEMA_FORBIDDEN_ROUTINES;
|
|
1311
1394
|
return await db.transaction(
|
|
1312
1395
|
async (tx) => {
|
|
1313
1396
|
const identityRows = resultRows(
|
|
@@ -1525,10 +1608,9 @@ async function inspectRuntimeDatabasePosture(db, options) {
|
|
|
1525
1608
|
and (p.proname || '(' || pg_catalog.oidvectortypes(p.proargtypes) || ')') = any(
|
|
1526
1609
|
array[
|
|
1527
1610
|
${sql.join(
|
|
1528
|
-
[
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
].map((name) => sql`${name}`),
|
|
1611
|
+
[...targetSchemaCapabilityRoutines, ...targetSchemaForbiddenRoutines].map(
|
|
1612
|
+
(name) => sql`${name}`
|
|
1613
|
+
),
|
|
1532
1614
|
sql`, `
|
|
1533
1615
|
)}
|
|
1534
1616
|
]::text[]
|
|
@@ -1617,6 +1699,8 @@ function evaluateRuntimeDatabasePosture(posture, options) {
|
|
|
1617
1699
|
const protectedNoDirectDmlTables = new Set(
|
|
1618
1700
|
options.protectedNoDirectDmlTables ?? (options.protectedTables ? [] : PROTECTED_NO_DIRECT_DML_TABLES)
|
|
1619
1701
|
);
|
|
1702
|
+
const targetSchemaCapabilityRoutines = options.targetSchemaCapabilityRoutines ?? RUNTIME_TARGET_SCHEMA_CAPABILITY_ROUTINES;
|
|
1703
|
+
const targetSchemaForbiddenRoutines = options.targetSchemaForbiddenRoutines ?? RUNTIME_TARGET_SCHEMA_FORBIDDEN_ROUTINES;
|
|
1620
1704
|
if (identity.currentUser !== expectedRole || identity.sessionUser !== expectedRole) {
|
|
1621
1705
|
violations.push(
|
|
1622
1706
|
`runtime identity must be ${expectedRole} (current_user=${identity.currentUser}, session_user=${identity.sessionUser})`
|
|
@@ -1737,7 +1821,7 @@ function evaluateRuntimeDatabasePosture(posture, options) {
|
|
|
1737
1821
|
if (table.policyCount < 1) violations.push(`table ${tableName} has no RLS policy`);
|
|
1738
1822
|
}
|
|
1739
1823
|
const targetSchemaOwner = posture.schemas.find((schema) => schema.name === targetSchema)?.owner;
|
|
1740
|
-
for (const forbiddenRoutine of
|
|
1824
|
+
for (const forbiddenRoutine of targetSchemaForbiddenRoutines) {
|
|
1741
1825
|
const matches = posture.targetRoutines.filter((routine2) => routine2.name === forbiddenRoutine);
|
|
1742
1826
|
if (matches.length !== 1) {
|
|
1743
1827
|
violations.push(
|
|
@@ -1764,7 +1848,7 @@ function evaluateRuntimeDatabasePosture(posture, options) {
|
|
|
1764
1848
|
violations.push(`PUBLIC has forbidden owner-internal helper ${routine.name}`);
|
|
1765
1849
|
}
|
|
1766
1850
|
}
|
|
1767
|
-
for (const expectedRoutine of
|
|
1851
|
+
for (const expectedRoutine of targetSchemaCapabilityRoutines) {
|
|
1768
1852
|
const matches = posture.targetRoutines.filter((routine2) => routine2.name === expectedRoutine);
|
|
1769
1853
|
if (matches.length !== 1) {
|
|
1770
1854
|
violations.push(
|
|
@@ -2017,6 +2101,42 @@ function evaluateRuntimeDatabasePosture(posture, options) {
|
|
|
2017
2101
|
);
|
|
2018
2102
|
}
|
|
2019
2103
|
}
|
|
2104
|
+
} else if (ORGANIZATION_RECOVERY_ROUTINES.includes(routine.name)) {
|
|
2105
|
+
const authorityTables = ORGANIZATION_RECOVERY_AUTHORITY_TABLES.filter(
|
|
2106
|
+
(tableName) => tableByName.has(tableName)
|
|
2107
|
+
).map((tableName) => tableByName.get(tableName));
|
|
2108
|
+
const authorityOwners = new Set(authorityTables.map((table) => table.owner));
|
|
2109
|
+
if (authorityTables.length !== ORGANIZATION_RECOVERY_AUTHORITY_TABLES.length) {
|
|
2110
|
+
violations.push(
|
|
2111
|
+
`target-schema runtime capability ${routine.name} organization recovery authority tables are missing`
|
|
2112
|
+
);
|
|
2113
|
+
} else if (authorityOwners.size !== 1) {
|
|
2114
|
+
violations.push(
|
|
2115
|
+
`target-schema runtime capability ${routine.name} authority table owners do not match: ${authorityTables.map((table) => `${table.name}=${table.owner}`).join(", ")}`
|
|
2116
|
+
);
|
|
2117
|
+
} else if (routine.owner !== authorityTables[0].owner) {
|
|
2118
|
+
violations.push(
|
|
2119
|
+
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match authority table owner ${authorityTables[0].owner}`
|
|
2120
|
+
);
|
|
2121
|
+
}
|
|
2122
|
+
} else if (MANAGED_AUTH_SESSION_SET_ROUTINES.includes(routine.name)) {
|
|
2123
|
+
const authorityTables = MANAGED_AUTH_SESSION_SET_AUTHORITY_TABLES.filter(
|
|
2124
|
+
(tableName) => tableByName.has(tableName)
|
|
2125
|
+
).map((tableName) => tableByName.get(tableName));
|
|
2126
|
+
const authorityOwners = new Set(authorityTables.map((table) => table.owner));
|
|
2127
|
+
if (authorityTables.length !== MANAGED_AUTH_SESSION_SET_AUTHORITY_TABLES.length) {
|
|
2128
|
+
violations.push(
|
|
2129
|
+
`target-schema runtime capability ${routine.name} managed auth session-set authority tables are missing`
|
|
2130
|
+
);
|
|
2131
|
+
} else if (authorityOwners.size !== 1) {
|
|
2132
|
+
violations.push(
|
|
2133
|
+
`target-schema runtime capability ${routine.name} authority table owners do not match: ${authorityTables.map((table) => `${table.name}=${table.owner}`).join(", ")}`
|
|
2134
|
+
);
|
|
2135
|
+
} else if (routine.owner !== authorityTables[0].owner) {
|
|
2136
|
+
violations.push(
|
|
2137
|
+
`target-schema runtime capability ${routine.name} owner ${routine.owner} does not match authority table owner ${authorityTables[0].owner}`
|
|
2138
|
+
);
|
|
2139
|
+
}
|
|
2020
2140
|
} else if (CANONICAL_HUMAN_IDENTITY_ROUTINES.includes(routine.name)) {
|
|
2021
2141
|
const authorityTables = CANONICAL_HUMAN_IDENTITY_AUTHORITY_TABLES.filter(
|
|
2022
2142
|
(tableName) => tableByName.has(tableName)
|
|
@@ -3183,6 +3303,27 @@ async function grantAppRoleIfSchemaExists(sql2, role, schema) {
|
|
|
3183
3303
|
"finalize_organization_retention_deletion(uuid,uuid,uuid,text)",
|
|
3184
3304
|
"complete_organization_retention_deletion(uuid,uuid,uuid,text)"
|
|
3185
3305
|
].map(literal).join(", ")}]`;
|
|
3306
|
+
const managedAuthSessionSetRoutines = `ARRAY[${[
|
|
3307
|
+
"get_canonical_human_exact_login_binding(text,text)",
|
|
3308
|
+
"managed_auth_session_set_authority_state(text)",
|
|
3309
|
+
"managed_auth_session_set_snapshot(text,text,boolean,boolean,boolean)",
|
|
3310
|
+
"managed_auth_session_set_bootstrap(text,text,text,text,uuid,text,bigint,bigint)",
|
|
3311
|
+
"managed_auth_session_set_begin_transaction(text,text,text,uuid,text,bigint,uuid,bigint,text,text,uuid,uuid,text,timestamp with time zone)",
|
|
3312
|
+
"managed_auth_session_set_complete_transaction(text,text,uuid,text,bigint,bigint,uuid,text,text,text)",
|
|
3313
|
+
"managed_auth_session_set_mutate(text,text,uuid,text,bigint,bigint,text,uuid,uuid,uuid,text,text)",
|
|
3314
|
+
"managed_auth_actor_mutation_fence(text,bigint,uuid)",
|
|
3315
|
+
"managed_auth_actor_mutation_lease_acquire(text,bigint,uuid,integer)",
|
|
3316
|
+
"managed_auth_actor_mutation_lease_release(text,uuid)",
|
|
3317
|
+
"managed_auth_actor_mutation_lease_validate(text,bigint,uuid)",
|
|
3318
|
+
"managed_auth_adopted_session_snapshot(text)",
|
|
3319
|
+
"managed_auth_isolated_session_reap(integer)",
|
|
3320
|
+
"managed_auth_expired_session_set_reap(integer)",
|
|
3321
|
+
"managed_auth_session_set_operation_receipt(text,uuid,text,text)"
|
|
3322
|
+
].map(literal).join(", ")}]`;
|
|
3323
|
+
const organizationRecoveryRoutines = `ARRAY[${[
|
|
3324
|
+
"get_organization_recovery_overview(uuid,text,jsonb,text,text)",
|
|
3325
|
+
"organization_recovery_command(jsonb)"
|
|
3326
|
+
].map(literal).join(", ")}]`;
|
|
3186
3327
|
await sql2.unsafe(`
|
|
3187
3328
|
DO $$
|
|
3188
3329
|
DECLARE
|
|
@@ -3876,6 +4017,30 @@ BEGIN
|
|
|
3876
4017
|
${literal(role)}
|
|
3877
4018
|
);
|
|
3878
4019
|
END IF;
|
|
4020
|
+
FOREACH routine_signature IN ARRAY ${managedAuthSessionSetRoutines} LOOP
|
|
4021
|
+
IF to_regprocedure(format('%I.%s', ${literal(schema)}, routine_signature)) IS NOT NULL THEN
|
|
4022
|
+
EXECUTE format(
|
|
4023
|
+
'REVOKE ALL ON FUNCTION %I.%s FROM PUBLIC',
|
|
4024
|
+
${literal(schema)}, routine_signature
|
|
4025
|
+
);
|
|
4026
|
+
EXECUTE format(
|
|
4027
|
+
'GRANT EXECUTE ON FUNCTION %I.%s TO %I',
|
|
4028
|
+
${literal(schema)}, routine_signature, ${literal(role)}
|
|
4029
|
+
);
|
|
4030
|
+
END IF;
|
|
4031
|
+
END LOOP;
|
|
4032
|
+
FOREACH routine_signature IN ARRAY ${organizationRecoveryRoutines} LOOP
|
|
4033
|
+
IF to_regprocedure(format('%I.%s', ${literal(schema)}, routine_signature)) IS NOT NULL THEN
|
|
4034
|
+
EXECUTE format(
|
|
4035
|
+
'REVOKE ALL ON FUNCTION %I.%s FROM PUBLIC',
|
|
4036
|
+
${literal(schema)}, routine_signature
|
|
4037
|
+
);
|
|
4038
|
+
EXECUTE format(
|
|
4039
|
+
'GRANT EXECUTE ON FUNCTION %I.%s TO %I',
|
|
4040
|
+
${literal(schema)}, routine_signature, ${literal(role)}
|
|
4041
|
+
);
|
|
4042
|
+
END IF;
|
|
4043
|
+
END LOOP;
|
|
3879
4044
|
-- Migration 0225 creates these target-schema-local session visibility
|
|
3880
4045
|
-- capabilities before opengeni_app may exist. Re-converge their exact
|
|
3881
4046
|
-- EXECUTE grants for migrate-then-provision installs without granting
|
|
@@ -4821,4 +4986,4 @@ export {
|
|
|
4821
4986
|
runtimeDatabaseReadyCheck,
|
|
4822
4987
|
provisionRoles
|
|
4823
4988
|
};
|
|
4824
|
-
//# sourceMappingURL=chunk-
|
|
4989
|
+
//# sourceMappingURL=chunk-PERPE2UY.js.map
|