@reyemtech/nimbus 2.12.5 → 3.0.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/README.md +2 -0
- package/dist/cjs/backup/index.d.ts.map +1 -1
- package/dist/cjs/backup/index.js +6 -1
- package/dist/cjs/backup/index.js.map +1 -1
- package/dist/cjs/cli/migrate-cnpg-ownership.d.ts +43 -0
- package/dist/cjs/cli/migrate-cnpg-ownership.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-cnpg-ownership.js +67 -0
- package/dist/cjs/cli/migrate-cnpg-ownership.js.map +1 -0
- package/dist/cjs/cli/migrate-cnpg-roles.d.ts +92 -0
- package/dist/cjs/cli/migrate-cnpg-roles.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-cnpg-roles.js +337 -0
- package/dist/cjs/cli/migrate-cnpg-roles.js.map +1 -0
- package/dist/cjs/cli/migrate-cnpg.d.ts +38 -0
- package/dist/cjs/cli/migrate-cnpg.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-cnpg.js +258 -0
- package/dist/cjs/cli/migrate-cnpg.js.map +1 -0
- package/dist/cjs/cli/migrate-exec.d.ts +45 -0
- package/dist/cjs/cli/migrate-exec.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-exec.js +104 -0
- package/dist/cjs/cli/migrate-exec.js.map +1 -0
- package/dist/cjs/cli/migrate-psql.d.ts +125 -0
- package/dist/cjs/cli/migrate-psql.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-psql.js +213 -0
- package/dist/cjs/cli/migrate-psql.js.map +1 -0
- package/dist/cjs/cli/migrate-report.d.ts +27 -0
- package/dist/cjs/cli/migrate-report.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-report.js +29 -0
- package/dist/cjs/cli/migrate-report.js.map +1 -0
- package/dist/cjs/cli/migrate-superuser.d.ts +22 -0
- package/dist/cjs/cli/migrate-superuser.d.ts.map +1 -0
- package/dist/cjs/cli/migrate-superuser.js +73 -0
- package/dist/cjs/cli/migrate-superuser.js.map +1 -0
- package/dist/cjs/cli/migrate.d.ts +37 -0
- package/dist/cjs/cli/migrate.d.ts.map +1 -0
- package/dist/cjs/cli/migrate.js +67 -0
- package/dist/cjs/cli/migrate.js.map +1 -0
- package/dist/cjs/cli.d.ts +1 -0
- package/dist/cjs/cli.d.ts.map +1 -1
- package/dist/cjs/cli.js +6 -0
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/operator/cnpg-common.d.ts +56 -0
- package/dist/cjs/operator/cnpg-common.d.ts.map +1 -0
- package/dist/cjs/operator/cnpg-common.js +82 -0
- package/dist/cjs/operator/cnpg-common.js.map +1 -0
- package/dist/cjs/operator/cnpg-database.d.ts +66 -0
- package/dist/cjs/operator/cnpg-database.d.ts.map +1 -0
- package/dist/cjs/operator/cnpg-database.js +296 -0
- package/dist/cjs/operator/cnpg-database.js.map +1 -0
- package/dist/cjs/operator/cnpg-roles.d.ts +173 -0
- package/dist/cjs/operator/cnpg-roles.d.ts.map +1 -0
- package/dist/cjs/operator/cnpg-roles.js +225 -0
- package/dist/cjs/operator/cnpg-roles.js.map +1 -0
- package/dist/cjs/operator/cnpg.d.ts.map +1 -1
- package/dist/cjs/operator/cnpg.js +50 -162
- package/dist/cjs/operator/cnpg.js.map +1 -1
- package/dist/cjs/operator/connection-uri.d.ts +44 -0
- package/dist/cjs/operator/connection-uri.d.ts.map +1 -0
- package/dist/cjs/operator/connection-uri.js +49 -0
- package/dist/cjs/operator/connection-uri.js.map +1 -0
- package/dist/cjs/operator/credentials.d.ts +76 -0
- package/dist/cjs/operator/credentials.d.ts.map +1 -0
- package/dist/cjs/operator/credentials.js +106 -0
- package/dist/cjs/operator/credentials.js.map +1 -0
- package/dist/cjs/operator/database-options.d.ts +121 -0
- package/dist/cjs/operator/database-options.d.ts.map +1 -0
- package/dist/cjs/operator/database-options.js +131 -0
- package/dist/cjs/operator/database-options.js.map +1 -0
- package/dist/cjs/operator/grants/postgres-job.d.ts +109 -0
- package/dist/cjs/operator/grants/postgres-job.d.ts.map +1 -0
- package/dist/cjs/operator/grants/postgres-job.js +232 -0
- package/dist/cjs/operator/grants/postgres-job.js.map +1 -0
- package/dist/cjs/operator/grants/postgres-sql.d.ts +130 -0
- package/dist/cjs/operator/grants/postgres-sql.d.ts.map +1 -0
- package/dist/cjs/operator/grants/postgres-sql.js +305 -0
- package/dist/cjs/operator/grants/postgres-sql.js.map +1 -0
- package/dist/cjs/operator/grants/privileges.d.ts +24 -0
- package/dist/cjs/operator/grants/privileges.d.ts.map +1 -0
- package/dist/cjs/operator/grants/privileges.js +35 -0
- package/dist/cjs/operator/grants/privileges.js.map +1 -0
- package/dist/cjs/operator/grants/role-config.d.ts +80 -0
- package/dist/cjs/operator/grants/role-config.d.ts.map +1 -0
- package/dist/cjs/operator/grants/role-config.js +134 -0
- package/dist/cjs/operator/grants/role-config.js.map +1 -0
- package/dist/cjs/operator/index.d.ts +1 -1
- package/dist/cjs/operator/index.d.ts.map +1 -1
- package/dist/cjs/operator/index.js.map +1 -1
- package/dist/cjs/operator/interfaces.d.ts +223 -1
- package/dist/cjs/operator/interfaces.d.ts.map +1 -1
- package/dist/cjs/operator/interfaces.js.map +1 -1
- package/dist/cjs/operator/mariadb-common.d.ts +99 -0
- package/dist/cjs/operator/mariadb-common.d.ts.map +1 -0
- package/dist/cjs/operator/mariadb-common.js +141 -0
- package/dist/cjs/operator/mariadb-common.js.map +1 -0
- package/dist/cjs/operator/mariadb-database.d.ts +65 -0
- package/dist/cjs/operator/mariadb-database.d.ts.map +1 -0
- package/dist/cjs/operator/mariadb-database.js +285 -0
- package/dist/cjs/operator/mariadb-database.js.map +1 -0
- package/dist/cjs/operator/mariadb-roles.d.ts +264 -0
- package/dist/cjs/operator/mariadb-roles.d.ts.map +1 -0
- package/dist/cjs/operator/mariadb-roles.js +366 -0
- package/dist/cjs/operator/mariadb-roles.js.map +1 -0
- package/dist/cjs/operator/mariadb.d.ts.map +1 -1
- package/dist/cjs/operator/mariadb.js +35 -147
- package/dist/cjs/operator/mariadb.js.map +1 -1
- package/dist/cjs/operator/neo4j-common.d.ts +62 -0
- package/dist/cjs/operator/neo4j-common.d.ts.map +1 -0
- package/dist/cjs/operator/neo4j-common.js +89 -0
- package/dist/cjs/operator/neo4j-common.js.map +1 -0
- package/dist/cjs/operator/neo4j-database.d.ts +88 -0
- package/dist/cjs/operator/neo4j-database.d.ts.map +1 -0
- package/dist/cjs/operator/neo4j-database.js +274 -0
- package/dist/cjs/operator/neo4j-database.js.map +1 -0
- package/dist/cjs/operator/neo4j-roles.d.ts +203 -0
- package/dist/cjs/operator/neo4j-roles.d.ts.map +1 -0
- package/dist/cjs/operator/neo4j-roles.js +298 -0
- package/dist/cjs/operator/neo4j-roles.js.map +1 -0
- package/dist/cjs/operator/neo4j.d.ts.map +1 -1
- package/dist/cjs/operator/neo4j.js +32 -132
- package/dist/cjs/operator/neo4j.js.map +1 -1
- package/dist/cjs/operator/resource-identity.d.ts +170 -0
- package/dist/cjs/operator/resource-identity.d.ts.map +1 -0
- package/dist/cjs/operator/resource-identity.js +231 -0
- package/dist/cjs/operator/resource-identity.js.map +1 -0
- package/dist/cjs/operator/role-registry.d.ts +85 -0
- package/dist/cjs/operator/role-registry.d.ts.map +1 -0
- package/dist/cjs/operator/role-registry.js +72 -0
- package/dist/cjs/operator/role-registry.js.map +1 -0
- package/dist/cjs/platform/components/image-pruner.d.ts +3 -1
- package/dist/cjs/platform/components/image-pruner.d.ts.map +1 -1
- package/dist/cjs/platform/components/image-pruner.js +38 -19
- package/dist/cjs/platform/components/image-pruner.js.map +1 -1
- package/dist/cjs/types/errors.d.ts +3 -0
- package/dist/cjs/types/errors.d.ts.map +1 -1
- package/dist/cjs/types/errors.js +3 -0
- package/dist/cjs/types/errors.js.map +1 -1
- package/dist/esm/backup/index.d.ts.map +1 -1
- package/dist/esm/backup/index.js +6 -1
- package/dist/esm/backup/index.js.map +1 -1
- package/dist/esm/cli/migrate-cnpg-ownership.d.ts +43 -0
- package/dist/esm/cli/migrate-cnpg-ownership.d.ts.map +1 -0
- package/dist/esm/cli/migrate-cnpg-ownership.js +67 -0
- package/dist/esm/cli/migrate-cnpg-ownership.js.map +1 -0
- package/dist/esm/cli/migrate-cnpg-roles.d.ts +92 -0
- package/dist/esm/cli/migrate-cnpg-roles.d.ts.map +1 -0
- package/dist/esm/cli/migrate-cnpg-roles.js +337 -0
- package/dist/esm/cli/migrate-cnpg-roles.js.map +1 -0
- package/dist/esm/cli/migrate-cnpg.d.ts +38 -0
- package/dist/esm/cli/migrate-cnpg.d.ts.map +1 -0
- package/dist/esm/cli/migrate-cnpg.js +258 -0
- package/dist/esm/cli/migrate-cnpg.js.map +1 -0
- package/dist/esm/cli/migrate-exec.d.ts +45 -0
- package/dist/esm/cli/migrate-exec.d.ts.map +1 -0
- package/dist/esm/cli/migrate-exec.js +104 -0
- package/dist/esm/cli/migrate-exec.js.map +1 -0
- package/dist/esm/cli/migrate-psql.d.ts +125 -0
- package/dist/esm/cli/migrate-psql.d.ts.map +1 -0
- package/dist/esm/cli/migrate-psql.js +213 -0
- package/dist/esm/cli/migrate-psql.js.map +1 -0
- package/dist/esm/cli/migrate-report.d.ts +27 -0
- package/dist/esm/cli/migrate-report.d.ts.map +1 -0
- package/dist/esm/cli/migrate-report.js +29 -0
- package/dist/esm/cli/migrate-report.js.map +1 -0
- package/dist/esm/cli/migrate-superuser.d.ts +22 -0
- package/dist/esm/cli/migrate-superuser.d.ts.map +1 -0
- package/dist/esm/cli/migrate-superuser.js +73 -0
- package/dist/esm/cli/migrate-superuser.js.map +1 -0
- package/dist/esm/cli/migrate.d.ts +37 -0
- package/dist/esm/cli/migrate.d.ts.map +1 -0
- package/dist/esm/cli/migrate.js +67 -0
- package/dist/esm/cli/migrate.js.map +1 -0
- package/dist/esm/cli.d.ts +1 -0
- package/dist/esm/cli.d.ts.map +1 -1
- package/dist/esm/cli.js +6 -0
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/operator/cnpg-common.d.ts +56 -0
- package/dist/esm/operator/cnpg-common.d.ts.map +1 -0
- package/dist/esm/operator/cnpg-common.js +82 -0
- package/dist/esm/operator/cnpg-common.js.map +1 -0
- package/dist/esm/operator/cnpg-database.d.ts +66 -0
- package/dist/esm/operator/cnpg-database.d.ts.map +1 -0
- package/dist/esm/operator/cnpg-database.js +296 -0
- package/dist/esm/operator/cnpg-database.js.map +1 -0
- package/dist/esm/operator/cnpg-roles.d.ts +173 -0
- package/dist/esm/operator/cnpg-roles.d.ts.map +1 -0
- package/dist/esm/operator/cnpg-roles.js +225 -0
- package/dist/esm/operator/cnpg-roles.js.map +1 -0
- package/dist/esm/operator/cnpg.d.ts.map +1 -1
- package/dist/esm/operator/cnpg.js +50 -162
- package/dist/esm/operator/cnpg.js.map +1 -1
- package/dist/esm/operator/connection-uri.d.ts +44 -0
- package/dist/esm/operator/connection-uri.d.ts.map +1 -0
- package/dist/esm/operator/connection-uri.js +49 -0
- package/dist/esm/operator/connection-uri.js.map +1 -0
- package/dist/esm/operator/credentials.d.ts +76 -0
- package/dist/esm/operator/credentials.d.ts.map +1 -0
- package/dist/esm/operator/credentials.js +106 -0
- package/dist/esm/operator/credentials.js.map +1 -0
- package/dist/esm/operator/database-options.d.ts +121 -0
- package/dist/esm/operator/database-options.d.ts.map +1 -0
- package/dist/esm/operator/database-options.js +131 -0
- package/dist/esm/operator/database-options.js.map +1 -0
- package/dist/esm/operator/grants/postgres-job.d.ts +109 -0
- package/dist/esm/operator/grants/postgres-job.d.ts.map +1 -0
- package/dist/esm/operator/grants/postgres-job.js +232 -0
- package/dist/esm/operator/grants/postgres-job.js.map +1 -0
- package/dist/esm/operator/grants/postgres-sql.d.ts +130 -0
- package/dist/esm/operator/grants/postgres-sql.d.ts.map +1 -0
- package/dist/esm/operator/grants/postgres-sql.js +305 -0
- package/dist/esm/operator/grants/postgres-sql.js.map +1 -0
- package/dist/esm/operator/grants/privileges.d.ts +24 -0
- package/dist/esm/operator/grants/privileges.d.ts.map +1 -0
- package/dist/esm/operator/grants/privileges.js +35 -0
- package/dist/esm/operator/grants/privileges.js.map +1 -0
- package/dist/esm/operator/grants/role-config.d.ts +80 -0
- package/dist/esm/operator/grants/role-config.d.ts.map +1 -0
- package/dist/esm/operator/grants/role-config.js +134 -0
- package/dist/esm/operator/grants/role-config.js.map +1 -0
- package/dist/esm/operator/index.d.ts +1 -1
- package/dist/esm/operator/index.d.ts.map +1 -1
- package/dist/esm/operator/index.js.map +1 -1
- package/dist/esm/operator/interfaces.d.ts +223 -1
- package/dist/esm/operator/interfaces.d.ts.map +1 -1
- package/dist/esm/operator/interfaces.js.map +1 -1
- package/dist/esm/operator/mariadb-common.d.ts +99 -0
- package/dist/esm/operator/mariadb-common.d.ts.map +1 -0
- package/dist/esm/operator/mariadb-common.js +141 -0
- package/dist/esm/operator/mariadb-common.js.map +1 -0
- package/dist/esm/operator/mariadb-database.d.ts +65 -0
- package/dist/esm/operator/mariadb-database.d.ts.map +1 -0
- package/dist/esm/operator/mariadb-database.js +285 -0
- package/dist/esm/operator/mariadb-database.js.map +1 -0
- package/dist/esm/operator/mariadb-roles.d.ts +264 -0
- package/dist/esm/operator/mariadb-roles.d.ts.map +1 -0
- package/dist/esm/operator/mariadb-roles.js +366 -0
- package/dist/esm/operator/mariadb-roles.js.map +1 -0
- package/dist/esm/operator/mariadb.d.ts.map +1 -1
- package/dist/esm/operator/mariadb.js +35 -147
- package/dist/esm/operator/mariadb.js.map +1 -1
- package/dist/esm/operator/neo4j-common.d.ts +62 -0
- package/dist/esm/operator/neo4j-common.d.ts.map +1 -0
- package/dist/esm/operator/neo4j-common.js +89 -0
- package/dist/esm/operator/neo4j-common.js.map +1 -0
- package/dist/esm/operator/neo4j-database.d.ts +88 -0
- package/dist/esm/operator/neo4j-database.d.ts.map +1 -0
- package/dist/esm/operator/neo4j-database.js +274 -0
- package/dist/esm/operator/neo4j-database.js.map +1 -0
- package/dist/esm/operator/neo4j-roles.d.ts +203 -0
- package/dist/esm/operator/neo4j-roles.d.ts.map +1 -0
- package/dist/esm/operator/neo4j-roles.js +298 -0
- package/dist/esm/operator/neo4j-roles.js.map +1 -0
- package/dist/esm/operator/neo4j.d.ts.map +1 -1
- package/dist/esm/operator/neo4j.js +32 -132
- package/dist/esm/operator/neo4j.js.map +1 -1
- package/dist/esm/operator/resource-identity.d.ts +170 -0
- package/dist/esm/operator/resource-identity.d.ts.map +1 -0
- package/dist/esm/operator/resource-identity.js +231 -0
- package/dist/esm/operator/resource-identity.js.map +1 -0
- package/dist/esm/operator/role-registry.d.ts +85 -0
- package/dist/esm/operator/role-registry.d.ts.map +1 -0
- package/dist/esm/operator/role-registry.js +72 -0
- package/dist/esm/operator/role-registry.js.map +1 -0
- package/dist/esm/platform/components/image-pruner.d.ts +3 -1
- package/dist/esm/platform/components/image-pruner.d.ts.map +1 -1
- package/dist/esm/platform/components/image-pruner.js +38 -19
- package/dist/esm/platform/components/image-pruner.js.map +1 -1
- package/dist/esm/types/errors.d.ts +3 -0
- package/dist/esm/types/errors.d.ts.map +1 -1
- package/dist/esm/types/errors.js +3 -0
- package/dist/esm/types/errors.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MariaDB users inside a MariaDB Operator instance.
|
|
3
|
+
*
|
|
4
|
+
* Every user — the database owner created alongside the database, and every
|
|
5
|
+
* role added later via `addRole()` — is provisioned by the single function
|
|
6
|
+
* {@link provisionMariadbRole}. Unlike CloudNativePG, mariadb-operator models
|
|
7
|
+
* privileges declaratively with a `Grant` CRD, so no SQL Job is involved
|
|
8
|
+
* anywhere: an {@link IDatabaseGrant} maps directly onto a `Grant` custom
|
|
9
|
+
* resource and the operator reconciles it continuously.
|
|
10
|
+
*
|
|
11
|
+
* Only the names differ between the two paths, and those names are the one
|
|
12
|
+
* genuinely dangerous part: Pulumi identifies a resource by its logical name,
|
|
13
|
+
* so renaming one deletes and recreates it, and for a credential Secret that
|
|
14
|
+
* regenerates the password and breaks every application already using it.
|
|
15
|
+
* {@link ownerRoleNaming} therefore pins the owner's names to the exact strings
|
|
16
|
+
* live stacks already carry.
|
|
17
|
+
*
|
|
18
|
+
* @module operator/mariadb-roles
|
|
19
|
+
*/
|
|
20
|
+
import * as k8s from "@pulumi/kubernetes";
|
|
21
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
22
|
+
import { type IRoleCredentials } from "./credentials.js";
|
|
23
|
+
import type { IDatabaseGrant } from "./interfaces.js";
|
|
24
|
+
/** Pulumi logical and Kubernetes names for one `Grant` custom resource. */
|
|
25
|
+
export interface IMariadbGrantNaming {
|
|
26
|
+
/** Pulumi logical name of the `Grant` custom resource. */
|
|
27
|
+
readonly resource: string;
|
|
28
|
+
/** Kubernetes name of the `Grant` custom resource. */
|
|
29
|
+
readonly metadataName: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Every name — Pulumi logical and Kubernetes — used by one provisioned user.
|
|
33
|
+
*
|
|
34
|
+
* Collecting them in one place keeps the replace-on-rename risk reviewable
|
|
35
|
+
* instead of scattered through the provisioning code.
|
|
36
|
+
*/
|
|
37
|
+
export interface IMariadbRoleNaming {
|
|
38
|
+
/** Pulumi logical name of the password Secret. */
|
|
39
|
+
readonly credentialResource: string;
|
|
40
|
+
/** Kubernetes name of the password Secret. */
|
|
41
|
+
readonly credentialSecret: string;
|
|
42
|
+
/** Pulumi logical name of the `User` custom resource. */
|
|
43
|
+
readonly userResource: string;
|
|
44
|
+
/** Kubernetes name of the `User` custom resource. */
|
|
45
|
+
readonly userMetadataName: string;
|
|
46
|
+
/** Pulumi logical name prefix of the replicated connection Secrets. */
|
|
47
|
+
readonly connectionResourcePrefix: string;
|
|
48
|
+
/** Kubernetes name of each replicated connection Secret. */
|
|
49
|
+
readonly connectionSecret: string;
|
|
50
|
+
/**
|
|
51
|
+
* Names for the `Grant` custom resource covering `table`.
|
|
52
|
+
*
|
|
53
|
+
* A user may hold any number of grants, so these cannot be plain fields.
|
|
54
|
+
* Keying on the table rather than the grant's position makes reordering a
|
|
55
|
+
* role's `grants` array a no-op and an edit to its privileges an in-place
|
|
56
|
+
* update; only changing the table forces a replace, which is the one case
|
|
57
|
+
* where a replace is correct. The owner holds exactly one grant and ignores
|
|
58
|
+
* the argument entirely, which is how its pre-existing unsuffixed name
|
|
59
|
+
* survives.
|
|
60
|
+
*
|
|
61
|
+
* The key must be injective over table names for the same reason a role's
|
|
62
|
+
* name must be: two Grant CRs deriving one logical name abort the preview
|
|
63
|
+
* with a duplicate URN. See {@link toIdentitySegment}.
|
|
64
|
+
*
|
|
65
|
+
* @param table - The grant's `spec.table`, `"*"` for the whole database
|
|
66
|
+
* @returns The grant's Pulumi logical and Kubernetes names
|
|
67
|
+
*/
|
|
68
|
+
grantNaming(table: string): IMariadbGrantNaming;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Names for the database owner's user.
|
|
72
|
+
*
|
|
73
|
+
* These strings predate the shared provisioner and are reproduced verbatim:
|
|
74
|
+
* `-password-secret`, `-user`, `-grant`, and `-secret-{namespace}` are the
|
|
75
|
+
* logical names live stacks already carry, and `metadata.name` is the
|
|
76
|
+
* unsanitized `{cluster}-{database}` those objects were created under. Do not
|
|
77
|
+
* "tidy" them.
|
|
78
|
+
*
|
|
79
|
+
* @param clusterName - MariaDB instance name
|
|
80
|
+
* @param dbName - Database name
|
|
81
|
+
* @returns The owner user's pinned naming
|
|
82
|
+
*/
|
|
83
|
+
export declare function ownerRoleNaming(clusterName: string, dbName: string): IMariadbRoleNaming;
|
|
84
|
+
/**
|
|
85
|
+
* Names for a user added via `addRole()`.
|
|
86
|
+
*
|
|
87
|
+
* Every name is prefixed `{cluster}-{database}-role-{role}` so it can never
|
|
88
|
+
* collide with the owner's pinned names above — the owner's names have no
|
|
89
|
+
* `-role-` segment following `{cluster}-{database}`.
|
|
90
|
+
*
|
|
91
|
+
* Grants are named for the table they cover (`*` renders as `all`), never for
|
|
92
|
+
* their position, so reordering a role's `grants` array changes nothing.
|
|
93
|
+
*
|
|
94
|
+
* **The identity is the `username`@`host` pair, not the username.** MariaDB
|
|
95
|
+
* treats those two together as one account, which is why the role registry
|
|
96
|
+
* permits `reader`@`%` and `reader`@`10.0.0.1` to coexist — and a name derived
|
|
97
|
+
* from the username alone made the second of them register under the first's
|
|
98
|
+
* logical names, aborting the preview with a duplicate URN so that the account
|
|
99
|
+
* the registry had just allowed could never actually be created. Folding the
|
|
100
|
+
* host in also keeps a host *change* honest: it derives new names rather than
|
|
101
|
+
* attempting an in-place update of `spec.host`, which mariadb-operator treats as
|
|
102
|
+
* immutable.
|
|
103
|
+
*
|
|
104
|
+
* The role segment comes from {@link toCompositeIdentitySegment}, not from plain
|
|
105
|
+
* sanitizing: `Read_Only` and `read_only` are two distinct, simultaneously valid
|
|
106
|
+
* MariaDB usernames that sanitize alike, and two resources deriving one logical
|
|
107
|
+
* name abort the entire preview with a duplicate-URN error. Every segment
|
|
108
|
+
* carries the hash, including names that needed no sanitizing, so no raw name
|
|
109
|
+
* can land on another's encoded form.
|
|
110
|
+
*
|
|
111
|
+
* Every name is then bounded by {@link toBoundedName}: instance, database, role
|
|
112
|
+
* and table names are all caller-controlled and unbounded, and a `metadata.name`
|
|
113
|
+
* over {@link DNS_1123_SUBDOMAIN_MAX_LENGTH} is rejected by the Kubernetes API
|
|
114
|
+
* at apply time — after preview has passed, so the CRs the account needs are
|
|
115
|
+
* never created. Nothing here names a Job, so the stricter 63-character label
|
|
116
|
+
* limit does not apply and ordinary names keep their readable form.
|
|
117
|
+
*
|
|
118
|
+
* @param clusterName - MariaDB instance name
|
|
119
|
+
* @param dbName - Database name
|
|
120
|
+
* @param roleName - Role name as it exists in MariaDB
|
|
121
|
+
* @param host - Effective host pattern, as returned by `resolveMariadbHost`
|
|
122
|
+
* @returns Naming for the additional user's resources, each within the DNS-1123
|
|
123
|
+
* subdomain limit
|
|
124
|
+
*/
|
|
125
|
+
export declare function additionalRoleNaming(clusterName: string, dbName: string, roleName: string, host: string): IMariadbRoleNaming;
|
|
126
|
+
/** One privilege grant expressed in mariadb-operator's own terms. */
|
|
127
|
+
export interface IMariadbGrantSpec {
|
|
128
|
+
/** Privileges granted, upper-cased as MariaDB spells them. */
|
|
129
|
+
readonly privileges: ReadonlyArray<string>;
|
|
130
|
+
/** Table the grant is scoped to, or `"*"` for every table in the database. */
|
|
131
|
+
readonly table: string;
|
|
132
|
+
/** Whether the grantee may pass these privileges on to others. */
|
|
133
|
+
readonly grantOption: boolean;
|
|
134
|
+
}
|
|
135
|
+
/** The database owner's grant: everything on the database, with `GRANT OPTION`. */
|
|
136
|
+
export declare const OWNER_GRANT: IMariadbGrantSpec;
|
|
137
|
+
/**
|
|
138
|
+
* Translate portable grants into mariadb-operator `Grant` specs, one per table.
|
|
139
|
+
*
|
|
140
|
+
* `IDatabaseGrant.schema` has no MariaDB equivalent and is dropped — MariaDB
|
|
141
|
+
* has no schema concept distinct from the database itself. `objects` is either
|
|
142
|
+
* a single table name or `"all"`, which becomes `"*"`.
|
|
143
|
+
*
|
|
144
|
+
* **Grants are merged by table.** A role may legitimately express two grants for
|
|
145
|
+
* one table — separate `SELECT` and `INSERT` entries, say — but
|
|
146
|
+
* {@link IMariadbRoleNaming.grantNaming} keys a `Grant` CR's logical name on the
|
|
147
|
+
* table, so rendering both would register two resources under one name and abort
|
|
148
|
+
* the preview with a duplicate-URN error instead of provisioning anything. Their
|
|
149
|
+
* privileges are unioned into a single CR, which is also what the caller meant.
|
|
150
|
+
*
|
|
151
|
+
* The result is canonical: privileges are deduplicated after normalization and
|
|
152
|
+
* sorted, and tables are sorted, so reordering the input array produces byte-
|
|
153
|
+
* identical output and no Pulumi diff. `ALL PRIVILEGES` absorbs everything it is
|
|
154
|
+
* merged with — MariaDB's `GRANT` grammar rejects it alongside other privileges,
|
|
155
|
+
* so a union that keeps both would only render invalid SQL.
|
|
156
|
+
*
|
|
157
|
+
* @param grants - Portable grants from the role configuration
|
|
158
|
+
* @returns One MariaDB grant spec per distinct table, ordered by table name
|
|
159
|
+
* @throws {AnyCloudError} code `UNSUPPORTED_PRIVILEGE` when a grant names a
|
|
160
|
+
* privilege outside {@link ALLOWED_PRIVILEGES}
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* toMariadbGrants([
|
|
165
|
+
* { privileges: ["SELECT"], objects: "orders" },
|
|
166
|
+
* { privileges: ["INSERT"], objects: "orders" },
|
|
167
|
+
* ]);
|
|
168
|
+
* // → [{ privileges: ["INSERT", "SELECT"], table: "orders", grantOption: false }]
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare function toMariadbGrants(grants: ReadonlyArray<IDatabaseGrant>): ReadonlyArray<IMariadbGrantSpec>;
|
|
172
|
+
/** Inputs for {@link provisionMariadbRole}. */
|
|
173
|
+
export interface IMariadbRoleOptions {
|
|
174
|
+
/** MariaDB instance the user belongs to. */
|
|
175
|
+
readonly clusterName: string;
|
|
176
|
+
/** Database the grants are scoped to. */
|
|
177
|
+
readonly dbName: string;
|
|
178
|
+
/** Username as it will exist in MariaDB, passed through verbatim. */
|
|
179
|
+
readonly roleName: string;
|
|
180
|
+
/** Pinned Pulumi and Kubernetes names for this user's resources. */
|
|
181
|
+
readonly naming: IMariadbRoleNaming;
|
|
182
|
+
/** Grants to create, already translated by {@link toMariadbGrants}. */
|
|
183
|
+
readonly grants: ReadonlyArray<IMariadbGrantSpec>;
|
|
184
|
+
/**
|
|
185
|
+
* Effective host pattern the user may connect from.
|
|
186
|
+
*
|
|
187
|
+
* Written to both CRs exactly as given, or omitted from both when undefined —
|
|
188
|
+
* which is how the owner's pre-existing specs stay byte-identical rather than
|
|
189
|
+
* gaining an explicit copy of the operator's own default.
|
|
190
|
+
*
|
|
191
|
+
* Callers pass the *resolved* value, never the raw configuration: see
|
|
192
|
+
* {@link resolveMariadbHost}. Omitting a blank host instead of writing it
|
|
193
|
+
* would silently hand the account the operator's default while the registry
|
|
194
|
+
* and the resource names identified it by the blank value, so a blank string
|
|
195
|
+
* is deliberately not treated as "unset" here.
|
|
196
|
+
*/
|
|
197
|
+
readonly host?: string;
|
|
198
|
+
/** Concurrent connection cap. Default: {@link DEFAULT_MAX_USER_CONNECTIONS}. */
|
|
199
|
+
readonly maxUserConnections?: number;
|
|
200
|
+
/** Labels applied to every created object. */
|
|
201
|
+
readonly labels: Record<string, string>;
|
|
202
|
+
/** The `MariaDB` CR the user is created on. */
|
|
203
|
+
readonly mariadb: k8s.apiextensions.CustomResource;
|
|
204
|
+
/** The `Database` CR the grants are scoped to. */
|
|
205
|
+
readonly database: k8s.apiextensions.CustomResource;
|
|
206
|
+
/** Kubernetes provider. */
|
|
207
|
+
readonly provider: k8s.Provider;
|
|
208
|
+
}
|
|
209
|
+
/** A provisioned user, its grants, and the credentials backing it. */
|
|
210
|
+
export interface IMariadbProvisionedRole {
|
|
211
|
+
/** The `User` custom resource. */
|
|
212
|
+
readonly user: k8s.apiextensions.CustomResource;
|
|
213
|
+
/** One `Grant` custom resource per requested grant, in the order supplied. */
|
|
214
|
+
readonly grants: ReadonlyArray<k8s.apiextensions.CustomResource>;
|
|
215
|
+
/** The user's password Secret and its stable password. */
|
|
216
|
+
readonly credentials: IRoleCredentials;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Provision one MariaDB user: a password Secret, the `User` CR that reconciles
|
|
220
|
+
* the account, and one `Grant` CR per requested privilege set.
|
|
221
|
+
*
|
|
222
|
+
* The Secret holds only `password` — the `User` CR names the account itself, so
|
|
223
|
+
* a `username` key would be redundant, and adding one would change the schema
|
|
224
|
+
* of a Secret live applications already read.
|
|
225
|
+
*
|
|
226
|
+
* @param options - Instance, username, pinned naming, and translated grants
|
|
227
|
+
* @returns The `User` CR, its `Grant` CRs, and the credentials it authenticates with
|
|
228
|
+
*/
|
|
229
|
+
export declare function provisionMariadbRole(options: IMariadbRoleOptions): IMariadbProvisionedRole;
|
|
230
|
+
/** Inputs for {@link replicateMariadbConnectionSecrets}. */
|
|
231
|
+
export interface IMariadbConnectionSecretOptions {
|
|
232
|
+
/** Pinned naming for the user whose credentials are replicated. */
|
|
233
|
+
readonly naming: IMariadbRoleNaming;
|
|
234
|
+
/** Namespaces to replicate into. */
|
|
235
|
+
readonly namespaces: ReadonlyArray<string>;
|
|
236
|
+
/** Database the connection points at. */
|
|
237
|
+
readonly dbName: string;
|
|
238
|
+
/** User the connection authenticates as. */
|
|
239
|
+
readonly username: string;
|
|
240
|
+
/** The user's password, read back from its Secret. */
|
|
241
|
+
readonly password: pulumi.Output<string>;
|
|
242
|
+
/** Instance endpoint. */
|
|
243
|
+
readonly endpoint: pulumi.Output<string>;
|
|
244
|
+
/** Instance port. */
|
|
245
|
+
readonly port: pulumi.Output<number>;
|
|
246
|
+
/** Labels applied to each Secret. */
|
|
247
|
+
readonly labels: Record<string, string>;
|
|
248
|
+
/** Kubernetes provider. */
|
|
249
|
+
readonly provider: k8s.Provider;
|
|
250
|
+
/** Resources each Secret must be created after. */
|
|
251
|
+
readonly dependsOn: ReadonlyArray<pulumi.Resource>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Replicate a user's connection details into each consuming namespace.
|
|
255
|
+
*
|
|
256
|
+
* The `username`, `password` and `database` keys carry raw values; only the
|
|
257
|
+
* composed `uri` percent-encodes them, because there a `@` or `:` in a username
|
|
258
|
+
* would otherwise be read as a URI delimiter. See {@link encodeUriComponentValue}.
|
|
259
|
+
*
|
|
260
|
+
* @param options - Naming, namespaces, connection details, and dependencies
|
|
261
|
+
* @returns Map of namespace → created Secret name
|
|
262
|
+
*/
|
|
263
|
+
export declare function replicateMariadbConnectionSecrets(options: IMariadbConnectionSecretOptions): Record<string, pulumi.Output<string>>;
|
|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AC;IACxC,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC;IAChC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;CACpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,+BAA+B,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CA0BvC"}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MariaDB users inside a MariaDB Operator instance.
|
|
4
|
+
*
|
|
5
|
+
* Every user — the database owner created alongside the database, and every
|
|
6
|
+
* role added later via `addRole()` — is provisioned by the single function
|
|
7
|
+
* {@link provisionMariadbRole}. Unlike CloudNativePG, mariadb-operator models
|
|
8
|
+
* privileges declaratively with a `Grant` CRD, so no SQL Job is involved
|
|
9
|
+
* anywhere: an {@link IDatabaseGrant} maps directly onto a `Grant` custom
|
|
10
|
+
* resource and the operator reconciles it continuously.
|
|
11
|
+
*
|
|
12
|
+
* Only the names differ between the two paths, and those names are the one
|
|
13
|
+
* genuinely dangerous part: Pulumi identifies a resource by its logical name,
|
|
14
|
+
* so renaming one deletes and recreates it, and for a credential Secret that
|
|
15
|
+
* regenerates the password and breaks every application already using it.
|
|
16
|
+
* {@link ownerRoleNaming} therefore pins the owner's names to the exact strings
|
|
17
|
+
* live stacks already carry.
|
|
18
|
+
*
|
|
19
|
+
* @module operator/mariadb-roles
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
24
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
25
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(o, k2, desc);
|
|
28
|
+
}) : (function(o, m, k, k2) {
|
|
29
|
+
if (k2 === undefined) k2 = k;
|
|
30
|
+
o[k2] = m[k];
|
|
31
|
+
}));
|
|
32
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
33
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
34
|
+
}) : function(o, v) {
|
|
35
|
+
o["default"] = v;
|
|
36
|
+
});
|
|
37
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
38
|
+
var ownKeys = function(o) {
|
|
39
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
40
|
+
var ar = [];
|
|
41
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
return ownKeys(o);
|
|
45
|
+
};
|
|
46
|
+
return function (mod) {
|
|
47
|
+
if (mod && mod.__esModule) return mod;
|
|
48
|
+
var result = {};
|
|
49
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50
|
+
__setModuleDefault(result, mod);
|
|
51
|
+
return result;
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.OWNER_GRANT = void 0;
|
|
56
|
+
exports.ownerRoleNaming = ownerRoleNaming;
|
|
57
|
+
exports.additionalRoleNaming = additionalRoleNaming;
|
|
58
|
+
exports.toMariadbGrants = toMariadbGrants;
|
|
59
|
+
exports.provisionMariadbRole = provisionMariadbRole;
|
|
60
|
+
exports.replicateMariadbConnectionSecrets = replicateMariadbConnectionSecrets;
|
|
61
|
+
const k8s = __importStar(require("@pulumi/kubernetes"));
|
|
62
|
+
const pulumi = __importStar(require("@pulumi/pulumi"));
|
|
63
|
+
const mariadb_common_js_1 = require("./mariadb-common.js");
|
|
64
|
+
const credentials_js_1 = require("./credentials.js");
|
|
65
|
+
const connection_uri_js_1 = require("./connection-uri.js");
|
|
66
|
+
const resource_identity_js_1 = require("./resource-identity.js");
|
|
67
|
+
const privileges_js_1 = require("./grants/privileges.js");
|
|
68
|
+
/** Fields of the `User` CR that mariadb-operator rejects updates to. */
|
|
69
|
+
const USER_IMMUTABLE_FIELDS = ["spec.name"];
|
|
70
|
+
/** Fields of the `Grant` CR that mariadb-operator rejects updates to. */
|
|
71
|
+
const GRANT_IMMUTABLE_FIELDS = ["spec.database", "spec.username"];
|
|
72
|
+
/**
|
|
73
|
+
* Names for the database owner's user.
|
|
74
|
+
*
|
|
75
|
+
* These strings predate the shared provisioner and are reproduced verbatim:
|
|
76
|
+
* `-password-secret`, `-user`, `-grant`, and `-secret-{namespace}` are the
|
|
77
|
+
* logical names live stacks already carry, and `metadata.name` is the
|
|
78
|
+
* unsanitized `{cluster}-{database}` those objects were created under. Do not
|
|
79
|
+
* "tidy" them.
|
|
80
|
+
*
|
|
81
|
+
* @param clusterName - MariaDB instance name
|
|
82
|
+
* @param dbName - Database name
|
|
83
|
+
* @returns The owner user's pinned naming
|
|
84
|
+
*/
|
|
85
|
+
function ownerRoleNaming(clusterName, dbName) {
|
|
86
|
+
const base = `${clusterName}-${dbName}`;
|
|
87
|
+
return {
|
|
88
|
+
credentialResource: `${base}-password-secret`,
|
|
89
|
+
credentialSecret: `${base}-user`,
|
|
90
|
+
userResource: `${base}-user`,
|
|
91
|
+
userMetadataName: base,
|
|
92
|
+
connectionResourcePrefix: `${base}-secret`,
|
|
93
|
+
connectionSecret: `${base}-mariadb`,
|
|
94
|
+
grantNaming: () => ({ resource: `${base}-grant`, metadataName: base }),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Names for a user added via `addRole()`.
|
|
99
|
+
*
|
|
100
|
+
* Every name is prefixed `{cluster}-{database}-role-{role}` so it can never
|
|
101
|
+
* collide with the owner's pinned names above — the owner's names have no
|
|
102
|
+
* `-role-` segment following `{cluster}-{database}`.
|
|
103
|
+
*
|
|
104
|
+
* Grants are named for the table they cover (`*` renders as `all`), never for
|
|
105
|
+
* their position, so reordering a role's `grants` array changes nothing.
|
|
106
|
+
*
|
|
107
|
+
* **The identity is the `username`@`host` pair, not the username.** MariaDB
|
|
108
|
+
* treats those two together as one account, which is why the role registry
|
|
109
|
+
* permits `reader`@`%` and `reader`@`10.0.0.1` to coexist — and a name derived
|
|
110
|
+
* from the username alone made the second of them register under the first's
|
|
111
|
+
* logical names, aborting the preview with a duplicate URN so that the account
|
|
112
|
+
* the registry had just allowed could never actually be created. Folding the
|
|
113
|
+
* host in also keeps a host *change* honest: it derives new names rather than
|
|
114
|
+
* attempting an in-place update of `spec.host`, which mariadb-operator treats as
|
|
115
|
+
* immutable.
|
|
116
|
+
*
|
|
117
|
+
* The role segment comes from {@link toCompositeIdentitySegment}, not from plain
|
|
118
|
+
* sanitizing: `Read_Only` and `read_only` are two distinct, simultaneously valid
|
|
119
|
+
* MariaDB usernames that sanitize alike, and two resources deriving one logical
|
|
120
|
+
* name abort the entire preview with a duplicate-URN error. Every segment
|
|
121
|
+
* carries the hash, including names that needed no sanitizing, so no raw name
|
|
122
|
+
* can land on another's encoded form.
|
|
123
|
+
*
|
|
124
|
+
* Every name is then bounded by {@link toBoundedName}: instance, database, role
|
|
125
|
+
* and table names are all caller-controlled and unbounded, and a `metadata.name`
|
|
126
|
+
* over {@link DNS_1123_SUBDOMAIN_MAX_LENGTH} is rejected by the Kubernetes API
|
|
127
|
+
* at apply time — after preview has passed, so the CRs the account needs are
|
|
128
|
+
* never created. Nothing here names a Job, so the stricter 63-character label
|
|
129
|
+
* limit does not apply and ordinary names keep their readable form.
|
|
130
|
+
*
|
|
131
|
+
* @param clusterName - MariaDB instance name
|
|
132
|
+
* @param dbName - Database name
|
|
133
|
+
* @param roleName - Role name as it exists in MariaDB
|
|
134
|
+
* @param host - Effective host pattern, as returned by `resolveMariadbHost`
|
|
135
|
+
* @returns Naming for the additional user's resources, each within the DNS-1123
|
|
136
|
+
* subdomain limit
|
|
137
|
+
*/
|
|
138
|
+
function additionalRoleNaming(clusterName, dbName, roleName, host) {
|
|
139
|
+
const base = `${clusterName}-${dbName}-role-${(0, resource_identity_js_1.toCompositeIdentitySegment)([roleName, host])}`;
|
|
140
|
+
const bounded = (name) => (0, resource_identity_js_1.toBoundedName)(name, resource_identity_js_1.DNS_1123_SUBDOMAIN_MAX_LENGTH);
|
|
141
|
+
return {
|
|
142
|
+
credentialResource: bounded(`${base}-secret`),
|
|
143
|
+
credentialSecret: bounded(base),
|
|
144
|
+
userResource: bounded(`${base}-user`),
|
|
145
|
+
userMetadataName: bounded((0, mariadb_common_js_1.toResourceName)(base)),
|
|
146
|
+
connectionResourcePrefix: bounded(`${base}-connection`),
|
|
147
|
+
connectionSecret: bounded(`${base}-mariadb`),
|
|
148
|
+
grantNaming: (table) => {
|
|
149
|
+
// Table names are narrowed the same collision-resistant way role names
|
|
150
|
+
// are: `sales.eu` and `sales_eu` are two distinct tables that sanitize to
|
|
151
|
+
// `sales-eu`, and {@link toMariadbGrants} merges grants by raw table, so
|
|
152
|
+
// both survive as separate Grant CRs and would then register under one
|
|
153
|
+
// Pulumi logical name. `*` is not a table name but the whole-database
|
|
154
|
+
// sentinel, and renders as the constant `all`; every real table name
|
|
155
|
+
// carries its hash, so none of them can render as that bare constant.
|
|
156
|
+
const suffix = table === mariadb_common_js_1.ALL_TABLES ? mariadb_common_js_1.ALL_OBJECTS : (0, resource_identity_js_1.toIdentitySegment)(table);
|
|
157
|
+
return {
|
|
158
|
+
resource: bounded(`${base}-grant-${suffix}`),
|
|
159
|
+
metadataName: bounded((0, mariadb_common_js_1.toResourceName)(`${base}-grant-${suffix}`)),
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/** The database owner's grant: everything on the database, with `GRANT OPTION`. */
|
|
165
|
+
exports.OWNER_GRANT = {
|
|
166
|
+
privileges: [mariadb_common_js_1.ALL_PRIVILEGES],
|
|
167
|
+
table: mariadb_common_js_1.ALL_TABLES,
|
|
168
|
+
grantOption: true,
|
|
169
|
+
};
|
|
170
|
+
/** Engine name used when reporting a rejected privilege. */
|
|
171
|
+
const ENGINE_NAME = "MariaDB";
|
|
172
|
+
/**
|
|
173
|
+
* Privileges accepted in {@link IDatabaseGrant.privileges} on MariaDB.
|
|
174
|
+
*
|
|
175
|
+
* These are the privileges MariaDB allows in a database- or table-scoped
|
|
176
|
+
* `GRANT <privileges> ON db.table TO user`, which is exactly the statement
|
|
177
|
+
* mariadb-operator builds from a `Grant` CR. Anything outside the set — a
|
|
178
|
+
* typo, or a global privilege such as `PROCESS` or `SUPER` that cannot be
|
|
179
|
+
* scoped to a database — is rejected here rather than forwarded for the
|
|
180
|
+
* operator's SQL builder to choke on at reconcile time, where the failure
|
|
181
|
+
* surfaces only in operator logs.
|
|
182
|
+
*
|
|
183
|
+
* This is deliberately **not** PostgreSQL's list: `TRUNCATE` does not exist
|
|
184
|
+
* here, while `INDEX`, `DROP`, `EVENT`, `EXECUTE`, and the routine/view
|
|
185
|
+
* privileges do. `GRANT OPTION` is excluded because the CR models it as its
|
|
186
|
+
* own `spec.grantOption` field, not as a privilege.
|
|
187
|
+
*/
|
|
188
|
+
const ALLOWED_PRIVILEGES = new Set([
|
|
189
|
+
mariadb_common_js_1.ALL_PRIVILEGES,
|
|
190
|
+
"ALTER",
|
|
191
|
+
"ALTER ROUTINE",
|
|
192
|
+
"CREATE",
|
|
193
|
+
"CREATE ROUTINE",
|
|
194
|
+
"CREATE TEMPORARY TABLES",
|
|
195
|
+
"CREATE VIEW",
|
|
196
|
+
"DELETE",
|
|
197
|
+
"DELETE HISTORY",
|
|
198
|
+
"DROP",
|
|
199
|
+
"EVENT",
|
|
200
|
+
"EXECUTE",
|
|
201
|
+
"INDEX",
|
|
202
|
+
"INSERT",
|
|
203
|
+
"LOCK TABLES",
|
|
204
|
+
"REFERENCES",
|
|
205
|
+
"SELECT",
|
|
206
|
+
"SHOW VIEW",
|
|
207
|
+
"TRIGGER",
|
|
208
|
+
"UPDATE",
|
|
209
|
+
]);
|
|
210
|
+
/**
|
|
211
|
+
* Translate portable grants into mariadb-operator `Grant` specs, one per table.
|
|
212
|
+
*
|
|
213
|
+
* `IDatabaseGrant.schema` has no MariaDB equivalent and is dropped — MariaDB
|
|
214
|
+
* has no schema concept distinct from the database itself. `objects` is either
|
|
215
|
+
* a single table name or `"all"`, which becomes `"*"`.
|
|
216
|
+
*
|
|
217
|
+
* **Grants are merged by table.** A role may legitimately express two grants for
|
|
218
|
+
* one table — separate `SELECT` and `INSERT` entries, say — but
|
|
219
|
+
* {@link IMariadbRoleNaming.grantNaming} keys a `Grant` CR's logical name on the
|
|
220
|
+
* table, so rendering both would register two resources under one name and abort
|
|
221
|
+
* the preview with a duplicate-URN error instead of provisioning anything. Their
|
|
222
|
+
* privileges are unioned into a single CR, which is also what the caller meant.
|
|
223
|
+
*
|
|
224
|
+
* The result is canonical: privileges are deduplicated after normalization and
|
|
225
|
+
* sorted, and tables are sorted, so reordering the input array produces byte-
|
|
226
|
+
* identical output and no Pulumi diff. `ALL PRIVILEGES` absorbs everything it is
|
|
227
|
+
* merged with — MariaDB's `GRANT` grammar rejects it alongside other privileges,
|
|
228
|
+
* so a union that keeps both would only render invalid SQL.
|
|
229
|
+
*
|
|
230
|
+
* @param grants - Portable grants from the role configuration
|
|
231
|
+
* @returns One MariaDB grant spec per distinct table, ordered by table name
|
|
232
|
+
* @throws {AnyCloudError} code `UNSUPPORTED_PRIVILEGE` when a grant names a
|
|
233
|
+
* privilege outside {@link ALLOWED_PRIVILEGES}
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```typescript
|
|
237
|
+
* toMariadbGrants([
|
|
238
|
+
* { privileges: ["SELECT"], objects: "orders" },
|
|
239
|
+
* { privileges: ["INSERT"], objects: "orders" },
|
|
240
|
+
* ]);
|
|
241
|
+
* // → [{ privileges: ["INSERT", "SELECT"], table: "orders", grantOption: false }]
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
function toMariadbGrants(grants) {
|
|
245
|
+
const privilegesByTable = new Map();
|
|
246
|
+
for (const grant of grants) {
|
|
247
|
+
const table = grant.objects && grant.objects !== mariadb_common_js_1.ALL_OBJECTS ? grant.objects : mariadb_common_js_1.ALL_TABLES;
|
|
248
|
+
const privileges = privilegesByTable.get(table) ?? new Set();
|
|
249
|
+
for (const privilege of grant.privileges) {
|
|
250
|
+
privileges.add((0, privileges_js_1.normalizePrivilegeAgainst)(privilege, ALLOWED_PRIVILEGES, ENGINE_NAME));
|
|
251
|
+
}
|
|
252
|
+
privilegesByTable.set(table, privileges);
|
|
253
|
+
}
|
|
254
|
+
return [...privilegesByTable.entries()]
|
|
255
|
+
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
256
|
+
.map(([table, privileges]) => ({
|
|
257
|
+
privileges: privileges.has(mariadb_common_js_1.ALL_PRIVILEGES) ? [mariadb_common_js_1.ALL_PRIVILEGES] : [...privileges].sort(),
|
|
258
|
+
table,
|
|
259
|
+
grantOption: false,
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Provision one MariaDB user: a password Secret, the `User` CR that reconciles
|
|
264
|
+
* the account, and one `Grant` CR per requested privilege set.
|
|
265
|
+
*
|
|
266
|
+
* The Secret holds only `password` — the `User` CR names the account itself, so
|
|
267
|
+
* a `username` key would be redundant, and adding one would change the schema
|
|
268
|
+
* of a Secret live applications already read.
|
|
269
|
+
*
|
|
270
|
+
* @param options - Instance, username, pinned naming, and translated grants
|
|
271
|
+
* @returns The `User` CR, its `Grant` CRs, and the credentials it authenticates with
|
|
272
|
+
*/
|
|
273
|
+
function provisionMariadbRole(options) {
|
|
274
|
+
const { clusterName, dbName, roleName, naming, host, provider } = options;
|
|
275
|
+
const credentials = (0, credentials_js_1.createRoleCredentials)({
|
|
276
|
+
resourceName: naming.credentialResource,
|
|
277
|
+
secretName: naming.credentialSecret,
|
|
278
|
+
namespace: mariadb_common_js_1.DATA_NAMESPACE,
|
|
279
|
+
labels: options.labels,
|
|
280
|
+
provider,
|
|
281
|
+
dependsOn: [options.mariadb],
|
|
282
|
+
});
|
|
283
|
+
const user = new k8s.apiextensions.CustomResource(naming.userResource, {
|
|
284
|
+
apiVersion: mariadb_common_js_1.MARIADB_API_VERSION,
|
|
285
|
+
kind: mariadb_common_js_1.USER_KIND,
|
|
286
|
+
metadata: {
|
|
287
|
+
name: naming.userMetadataName,
|
|
288
|
+
namespace: mariadb_common_js_1.DATA_NAMESPACE,
|
|
289
|
+
labels: options.labels,
|
|
290
|
+
},
|
|
291
|
+
spec: {
|
|
292
|
+
mariaDbRef: { name: clusterName },
|
|
293
|
+
name: roleName,
|
|
294
|
+
passwordSecretKeyRef: {
|
|
295
|
+
name: naming.credentialSecret,
|
|
296
|
+
key: "password",
|
|
297
|
+
},
|
|
298
|
+
...(host === undefined ? {} : { host }),
|
|
299
|
+
maxUserConnections: options.maxUserConnections ?? mariadb_common_js_1.DEFAULT_MAX_USER_CONNECTIONS,
|
|
300
|
+
},
|
|
301
|
+
}, {
|
|
302
|
+
provider,
|
|
303
|
+
dependsOn: [options.mariadb, credentials.userSecret],
|
|
304
|
+
ignoreChanges: USER_IMMUTABLE_FIELDS,
|
|
305
|
+
});
|
|
306
|
+
const grants = options.grants.map((grant) => {
|
|
307
|
+
const grantNames = naming.grantNaming(grant.table);
|
|
308
|
+
return new k8s.apiextensions.CustomResource(grantNames.resource, {
|
|
309
|
+
apiVersion: mariadb_common_js_1.MARIADB_API_VERSION,
|
|
310
|
+
kind: mariadb_common_js_1.GRANT_KIND,
|
|
311
|
+
metadata: {
|
|
312
|
+
name: grantNames.metadataName,
|
|
313
|
+
namespace: mariadb_common_js_1.DATA_NAMESPACE,
|
|
314
|
+
labels: options.labels,
|
|
315
|
+
},
|
|
316
|
+
spec: {
|
|
317
|
+
mariaDbRef: { name: clusterName },
|
|
318
|
+
privileges: [...grant.privileges],
|
|
319
|
+
database: dbName,
|
|
320
|
+
table: grant.table,
|
|
321
|
+
username: roleName,
|
|
322
|
+
...(host === undefined ? {} : { host }),
|
|
323
|
+
grantOption: grant.grantOption,
|
|
324
|
+
},
|
|
325
|
+
}, {
|
|
326
|
+
provider,
|
|
327
|
+
dependsOn: [options.database, user],
|
|
328
|
+
ignoreChanges: GRANT_IMMUTABLE_FIELDS,
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
return { user, grants, credentials };
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Replicate a user's connection details into each consuming namespace.
|
|
335
|
+
*
|
|
336
|
+
* The `username`, `password` and `database` keys carry raw values; only the
|
|
337
|
+
* composed `uri` percent-encodes them, because there a `@` or `:` in a username
|
|
338
|
+
* would otherwise be read as a URI delimiter. See {@link encodeUriComponentValue}.
|
|
339
|
+
*
|
|
340
|
+
* @param options - Naming, namespaces, connection details, and dependencies
|
|
341
|
+
* @returns Map of namespace → created Secret name
|
|
342
|
+
*/
|
|
343
|
+
function replicateMariadbConnectionSecrets(options) {
|
|
344
|
+
const { dbName, username, password, endpoint, port } = options;
|
|
345
|
+
const uriUsername = (0, connection_uri_js_1.encodeUriComponentValue)(username);
|
|
346
|
+
const uriDatabase = (0, connection_uri_js_1.encodeUriComponentValue)(dbName);
|
|
347
|
+
return (0, credentials_js_1.replicateConnectionSecrets)({
|
|
348
|
+
namespaces: options.namespaces,
|
|
349
|
+
resourcePrefix: options.naming.connectionResourcePrefix,
|
|
350
|
+
secretName: options.naming.connectionSecret,
|
|
351
|
+
stringData: {
|
|
352
|
+
host: endpoint,
|
|
353
|
+
port: port.apply((p) => String(p)),
|
|
354
|
+
username,
|
|
355
|
+
password,
|
|
356
|
+
database: dbName,
|
|
357
|
+
uri: pulumi
|
|
358
|
+
.all([endpoint, port, password])
|
|
359
|
+
.apply(([h, p, pw]) => `mysql://${uriUsername}:${(0, connection_uri_js_1.encodeUriComponentValue)(pw)}@${h}:${p}/${uriDatabase}`),
|
|
360
|
+
},
|
|
361
|
+
labels: options.labels,
|
|
362
|
+
provider: options.provider,
|
|
363
|
+
dependsOn: options.dependsOn,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=mariadb-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mariadb-roles.js","sourceRoot":"","sources":["../../../src/operator/mariadb-roles.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGH,0CAWC;AA2CD,oDA8BC;AA+FD,0CAqBC;AA6DD,oDAuEC;AAoCD,8EA4BC;AA1eD,wDAA0C;AAC1C,uDAAyC;AACzC,2DAU6B;AAC7B,qDAI0B;AAC1B,2DAA8D;AAC9D,iEAKgC;AAChC,0DAAmE;AAGnE,wEAAwE;AACxE,MAAM,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;AAC5C,yEAAyE;AACzE,MAAM,sBAAsB,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;AAkDlE;;;;;;;;;;;;GAYG;AACH,SAAgB,eAAe,CAAC,WAAmB,EAAE,MAAc;IACjE,MAAM,IAAI,GAAG,GAAG,WAAW,IAAI,MAAM,EAAE,CAAC;IACxC,OAAO;QACL,kBAAkB,EAAE,GAAG,IAAI,kBAAkB;QAC7C,gBAAgB,EAAE,GAAG,IAAI,OAAO;QAChC,YAAY,EAAE,GAAG,IAAI,OAAO;QAC5B,gBAAgB,EAAE,IAAI;QACtB,wBAAwB,EAAE,GAAG,IAAI,SAAS;QAC1C,gBAAgB,EAAE,GAAG,IAAI,UAAU;QACnC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,QAAQ,EAAE,YAAY,EAAE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,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mariadb.d.ts","sourceRoot":"","sources":["../../../src/operator/mariadb.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"mariadb.d.ts","sourceRoot":"","sources":["../../../src/operator/mariadb.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAG1C,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAGjB,MAAM,cAAc,CAAC;AAkQtB;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,sBAAsB,GAAG,SAAS,EAC1C,cAAc,EAAE,eAAe,GAAG,SAAS,EAC3C,QAAQ,EAAE,GAAG,CAAC,QAAQ,EACtB,eAAe,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EACpC,YAAY,CAAC,EAAE,cAAc,GAC5B,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAyCrD"}
|