@homeflare/alchemy 0.44.0 → 0.46.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/postgres/fake-role-sql.d.ts +2 -1
- package/dist/postgres/fake-role-sql.d.ts.map +1 -1
- package/dist/postgres/fake-sql.d.ts +3 -3
- package/dist/postgres/fake-sql.d.ts.map +1 -1
- package/dist/postgres/index.d.ts +1 -1
- package/dist/postgres/index.d.ts.map +1 -1
- package/dist/postgres/index.js +117 -94
- package/dist/postgres/index.js.map +11 -11
- package/dist/postgres/role-attrs.d.ts +7 -4
- package/dist/postgres/role-attrs.d.ts.map +1 -1
- package/dist/postgres/role-diff.d.ts +2 -2
- package/dist/postgres/role-diff.d.ts.map +1 -1
- package/dist/postgres/role-errors.d.ts +13 -7
- package/dist/postgres/role-errors.d.ts.map +1 -1
- package/dist/postgres/role-membership-sql.d.ts +30 -27
- package/dist/postgres/role-membership-sql.d.ts.map +1 -1
- package/dist/postgres/role-provider.d.ts.map +1 -1
- package/dist/postgres/role-scram.d.ts +2 -0
- package/dist/postgres/role-scram.d.ts.map +1 -1
- package/dist/postgres/role-secrets.d.ts +8 -0
- package/dist/postgres/role-secrets.d.ts.map +1 -1
- package/dist/postgres/role-sql.d.ts.map +1 -1
- package/dist/postgres/role.d.ts +2 -2
- package/dist/postgres/role.d.ts.map +1 -1
- package/dist/proxmox/generated/constraints/index.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-access.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-backup.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-ceph.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-firewall.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-ha.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-metrics.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-notifications.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-replication.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-cluster-sdn.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-ceph.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-disks.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-lxc.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-network.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-qemu.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-qemu.d.ts.map +1 -1
- package/dist/proxmox/generated/constraints/pve-nodes-storage.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-pools.d.ts +1 -1
- package/dist/proxmox/generated/constraints/pve-storage.d.ts +1 -1
- package/dist/proxmox/index.d.ts +1 -0
- package/dist/proxmox/index.d.ts.map +1 -1
- package/dist/proxmox/index.js +283 -130
- package/dist/proxmox/index.js.map +31 -27
- package/dist/proxmox/qemu-dns.d.ts +2 -0
- package/dist/proxmox/qemu-dns.d.ts.map +1 -0
- package/dist/proxmox/qemu-errors.d.ts +1 -0
- package/dist/proxmox/qemu-errors.d.ts.map +1 -1
- package/dist/proxmox/qemu-form.d.ts.map +1 -1
- package/dist/proxmox/qemu-judge.d.ts.map +1 -1
- package/dist/proxmox/qemu-lifecycle.d.ts +15 -10
- package/dist/proxmox/qemu-lifecycle.d.ts.map +1 -1
- package/dist/proxmox/qemu-props.d.ts +10 -0
- package/dist/proxmox/qemu-props.d.ts.map +1 -1
- package/dist/proxmox/qemu-resize.d.ts +10 -0
- package/dist/proxmox/qemu-resize.d.ts.map +1 -0
- package/dist/proxmox/qemu-size.d.ts +20 -0
- package/dist/proxmox/qemu-size.d.ts.map +1 -0
- package/dist/proxmox/qemu-spec.d.ts +25 -0
- package/dist/proxmox/qemu-spec.d.ts.map +1 -0
- package/dist/verify/fake-engine.d.ts +4 -2
- package/dist/verify/fake-engine.d.ts.map +1 -1
- package/docs/postgres-role.md +18 -6
- package/docs/proxmox-qemu-resize.md +62 -0
- package/package.json +1 -1
- package/src/ceph/ceph-argv.test.ts +1 -1
- package/src/launchd/sudo-allowlist.test.ts +2 -2
- package/src/linux/sudo-allowlist.test.ts +3 -3
- package/src/linux/sudo-runner.test.ts +2 -2
- package/src/postgres/fake-role-sql.ts +26 -6
- package/src/postgres/fake-sql.ts +10 -5
- package/src/postgres/index.ts +1 -0
- package/src/postgres/role-attrs.ts +7 -4
- package/src/postgres/role-diff.ts +7 -3
- package/src/postgres/role-errors.ts +22 -14
- package/src/postgres/role-guard.test.ts +3 -3
- package/src/postgres/role-identity.test.ts +14 -2
- package/src/postgres/role-lifecycle.test.ts +2 -2
- package/src/postgres/role-membership-options.test.ts +73 -0
- package/src/postgres/role-membership-repair.test.ts +153 -0
- package/src/postgres/role-membership-sql.ts +88 -63
- package/src/postgres/role-password-ascii.test.ts +53 -0
- package/src/postgres/role-password-transports.test.ts +123 -0
- package/src/postgres/role-privilege.test.ts +37 -10
- package/src/postgres/role-provenance.test.ts +1 -1
- package/src/postgres/role-provider.ts +3 -2
- package/src/postgres/role-refusals.test.ts +0 -25
- package/src/postgres/role-scram.ts +2 -0
- package/src/postgres/role-secrets.ts +15 -0
- package/src/postgres/role-sql.ts +3 -1
- package/src/postgres/role.ts +9 -1
- package/src/postgres/schema-socket.test.ts +1 -0
- package/src/proxmox/generated/constraints/index.ts +1 -1
- package/src/proxmox/generated/constraints/pve-access.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-backup.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-ceph.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-firewall.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-ha.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-metrics.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-notifications.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-replication.ts +1 -1
- package/src/proxmox/generated/constraints/pve-cluster-sdn.ts +1 -1
- package/src/proxmox/generated/constraints/pve-nodes-ceph.ts +1 -1
- package/src/proxmox/generated/constraints/pve-nodes-disks.ts +1 -1
- package/src/proxmox/generated/constraints/pve-nodes-lxc.ts +1 -1
- package/src/proxmox/generated/constraints/pve-nodes-network.ts +1 -1
- package/src/proxmox/generated/constraints/pve-nodes-qemu.ts +6 -1
- package/src/proxmox/generated/constraints/pve-nodes-storage.ts +1 -1
- package/src/proxmox/generated/constraints/pve-pools.ts +1 -1
- package/src/proxmox/generated/constraints/pve-storage.ts +1 -1
- package/src/proxmox/index.ts +1 -0
- package/src/proxmox/qemu-dns.test.ts +73 -0
- package/src/proxmox/qemu-dns.ts +32 -0
- package/src/proxmox/qemu-errors.ts +1 -0
- package/src/proxmox/qemu-form.ts +6 -3
- package/src/proxmox/qemu-judge.ts +2 -1
- package/src/proxmox/qemu-lifecycle.ts +28 -47
- package/src/proxmox/qemu-props.ts +14 -2
- package/src/proxmox/qemu-resize-lock.test.ts +121 -0
- package/src/proxmox/qemu-resize-recovery.test.ts +81 -0
- package/src/proxmox/qemu-resize.test.ts +199 -0
- package/src/proxmox/qemu-resize.ts +86 -0
- package/src/proxmox/qemu-size.test.ts +64 -0
- package/src/proxmox/qemu-size.ts +95 -0
- package/src/proxmox/qemu-spec.ts +44 -0
- package/src/proxmox/qemu-volume.ts +5 -5
- package/src/verify/fake-engine.ts +6 -3
|
@@ -20,13 +20,14 @@ export interface FakeRoleState {
|
|
|
20
20
|
/** Bare role names, backing the `roleExists` check the database family's owner probe uses. */
|
|
21
21
|
readonly roleNames: Set<string>;
|
|
22
22
|
readonly roleRows: Map<string, PostgresRoleAttributes>;
|
|
23
|
-
/** `member\0parent\0grantor` triples backing `pg_auth_members` (`''` grantor =
|
|
23
|
+
/** `member\0parent\0grantor` triples backing `pg_auth_members` (`''` grantor = unresolvable
|
|
24
24
|
* grantor); `GRANT`/`REVOKE` mutate it. */
|
|
25
25
|
readonly memberships: Set<string>;
|
|
26
26
|
/** Options a name-only compare would hide, keyed `member\0parent\0grantor`. */
|
|
27
27
|
readonly membershipOptions: Map<string, {
|
|
28
28
|
readonly admin: boolean;
|
|
29
29
|
readonly set: boolean;
|
|
30
|
+
readonly inherit?: boolean;
|
|
30
31
|
}>;
|
|
31
32
|
/** Hands out the next `oid` a real cluster would assign. */
|
|
32
33
|
nextOid(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-role-sql.d.ts","sourceRoot":"","sources":["../../src/postgres/fake-role-sql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAG9D;oDACoD;AACpD,MAAM,WAAW,aAAa;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACvD;+CAC2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,iBAAiB,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"fake-role-sql.d.ts","sourceRoot":"","sources":["../../src/postgres/fake-role-sql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAG9D;oDACoD;AACpD,MAAM,WAAW,aAAa;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACvD;+CAC2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAC7B,MAAM,EACN;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAC/E,CAAC;IACF,4DAA4D;IAC5D,OAAO,IAAI,MAAM,CAAC;CACnB;AAuDD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,SAC1C,aAAa,QACd,MAAM,UACJ,aAAa,CAAC,OAAO,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,SA6I9C,CAAC"}
|
|
@@ -15,14 +15,14 @@ export interface FakeSql extends PgExecutor {
|
|
|
15
15
|
readonly roleRows: Map<string, PostgresRoleAttributes>;
|
|
16
16
|
/** `member\0parent\0grantor` triples backing `pg_auth_members` (a plain `pg_auth_members`
|
|
17
17
|
* read, a grant, a revoke and a DROP ROLE cascade all go through `fake-role-sql.ts`);
|
|
18
|
-
* `GRANT`/`REVOKE` mutate it. An empty grantor segment is
|
|
19
|
-
* exists. */
|
|
18
|
+
* `GRANT`/`REVOKE` mutate it. An empty grantor segment is an inconsistent catalog/test row. */
|
|
20
19
|
readonly memberships: Set<string>;
|
|
21
20
|
/** Options on a membership the name alone hides, keyed `member\0parent\0grantor`. Absent
|
|
22
|
-
* means neither ADMIN nor
|
|
21
|
+
* means neither ADMIN, SET nor an explicit per-grant INHERIT. */
|
|
23
22
|
readonly membershipOptions: Map<string, {
|
|
24
23
|
readonly admin: boolean;
|
|
25
24
|
readonly set: boolean;
|
|
25
|
+
readonly inherit?: boolean;
|
|
26
26
|
}>;
|
|
27
27
|
/** Mutable on purpose: a test seeds a live schema (adoption, drift) or clears one (drop). */
|
|
28
28
|
readonly schemas: Map<string, PostgresSchemaAttributes>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-sql.d.ts","sourceRoot":"","sources":["../../src/postgres/fake-sql.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,OAAQ,SAAQ,UAAU;IACzC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACtD;0DACsD;IACtD,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAC5D,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACvD
|
|
1
|
+
{"version":3,"file":"fake-sql.d.ts","sourceRoot":"","sources":["../../src/postgres/fake-sql.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAw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AC/E,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;2EACuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,wBAAwB,CAAC,CAAC;IAC3D,0EAA0E;IAC1E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtD;8EAC0E;IAC1E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C;iFAC6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;6EAEyE;IACzE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC;;yDAEqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,aAAa,cAAc,KAAQ,OA+J1D,CAAC"}
|
package/dist/postgres/index.d.ts
CHANGED
|
@@ -38,6 +38,6 @@ export { PostgresRoleProvider } from './role-provider.ts';
|
|
|
38
38
|
export { resolvePassword } from './role-secrets.ts';
|
|
39
39
|
export type { ResolvedPassword } from './role-secrets.ts';
|
|
40
40
|
export type { FromEnv } from '../secrets/write-only.ts';
|
|
41
|
-
export { PostgresRoleCreateVanished, PostgresRoleIdentityRefused, PostgresRoleMembershipUnrepaired, PostgresRoleNameRefused, PostgresRoleParentMissing, PostgresRolePasswordEnvUnsetError, PostgresRolePrivilegedRefused, PostgresRoleRenameRefused, PostgresRoleValidUntilRefused, type PostgresRoleError, } from './role-errors.ts';
|
|
41
|
+
export { PostgresRoleCreateVanished, PostgresRoleIdentityRefused, PostgresRoleMembershipUnrepaired, PostgresRoleNameRefused, PostgresRoleParentMissing, PostgresRolePasswordEnvUnsetError, PostgresRolePasswordNonAsciiRefused, PostgresRolePrivilegedRefused, PostgresRoleRenameRefused, PostgresRoleValidUntilRefused, type PostgresRoleError, } from './role-errors.ts';
|
|
42
42
|
export { postgresProviders, postgresRoleProviders, postgresRoleRunnerProviders, postgresRunnerProviders, } from './providers.ts';
|
|
43
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/postgres/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,GACP,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,YAAY,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC/F,YAAY,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,gBAA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,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,uBAAuB,EACvB,yBAAyB,EACzB,iCAAiC,EACjC,mCAAmC,EACnC,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC"}
|
package/dist/postgres/index.js
CHANGED
|
@@ -1481,8 +1481,8 @@ class PostgresRoleCreateVanished extends Data4.TaggedError("PostgresRoleCreateVa
|
|
|
1481
1481
|
|
|
1482
1482
|
class PostgresRoleMembershipUnrepaired extends Data4.TaggedError("PostgresRoleMembershipUnrepaired") {
|
|
1483
1483
|
get message() {
|
|
1484
|
-
const who = this.grantor === null ? "
|
|
1485
|
-
return `Postgres.Role "${this.role}": membership of "${this.parent}" ` + `(${this.declared ? "declared, options unsafe" : "not declared"}) could not be repaired ` + `
|
|
1484
|
+
const who = this.grantor === null ? "an unresolvable grantor (inconsistent catalog)" : `grantor "${this.grantor}"`;
|
|
1485
|
+
return `Postgres.Role "${this.role}": membership of "${this.parent}" ` + `(${this.declared ? "declared, options unsafe" : "not declared"}) could not be repaired ` + `under ${who}. The server refused the repair or the catalog re-read still found the row ` + "outside the declaration. pg_auth_members keys a membership on (parent, member, grantor). " + "Check dependent grants, executor permissions and grantor identity before re-planning.";
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
|
|
@@ -1498,11 +1498,18 @@ class PostgresRoleIdentityRefused extends Data4.TaggedError("PostgresRoleIdentit
|
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
1500
|
|
|
1501
|
+
class PostgresRolePasswordNonAsciiRefused extends Data4.TaggedError("PostgresRolePasswordNonAsciiRefused") {
|
|
1502
|
+
get message() {
|
|
1503
|
+
return `Postgres.Role "${this.role}": password must be ASCII; this provider does not implement PostgreSQL SASLprep normalization. Nothing was written.`;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1501
1507
|
// src/postgres/role-membership-sql.ts
|
|
1502
1508
|
var MEMBERSHIP_SQL = `SELECT parent.rolname AS parent,
|
|
1503
1509
|
grantor.rolname AS grantor,
|
|
1504
1510
|
m.admin_option AS admin,
|
|
1505
|
-
m.set_option AS set
|
|
1511
|
+
m.set_option AS set,
|
|
1512
|
+
m.inherit_option AS inherit
|
|
1506
1513
|
FROM pg_auth_members m
|
|
1507
1514
|
JOIN pg_roles member ON member.oid = m.member
|
|
1508
1515
|
JOIN pg_roles parent ON parent.oid = m.roleid
|
|
@@ -1511,9 +1518,9 @@ var MEMBERSHIP_SQL = `SELECT parent.rolname AS parent,
|
|
|
1511
1518
|
ORDER BY parent.rolname, grantor.rolname NULLS FIRST`;
|
|
1512
1519
|
var selectRoleMemberships = (pg, name) => Effect18.map(pg.unsafe(MEMBERSHIP_SQL, [name]), (rows) => rows);
|
|
1513
1520
|
var buildGrantMembershipSql = (member, parent) => `GRANT ${quoteIdent(parent)} TO ${quoteIdent(member)} WITH SET FALSE`;
|
|
1514
|
-
var buildRepairMembershipSql = (member, parent) => `
|
|
1521
|
+
var buildRepairMembershipSql = (member, parent, grantor, option) => `REVOKE ${option} OPTION FOR ${quoteIdent(parent)} FROM ${quoteIdent(member)} GRANTED BY ${quoteIdent(grantor)} RESTRICT`;
|
|
1515
1522
|
var buildRevokeGrantorMembershipSql = (member, parent, grantor) => `REVOKE ${quoteIdent(parent)} FROM ${quoteIdent(member)} GRANTED BY ${quoteIdent(grantor)}`;
|
|
1516
|
-
var unsafeMemberships = (live) => new Set((live.memberships ?? []).filter((row) => row.admin || row.set).map((row) => row.parent));
|
|
1523
|
+
var unsafeMemberships = (live, inherit) => new Set((live.memberships ?? []).filter((row) => row.admin || row.set || row.inherit && !inherit).map((row) => row.parent));
|
|
1517
1524
|
var membershipDrift = (declared, live, unsafe = new Set) => {
|
|
1518
1525
|
if (declared === undefined)
|
|
1519
1526
|
return { grants: [], revokes: [] };
|
|
@@ -1542,30 +1549,41 @@ var syncMemberships = (pg, props, rows) => Effect18.gen(function* () {
|
|
|
1542
1549
|
}
|
|
1543
1550
|
yield* assertParentsExist(pg, props.name, props.memberOf);
|
|
1544
1551
|
const wanted = [...new Set(props.memberOf)].sort();
|
|
1552
|
+
const revokes = [];
|
|
1545
1553
|
for (const row of rows) {
|
|
1546
|
-
if (wanted.includes(row.parent)
|
|
1547
|
-
|
|
1548
|
-
|
|
1554
|
+
if (!wanted.includes(row.parent) && row.grantor !== null) {
|
|
1555
|
+
revokes.push(buildRevokeGrantorMembershipSql(props.name, row.parent, row.grantor));
|
|
1556
|
+
}
|
|
1549
1557
|
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
yield* pg.unsafe(buildRevokeGrantorMembershipSql(props.name, row.parent, row.grantor)).pipe(Effect18.asVoid);
|
|
1558
|
+
if (revokes.length > 0)
|
|
1559
|
+
yield* pg.transaction(revokes);
|
|
1560
|
+
for (const row of rows) {
|
|
1561
|
+
if (row.grantor === null || !wanted.includes(row.parent))
|
|
1562
|
+
continue;
|
|
1563
|
+
const statements = [];
|
|
1564
|
+
for (const option of ["ADMIN", "SET", "INHERIT"]) {
|
|
1565
|
+
const unsafe = option === "ADMIN" ? row.admin : option === "SET" ? row.set : row.inherit && !props.inherit;
|
|
1566
|
+
if (unsafe) {
|
|
1567
|
+
statements.push(buildRepairMembershipSql(props.name, row.parent, row.grantor, option));
|
|
1561
1568
|
}
|
|
1562
1569
|
}
|
|
1570
|
+
if (statements.length > 0)
|
|
1571
|
+
yield* pg.transaction(statements).pipe(Effect18.catchTag("SqlError", (error) => {
|
|
1572
|
+
const cause = error.reason.cause;
|
|
1573
|
+
const code = typeof cause === "object" && cause !== null ? cause.code : undefined;
|
|
1574
|
+
return Effect18.fail(code === "2BP01" || code === "42501" ? new PostgresRoleMembershipUnrepaired({
|
|
1575
|
+
role: props.name,
|
|
1576
|
+
parent: row.parent,
|
|
1577
|
+
grantor: row.grantor,
|
|
1578
|
+
declared: true
|
|
1579
|
+
}) : error);
|
|
1580
|
+
}));
|
|
1563
1581
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1582
|
+
const grants = wanted.filter((p) => !rows.some((row) => row.parent === p)).map((parent) => buildGrantMembershipSql(props.name, parent));
|
|
1583
|
+
if (grants.length > 0)
|
|
1584
|
+
yield* pg.transaction(grants);
|
|
1567
1585
|
for (const row of yield* selectRoleMemberships(pg, props.name)) {
|
|
1568
|
-
if (!wanted.includes(row.parent) || row.admin || row.set) {
|
|
1586
|
+
if (!wanted.includes(row.parent) || row.admin || row.set || row.inherit && !props.inherit) {
|
|
1569
1587
|
return yield* Effect18.fail(new PostgresRoleMembershipUnrepaired({
|
|
1570
1588
|
role: props.name,
|
|
1571
1589
|
parent: row.parent,
|
|
@@ -1652,7 +1670,7 @@ var scalarDrift = (props, live) => {
|
|
|
1652
1670
|
var declarationMatches = (props, live) => {
|
|
1653
1671
|
const wanted = props.memberOf === undefined ? undefined : [...new Set(props.memberOf)].sort().join("\x00");
|
|
1654
1672
|
const found = [...live.memberOf ?? []].sort().join("\x00");
|
|
1655
|
-
return props.name === live.name && props.login === live.login && props.inherit === live.inherit && props.connectionLimit === live.connectionLimit && (props.validUntil === undefined || sameValidUntil(props.validUntil, live.validUntil)) && (wanted === undefined || wanted === found) && privilegedFlags(live).length === 0 && (live.memberships ?? []).every((row) => !row.admin && !row.set);
|
|
1673
|
+
return props.name === live.name && props.login === live.login && props.inherit === live.inherit && props.connectionLimit === live.connectionLimit && (props.validUntil === undefined || sameValidUntil(props.validUntil, live.validUntil)) && (wanted === undefined || wanted === found) && privilegedFlags(live).length === 0 && (live.memberships ?? []).every((row) => !row.admin && !row.set && (!row.inherit || props.inherit));
|
|
1656
1674
|
};
|
|
1657
1675
|
var storedAttributes = (live) => {
|
|
1658
1676
|
const { memberships: _observeOnly, ...stored } = live;
|
|
@@ -1674,11 +1692,12 @@ var privilegedFlags = (live) => {
|
|
|
1674
1692
|
};
|
|
1675
1693
|
// src/postgres/role.ts
|
|
1676
1694
|
import { Resource as Resource4 } from "alchemy";
|
|
1677
|
-
import * as
|
|
1695
|
+
import * as Effect21 from "effect/Effect";
|
|
1678
1696
|
import * as Redacted2 from "effect/Redacted";
|
|
1679
1697
|
|
|
1680
1698
|
// src/postgres/role-secrets.ts
|
|
1681
1699
|
import * as Redacted from "effect/Redacted";
|
|
1700
|
+
import * as Effect20 from "effect/Effect";
|
|
1682
1701
|
|
|
1683
1702
|
// src/secrets/write-only.ts
|
|
1684
1703
|
import { Buffer } from "node:buffer";
|
|
@@ -1718,6 +1737,7 @@ var sealMatches = (sealed, values) => {
|
|
|
1718
1737
|
};
|
|
1719
1738
|
|
|
1720
1739
|
// src/postgres/role-secrets.ts
|
|
1740
|
+
var assertPasswordAscii = (role, resolved) => resolved.value !== undefined && /[\u0080-\uffff]/.test(Redacted.value(resolved.value)) ? Effect20.fail(new PostgresRolePasswordNonAsciiRefused({ role })) : Effect20.void;
|
|
1721
1741
|
var resolvePassword = (props, env = process.env) => {
|
|
1722
1742
|
if (props.password === undefined)
|
|
1723
1743
|
return { variable: undefined, value: undefined };
|
|
@@ -1751,19 +1771,20 @@ var PostgresRole = Resource4("Postgres.Role", {
|
|
|
1751
1771
|
defaultRemovalPolicy: "retain"
|
|
1752
1772
|
});
|
|
1753
1773
|
var isPostgresRole = (value3) => (typeof value3 === "object" || typeof value3 === "function") && value3 !== null && value3.Type === "Postgres.Role";
|
|
1754
|
-
var reconcileWithClient4 = (pg, props, env = process.env, previousSeal = "", storedOid) =>
|
|
1774
|
+
var reconcileWithClient4 = (pg, props, env = process.env, previousSeal = "", storedOid) => Effect21.gen(function* () {
|
|
1755
1775
|
const resolved = resolvePassword(props, env);
|
|
1776
|
+
yield* assertPasswordAscii(props.name, resolved);
|
|
1756
1777
|
const observed = yield* readRoleWithClient(pg, props.name);
|
|
1757
1778
|
if (observed === undefined) {
|
|
1758
1779
|
if (resolved.variable !== undefined && resolved.value === undefined) {
|
|
1759
|
-
return yield*
|
|
1780
|
+
return yield* Effect21.fail(new PostgresRolePasswordEnvUnsetError({ role: props.name, variable: resolved.variable }));
|
|
1760
1781
|
}
|
|
1761
1782
|
yield* assertParentsExist(pg, props.name, props.memberOf);
|
|
1762
1783
|
const verifier = resolved.value === undefined ? undefined : scramSha256Verifier(Redacted2.value(resolved.value));
|
|
1763
1784
|
yield* pg.transaction(buildCreateStatements(props, verifier));
|
|
1764
1785
|
const created = yield* readRoleWithClient(pg, props.name);
|
|
1765
1786
|
if (created === undefined) {
|
|
1766
|
-
return yield*
|
|
1787
|
+
return yield* Effect21.fail(new PostgresRoleCreateVanished({ role: props.name }));
|
|
1767
1788
|
}
|
|
1768
1789
|
return {
|
|
1769
1790
|
...storedAttributes(created),
|
|
@@ -1771,7 +1792,7 @@ var reconcileWithClient4 = (pg, props, env = process.env, previousSeal = "", sto
|
|
|
1771
1792
|
};
|
|
1772
1793
|
}
|
|
1773
1794
|
if (storedOid !== undefined && observed.oid !== storedOid) {
|
|
1774
|
-
return yield*
|
|
1795
|
+
return yield* Effect21.fail(new PostgresRoleIdentityRefused({
|
|
1775
1796
|
role: props.name,
|
|
1776
1797
|
storedOid,
|
|
1777
1798
|
liveOid: observed.oid
|
|
@@ -1779,23 +1800,23 @@ var reconcileWithClient4 = (pg, props, env = process.env, previousSeal = "", sto
|
|
|
1779
1800
|
}
|
|
1780
1801
|
const flags = privilegedFlags(observed);
|
|
1781
1802
|
if (flags.length > 0) {
|
|
1782
|
-
return yield*
|
|
1803
|
+
return yield* Effect21.fail(new PostgresRolePrivilegedRefused({ role: props.name, flags }));
|
|
1783
1804
|
}
|
|
1784
1805
|
if (resolved.variable !== undefined && resolved.value === undefined && previousSeal === "") {
|
|
1785
|
-
return yield*
|
|
1806
|
+
return yield* Effect21.fail(new PostgresRolePasswordEnvUnsetError({ role: props.name, variable: resolved.variable }));
|
|
1786
1807
|
}
|
|
1787
1808
|
yield* assertParentsExist(pg, props.name, props.memberOf);
|
|
1788
1809
|
for (const change of scalarDrift(props, observed)) {
|
|
1789
|
-
yield* pg.unsafe(buildAlterRoleSql(props.name, change)).pipe(
|
|
1810
|
+
yield* pg.unsafe(buildAlterRoleSql(props.name, change)).pipe(Effect21.asVoid);
|
|
1790
1811
|
}
|
|
1791
1812
|
const passwordMatched = resolved.value !== undefined && passwordMatchesSeal(resolved.value, previousSeal);
|
|
1792
1813
|
if (resolved.value !== undefined && !passwordMatched) {
|
|
1793
|
-
yield* pg.unsafe(buildSetPasswordSql(props.name, scramSha256Verifier(Redacted2.value(resolved.value)))).pipe(
|
|
1814
|
+
yield* pg.unsafe(buildSetPasswordSql(props.name, scramSha256Verifier(Redacted2.value(resolved.value)))).pipe(Effect21.asVoid);
|
|
1794
1815
|
}
|
|
1795
1816
|
yield* syncMemberships(pg, props, observed.memberships ?? []);
|
|
1796
1817
|
const after = yield* readRoleWithClient(pg, props.name);
|
|
1797
1818
|
if (after === undefined) {
|
|
1798
|
-
return yield*
|
|
1819
|
+
return yield* Effect21.fail(new PostgresRoleCreateVanished({ role: props.name }));
|
|
1799
1820
|
}
|
|
1800
1821
|
return {
|
|
1801
1822
|
...storedAttributes(after),
|
|
@@ -1803,15 +1824,15 @@ var reconcileWithClient4 = (pg, props, env = process.env, previousSeal = "", sto
|
|
|
1803
1824
|
};
|
|
1804
1825
|
});
|
|
1805
1826
|
var readRole = (pg, name) => readRoleWithClient(pg, name);
|
|
1806
|
-
var refuseAtPlan = (props) =>
|
|
1827
|
+
var refuseAtPlan = (props) => Effect21.gen(function* () {
|
|
1807
1828
|
const nameRefusal = nameByteRefusal(props.name);
|
|
1808
1829
|
if (nameRefusal !== undefined) {
|
|
1809
|
-
return yield*
|
|
1830
|
+
return yield* Effect21.fail(new PostgresRoleNameRefused({ name: props.name, ...nameRefusal }));
|
|
1810
1831
|
}
|
|
1811
1832
|
if (props.validUntil !== undefined) {
|
|
1812
1833
|
const untilRefusal = validUntilRefusal(props.validUntil);
|
|
1813
1834
|
if (untilRefusal !== undefined) {
|
|
1814
|
-
return yield*
|
|
1835
|
+
return yield* Effect21.fail(new PostgresRoleValidUntilRefused({
|
|
1815
1836
|
role: props.name,
|
|
1816
1837
|
value: props.validUntil,
|
|
1817
1838
|
reason: untilRefusal.reason
|
|
@@ -1822,21 +1843,21 @@ var refuseAtPlan = (props) => Effect20.gen(function* () {
|
|
|
1822
1843
|
// src/postgres/role-provider.ts
|
|
1823
1844
|
import * as Provider4 from "alchemy/Provider";
|
|
1824
1845
|
import { isResolved as isResolved5 } from "alchemy/Diff";
|
|
1825
|
-
import * as
|
|
1846
|
+
import * as Effect28 from "effect/Effect";
|
|
1826
1847
|
|
|
1827
1848
|
// src/ownership/probe.ts
|
|
1828
1849
|
import { Unowned as Unowned4 } from "alchemy/AdoptPolicy";
|
|
1829
|
-
import * as
|
|
1850
|
+
import * as Effect24 from "effect/Effect";
|
|
1830
1851
|
|
|
1831
1852
|
// src/ownership/rows.ts
|
|
1832
1853
|
import { Stack as Stack2 } from "alchemy/Stack";
|
|
1833
1854
|
import { State, isActionState } from "alchemy/State/State";
|
|
1834
|
-
import * as
|
|
1855
|
+
import * as Effect23 from "effect/Effect";
|
|
1835
1856
|
import * as Option2 from "effect/Option";
|
|
1836
1857
|
|
|
1837
1858
|
// src/ownership/whole.ts
|
|
1838
1859
|
import { Stack } from "alchemy/Stack";
|
|
1839
|
-
import * as
|
|
1860
|
+
import * as Effect22 from "effect/Effect";
|
|
1840
1861
|
import * as Option from "effect/Option";
|
|
1841
1862
|
var absent = (value3) => value3 === undefined || value3 === null;
|
|
1842
1863
|
var isPlainObject = (value3) => {
|
|
@@ -1862,22 +1883,22 @@ var carries = (declared, recorded) => {
|
|
|
1862
1883
|
}
|
|
1863
1884
|
return true;
|
|
1864
1885
|
};
|
|
1865
|
-
var wholeDeclaration = (fqn, props) =>
|
|
1886
|
+
var wholeDeclaration = (fqn, props) => Effect22.map(Effect22.serviceOption(Stack), (stack) => {
|
|
1866
1887
|
const declared = Option.isSome(stack) ? stack.value.resources[fqn] : undefined;
|
|
1867
1888
|
return declared !== undefined && carries(declared.Props, props);
|
|
1868
1889
|
});
|
|
1869
1890
|
|
|
1870
1891
|
// src/ownership/rows.ts
|
|
1871
|
-
var storeOf =
|
|
1872
|
-
const stack = yield*
|
|
1873
|
-
const state = yield*
|
|
1892
|
+
var storeOf = Effect23.gen(function* () {
|
|
1893
|
+
const stack = yield* Effect23.serviceOption(Stack2);
|
|
1894
|
+
const state = yield* Effect23.serviceOption(State);
|
|
1874
1895
|
if (Option2.isNone(stack) || Option2.isNone(state))
|
|
1875
1896
|
return;
|
|
1876
1897
|
const store = yield* state.value;
|
|
1877
1898
|
const where = { stack: stack.value.name, stage: stack.value.stage };
|
|
1878
1899
|
return { resources: stack.value.resources, store, where };
|
|
1879
1900
|
});
|
|
1880
|
-
var rowAt = (store, where, fqn) => store.get({ ...where, fqn }).pipe(
|
|
1901
|
+
var rowAt = (store, where, fqn) => store.get({ ...where, fqn }).pipe(Effect23.orElseSucceed(() => {
|
|
1881
1902
|
return;
|
|
1882
1903
|
}));
|
|
1883
1904
|
var generationOf = (row, instanceId) => {
|
|
@@ -1890,7 +1911,7 @@ var generationOf = (row, instanceId) => {
|
|
|
1890
1911
|
}
|
|
1891
1912
|
return;
|
|
1892
1913
|
};
|
|
1893
|
-
var recordedGeneration = (fqn, instanceId) =>
|
|
1914
|
+
var recordedGeneration = (fqn, instanceId) => Effect23.gen(function* () {
|
|
1894
1915
|
const found = yield* storeOf;
|
|
1895
1916
|
if (found === undefined)
|
|
1896
1917
|
return;
|
|
@@ -1901,20 +1922,20 @@ var recordedGeneration = (fqn, instanceId) => Effect22.gen(function* () {
|
|
|
1901
1922
|
}
|
|
1902
1923
|
return;
|
|
1903
1924
|
});
|
|
1904
|
-
var recordedInstance = (fqn, instanceId) =>
|
|
1925
|
+
var recordedInstance = (fqn, instanceId) => Effect23.gen(function* () {
|
|
1905
1926
|
const generation = yield* recordedGeneration(fqn, instanceId);
|
|
1906
1927
|
if (generation === undefined)
|
|
1907
1928
|
return "absent";
|
|
1908
1929
|
return (yield* wholeDeclaration(fqn, generation.props)) ? "whole" : "partial";
|
|
1909
1930
|
});
|
|
1910
|
-
var isCreate = (fqn, instanceId) =>
|
|
1931
|
+
var isCreate = (fqn, instanceId) => Effect23.map(recordedGeneration(fqn, instanceId), (generation) => generation?.status === "creating");
|
|
1911
1932
|
var idOf = (attr) => {
|
|
1912
1933
|
if (typeof attr !== "object" || attr === null)
|
|
1913
1934
|
return;
|
|
1914
1935
|
const id = attr.id;
|
|
1915
1936
|
return typeof id === "string" && id !== "" ? id : undefined;
|
|
1916
1937
|
};
|
|
1917
|
-
var olderGenerationIds = (fqn, instanceId) =>
|
|
1938
|
+
var olderGenerationIds = (fqn, instanceId) => Effect23.gen(function* () {
|
|
1918
1939
|
const found = yield* storeOf;
|
|
1919
1940
|
if (found === undefined)
|
|
1920
1941
|
return [];
|
|
@@ -1942,7 +1963,7 @@ var collectOlder = (row, instanceId, ids) => {
|
|
|
1942
1963
|
at = generation.old;
|
|
1943
1964
|
}
|
|
1944
1965
|
};
|
|
1945
|
-
var forgetRefusedCreate = (fqn, instanceId) =>
|
|
1966
|
+
var forgetRefusedCreate = (fqn, instanceId) => Effect23.gen(function* () {
|
|
1946
1967
|
const found = yield* storeOf;
|
|
1947
1968
|
if (found === undefined)
|
|
1948
1969
|
return;
|
|
@@ -1951,22 +1972,22 @@ var forgetRefusedCreate = (fqn, instanceId) => Effect22.gen(function* () {
|
|
|
1951
1972
|
if (mine?.status !== "creating" || mine.instanceId !== instanceId || mine.attr !== undefined) {
|
|
1952
1973
|
return;
|
|
1953
1974
|
}
|
|
1954
|
-
yield* found.store.delete({ ...found.where, fqn }).pipe(
|
|
1975
|
+
yield* found.store.delete({ ...found.where, fqn }).pipe(Effect23.ignore);
|
|
1955
1976
|
});
|
|
1956
1977
|
|
|
1957
1978
|
// src/ownership/probe.ts
|
|
1958
|
-
var provenOurs = (ask, settled) =>
|
|
1979
|
+
var provenOurs = (ask, settled) => Effect24.gen(function* () {
|
|
1959
1980
|
const recorded = yield* recordedInstance(ask.fqn, ask.instanceId);
|
|
1960
1981
|
if (recorded === "absent")
|
|
1961
1982
|
return false;
|
|
1962
1983
|
if (recorded === "partial") {
|
|
1963
|
-
yield*
|
|
1984
|
+
yield* Effect24.logWarning(`${ask.fqn}: the interrupted create's state row lacks part of the declaration (a prop ` + "was still an Output when it was written), so the live object is not proven ours");
|
|
1964
1985
|
return false;
|
|
1965
1986
|
}
|
|
1966
|
-
const unproven = (reason) =>
|
|
1967
|
-
return yield* settled.pipe(
|
|
1987
|
+
const unproven = (reason) => Effect24.as(Effect24.logWarning(`${ask.fqn}: the interrupted create's object could not be compared with its props ` + `(${reason instanceof Error ? reason.message : String(reason)}), so it is not treated as ours`), false);
|
|
1988
|
+
return yield* settled.pipe(Effect24.catch(unproven), Effect24.catchDefect(unproven));
|
|
1968
1989
|
});
|
|
1969
|
-
var ownedRead = (ask, found, settled) =>
|
|
1990
|
+
var ownedRead = (ask, found, settled) => Effect24.gen(function* () {
|
|
1970
1991
|
if (found === undefined || ask.output !== undefined)
|
|
1971
1992
|
return found;
|
|
1972
1993
|
return (yield* provenOurs(ask, settled)) ? found : Unowned4(found);
|
|
@@ -1975,26 +1996,26 @@ var ownedRead = (ask, found, settled) => Effect23.gen(function* () {
|
|
|
1975
1996
|
// src/ownership/resume.ts
|
|
1976
1997
|
import { Unowned as Unowned5 } from "alchemy/AdoptPolicy";
|
|
1977
1998
|
import { Artifacts } from "alchemy/Artifacts";
|
|
1978
|
-
import * as
|
|
1999
|
+
import * as Effect25 from "effect/Effect";
|
|
1979
2000
|
import * as Option3 from "effect/Option";
|
|
1980
2001
|
var PROVEN = "homeflare/ownership/resumes";
|
|
1981
2002
|
var UNFINISHED = "homeflare/ownership/unfinished";
|
|
1982
|
-
var note = (key, instanceId) =>
|
|
1983
|
-
const bag = yield*
|
|
2003
|
+
var note = (key, instanceId) => Effect25.gen(function* () {
|
|
2004
|
+
const bag = yield* Effect25.serviceOption(Artifacts);
|
|
1984
2005
|
if (Option3.isSome(bag))
|
|
1985
2006
|
yield* bag.value.set(key, instanceId);
|
|
1986
2007
|
});
|
|
1987
|
-
var noted = (key, instanceId) =>
|
|
1988
|
-
const bag = yield*
|
|
2008
|
+
var noted = (key, instanceId) => Effect25.gen(function* () {
|
|
2009
|
+
const bag = yield* Effect25.serviceOption(Artifacts);
|
|
1989
2010
|
if (Option3.isNone(bag))
|
|
1990
2011
|
return false;
|
|
1991
2012
|
return (yield* bag.value.get(key)) === instanceId;
|
|
1992
2013
|
});
|
|
1993
|
-
var noteUnfinished = (instanceId) =>
|
|
1994
|
-
var noteResume = (instanceId, recovered) =>
|
|
2014
|
+
var noteUnfinished = (instanceId) => Effect25.as(note(UNFINISHED, instanceId), undefined);
|
|
2015
|
+
var noteResume = (instanceId, recovered) => Effect25.gen(function* () {
|
|
1995
2016
|
yield* noteUnfinished(instanceId);
|
|
1996
|
-
const unproven = () =>
|
|
1997
|
-
const found = yield* recovered.pipe(
|
|
2017
|
+
const unproven = () => Effect25.succeed(undefined);
|
|
2018
|
+
const found = yield* recovered.pipe(Effect25.catch(unproven), Effect25.catchDefect(unproven));
|
|
1998
2019
|
if (found === undefined || found === null || Unowned5.is(found))
|
|
1999
2020
|
return;
|
|
2000
2021
|
yield* note(PROVEN, instanceId);
|
|
@@ -2005,7 +2026,7 @@ var provingResumes = (service) => {
|
|
|
2005
2026
|
const { diff, read } = service;
|
|
2006
2027
|
if (diff === undefined || read === undefined)
|
|
2007
2028
|
return service;
|
|
2008
|
-
const proving = (input) =>
|
|
2029
|
+
const proving = (input) => Effect25.gen(function* () {
|
|
2009
2030
|
if (input.output === undefined) {
|
|
2010
2031
|
yield* noteResume(input.instanceId, read({ ...input, output: undefined }));
|
|
2011
2032
|
}
|
|
@@ -2018,30 +2039,30 @@ var provingResumes = (service) => {
|
|
|
2018
2039
|
import { AdoptPolicy } from "alchemy/AdoptPolicy";
|
|
2019
2040
|
import { AlchemyContext } from "alchemy/AlchemyContext";
|
|
2020
2041
|
import { Stack as Stack3 } from "alchemy/Stack";
|
|
2021
|
-
import * as
|
|
2042
|
+
import * as Effect26 from "effect/Effect";
|
|
2022
2043
|
import * as Option4 from "effect/Option";
|
|
2023
|
-
var adoptEnabled = (fqn) =>
|
|
2024
|
-
const stack = yield*
|
|
2044
|
+
var adoptEnabled = (fqn) => Effect26.gen(function* () {
|
|
2045
|
+
const stack = yield* Effect26.serviceOption(Stack3);
|
|
2025
2046
|
const scoped = Option4.isSome(stack) ? stack.value.resources[fqn]?.Adopt : undefined;
|
|
2026
2047
|
if (scoped !== undefined)
|
|
2027
2048
|
return scoped;
|
|
2028
|
-
const policy = yield*
|
|
2049
|
+
const policy = yield* Effect26.serviceOption(AdoptPolicy);
|
|
2029
2050
|
if (Option4.isSome(policy))
|
|
2030
2051
|
return policy.value;
|
|
2031
|
-
const context = yield*
|
|
2052
|
+
const context = yield* Effect26.serviceOption(AlchemyContext);
|
|
2032
2053
|
return Option4.isSome(context) ? context.value.adopt : false;
|
|
2033
2054
|
});
|
|
2034
|
-
var adoptable = (owner) =>
|
|
2055
|
+
var adoptable = (owner) => Effect26.gen(function* () {
|
|
2035
2056
|
if (yield* isCreate(owner.fqn, owner.instanceId))
|
|
2036
2057
|
return true;
|
|
2037
2058
|
return yield* unfinished(owner.instanceId);
|
|
2038
2059
|
});
|
|
2039
|
-
var adoptsAtApply = (owner) =>
|
|
2060
|
+
var adoptsAtApply = (owner) => Effect26.gen(function* () {
|
|
2040
2061
|
if (!(yield* adoptEnabled(owner.fqn)))
|
|
2041
2062
|
return false;
|
|
2042
2063
|
return yield* adoptable(owner);
|
|
2043
2064
|
});
|
|
2044
|
-
var refuseTakeover = (owner, what) =>
|
|
2065
|
+
var refuseTakeover = (owner, what) => Effect26.gen(function* () {
|
|
2045
2066
|
if (owner.output !== undefined)
|
|
2046
2067
|
return;
|
|
2047
2068
|
if (yield* resumes(owner.instanceId))
|
|
@@ -2051,23 +2072,23 @@ var refuseTakeover = (owner, what) => Effect25.gen(function* () {
|
|
|
2051
2072
|
return;
|
|
2052
2073
|
yield* forgetRefusedCreate(owner.fqn, owner.instanceId);
|
|
2053
2074
|
const remedy = may ? "Deploy with --adopt (or wrap the resource in adopt(true)) to take it over, or remove it first." : "It is the new identity of a replace, which --adopt does not cover: remove it first.";
|
|
2054
|
-
return yield*
|
|
2075
|
+
return yield* Effect26.die(new Error(`${what}: already exists, and this stack holds no state for it — the plan could not ask ` + "first (a prop was still an Output, a replace moved onto it, or it appeared after the " + `plan). Nothing was written. ${remedy}`));
|
|
2055
2076
|
});
|
|
2056
2077
|
var claimFor = (owner) => (what) => refuseTakeover(owner, what);
|
|
2057
2078
|
|
|
2058
2079
|
// src/postgres/role-diff.ts
|
|
2059
2080
|
import { isResolved as isResolved4 } from "alchemy/Diff";
|
|
2060
|
-
import * as
|
|
2061
|
-
var diffPostgresRole = (news, output, env = process.env, observation) =>
|
|
2081
|
+
import * as Effect27 from "effect/Effect";
|
|
2082
|
+
var diffPostgresRole = (news, output, env = process.env, observation) => Effect27.gen(function* () {
|
|
2062
2083
|
if (output === undefined || !isResolved4(news))
|
|
2063
2084
|
return;
|
|
2064
2085
|
if (news.name !== output.name) {
|
|
2065
|
-
return yield*
|
|
2086
|
+
return yield* Effect27.fail(new PostgresRoleRenameRefused({ from: output.name, to: news.name }));
|
|
2066
2087
|
}
|
|
2067
2088
|
yield* refuseAtPlan(news);
|
|
2068
2089
|
const live = observation?.found;
|
|
2069
2090
|
if (live !== undefined && live.oid !== output.oid) {
|
|
2070
|
-
return yield*
|
|
2091
|
+
return yield* Effect27.fail(new PostgresRoleIdentityRefused({
|
|
2071
2092
|
role: output.name,
|
|
2072
2093
|
storedOid: output.oid,
|
|
2073
2094
|
liveOid: live.oid
|
|
@@ -2075,35 +2096,36 @@ var diffPostgresRole = (news, output, env = process.env, observation) => Effect2
|
|
|
2075
2096
|
}
|
|
2076
2097
|
const compared = live ?? output;
|
|
2077
2098
|
const scalars = scalarDrift(news, compared);
|
|
2078
|
-
const membership = membershipDrift(news.memberOf, compared.memberOf ?? [], live === undefined ? new Set : unsafeMemberships(live));
|
|
2099
|
+
const membership = membershipDrift(news.memberOf, compared.memberOf ?? [], live === undefined ? new Set : unsafeMemberships(live, news.inherit));
|
|
2079
2100
|
const resolved = resolvePassword(news, env);
|
|
2101
|
+
yield* assertPasswordAscii(news.name, resolved);
|
|
2080
2102
|
const passwordStale = resolved.value !== undefined && !passwordMatchesSeal(resolved.value, output.passwordSeal);
|
|
2081
2103
|
const absent2 = observation !== undefined && live === undefined;
|
|
2082
|
-
const changed = absent2 || scalars.length > 0 || membership.grants.length > 0 || membership.revokes.length > 0 || passwordStale;
|
|
2104
|
+
const changed = absent2 || privilegedFlags(compared).length > 0 || scalars.length > 0 || membership.grants.length > 0 || membership.revokes.length > 0 || passwordStale;
|
|
2083
2105
|
return changed ? { action: "update" } : { action: "noop" };
|
|
2084
2106
|
});
|
|
2085
2107
|
|
|
2086
2108
|
// src/postgres/role-provider.ts
|
|
2087
2109
|
var postgresRoleHandlers = PostgresRole.Provider.of({
|
|
2088
|
-
list: () =>
|
|
2110
|
+
list: () => Effect28.succeed([]),
|
|
2089
2111
|
nuke: { skip: true },
|
|
2090
|
-
read: ({ fqn, instanceId, olds, output }) =>
|
|
2112
|
+
read: ({ fqn, instanceId, olds, output }) => Effect28.gen(function* () {
|
|
2091
2113
|
const name = output?.name ?? olds.name;
|
|
2092
2114
|
const live = yield* withPg((pg) => readRole(pg, name));
|
|
2093
2115
|
if (live === undefined)
|
|
2094
2116
|
return;
|
|
2095
2117
|
if (output !== undefined && live.oid !== output.oid) {
|
|
2096
|
-
return yield*
|
|
2118
|
+
return yield* Effect28.fail(new PostgresRoleIdentityRefused({
|
|
2097
2119
|
role: name,
|
|
2098
2120
|
storedOid: output.oid,
|
|
2099
2121
|
liveOid: live.oid
|
|
2100
2122
|
}));
|
|
2101
2123
|
}
|
|
2102
2124
|
const passwordSeal = output?.passwordSeal ?? "";
|
|
2103
|
-
const found = { ...live, passwordSeal };
|
|
2104
|
-
return yield* ownedRead({ fqn, instanceId, output }, found,
|
|
2125
|
+
const found = { ...storedAttributes(live), passwordSeal };
|
|
2126
|
+
return yield* ownedRead({ fqn, instanceId, output }, found, Effect28.succeed(declarationMatches(olds, live)));
|
|
2105
2127
|
}),
|
|
2106
|
-
diff: ({ news, output, instanceId }) =>
|
|
2128
|
+
diff: ({ news, output, instanceId }) => Effect28.gen(function* () {
|
|
2107
2129
|
if (output === undefined)
|
|
2108
2130
|
return yield* noteUnfinished(instanceId);
|
|
2109
2131
|
if (!isResolved5(news))
|
|
@@ -2111,9 +2133,9 @@ var postgresRoleHandlers = PostgresRole.Provider.of({
|
|
|
2111
2133
|
const found = yield* withPg((pg) => readRole(pg, output.name));
|
|
2112
2134
|
return yield* diffPostgresRole(news, output, process.env, { found });
|
|
2113
2135
|
}),
|
|
2114
|
-
reconcile: ({ fqn, instanceId, news, output }) =>
|
|
2136
|
+
reconcile: ({ fqn, instanceId, news, output }) => Effect28.gen(function* () {
|
|
2115
2137
|
yield* refuseAtPlan(news);
|
|
2116
|
-
return yield* withPg((pg) =>
|
|
2138
|
+
return yield* withPg((pg) => Effect28.gen(function* () {
|
|
2117
2139
|
const observed = yield* readRole(pg, news.name);
|
|
2118
2140
|
if (observed !== undefined && output === undefined) {
|
|
2119
2141
|
yield* refuseTakeover({ fqn, instanceId, output }, "Postgres.Role");
|
|
@@ -2121,20 +2143,20 @@ var postgresRoleHandlers = PostgresRole.Provider.of({
|
|
|
2121
2143
|
return yield* reconcileWithClient4(pg, news, process.env, output?.passwordSeal, output?.oid);
|
|
2122
2144
|
}));
|
|
2123
2145
|
}),
|
|
2124
|
-
delete: ({ output }) => withPg((pg) =>
|
|
2146
|
+
delete: ({ output }) => withPg((pg) => Effect28.gen(function* () {
|
|
2125
2147
|
if (output === undefined)
|
|
2126
2148
|
return;
|
|
2127
2149
|
const live = yield* readRole(pg, output.name);
|
|
2128
2150
|
if (live === undefined)
|
|
2129
2151
|
return;
|
|
2130
2152
|
if (live.oid !== output.oid) {
|
|
2131
|
-
return yield*
|
|
2153
|
+
return yield* Effect28.fail(new PostgresRoleIdentityRefused({
|
|
2132
2154
|
role: output.name,
|
|
2133
2155
|
storedOid: output.oid,
|
|
2134
2156
|
liveOid: live.oid
|
|
2135
2157
|
}));
|
|
2136
2158
|
}
|
|
2137
|
-
yield* pg.unsafe(buildDropRoleSql(output.name)).pipe(
|
|
2159
|
+
yield* pg.unsafe(buildDropRoleSql(output.name)).pipe(Effect28.asVoid);
|
|
2138
2160
|
}))
|
|
2139
2161
|
});
|
|
2140
2162
|
var PostgresRoleProvider = () => Provider4.succeed(PostgresRole, postgresRoleHandlers);
|
|
@@ -2175,6 +2197,7 @@ export {
|
|
|
2175
2197
|
PostgresRoleNameRefused,
|
|
2176
2198
|
PostgresRoleParentMissing,
|
|
2177
2199
|
PostgresRolePasswordEnvUnsetError,
|
|
2200
|
+
PostgresRolePasswordNonAsciiRefused,
|
|
2178
2201
|
PostgresRolePrivilegedRefused,
|
|
2179
2202
|
PostgresRoleProvider,
|
|
2180
2203
|
PostgresRoleRenameRefused,
|
|
@@ -2258,5 +2281,5 @@ export {
|
|
|
2258
2281
|
withPg
|
|
2259
2282
|
};
|
|
2260
2283
|
|
|
2261
|
-
//# debugId=
|
|
2284
|
+
//# debugId=584CB763916085BE64756E2164756E21
|
|
2262
2285
|
//# sourceMappingURL=index.js.map
|