@wildo-ai/platform-infra-providers 1.1.10 → 1.1.12

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.
Files changed (56) hide show
  1. package/dist/esm/aws-s3/aws-s3.infra.module.d.ts +11 -10
  2. package/dist/esm/aws-s3/aws-s3.infra.module.d.ts.map +1 -1
  3. package/dist/esm/aws-s3/aws-s3.infra.module.js +14 -12
  4. package/dist/esm/aws-s3/aws-s3.infra.module.js.map +1 -1
  5. package/dist/esm/clamav-self/clamav-self.infra.module.d.ts +1 -2
  6. package/dist/esm/clamav-self/clamav-self.infra.module.d.ts.map +1 -1
  7. package/dist/esm/clamav-self/clamav-self.infra.module.js +1 -2
  8. package/dist/esm/clamav-self/clamav-self.infra.module.js.map +1 -1
  9. package/dist/esm/immudb-self/immudb-self.infra.module.js.map +1 -1
  10. package/dist/esm/index.d.ts +1 -1
  11. package/dist/esm/index.js +2 -2
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/minio-self/minio-self.infra.module.d.ts +1 -4
  14. package/dist/esm/minio-self/minio-self.infra.module.d.ts.map +1 -1
  15. package/dist/esm/minio-self/minio-self.infra.module.js +1 -4
  16. package/dist/esm/minio-self/minio-self.infra.module.js.map +1 -1
  17. package/dist/esm/mongodb-atlas/mongodb-atlas.infra.module.d.ts +1 -2
  18. package/dist/esm/mongodb-atlas/mongodb-atlas.infra.module.d.ts.map +1 -1
  19. package/dist/esm/mongodb-atlas/mongodb-atlas.infra.module.js +1 -2
  20. package/dist/esm/mongodb-atlas/mongodb-atlas.infra.module.js.map +1 -1
  21. package/dist/esm/mongodb-self/mongodb-self.infra.module.d.ts +1 -2
  22. package/dist/esm/mongodb-self/mongodb-self.infra.module.d.ts.map +1 -1
  23. package/dist/esm/mongodb-self/mongodb-self.infra.module.js +1 -2
  24. package/dist/esm/mongodb-self/mongodb-self.infra.module.js.map +1 -1
  25. package/dist/esm/postgres-self/postgres-self.infra.module.d.ts +1 -2
  26. package/dist/esm/postgres-self/postgres-self.infra.module.d.ts.map +1 -1
  27. package/dist/esm/postgres-self/postgres-self.infra.module.js +1 -2
  28. package/dist/esm/postgres-self/postgres-self.infra.module.js.map +1 -1
  29. package/dist/esm/rabbitmq-self/rabbitmq-self.infra.module.d.ts +1 -2
  30. package/dist/esm/rabbitmq-self/rabbitmq-self.infra.module.d.ts.map +1 -1
  31. package/dist/esm/rabbitmq-self/rabbitmq-self.infra.module.js +4 -7
  32. package/dist/esm/rabbitmq-self/rabbitmq-self.infra.module.js.map +1 -1
  33. package/dist/esm/redis-self/redis-self.infra.module.d.ts +1 -2
  34. package/dist/esm/redis-self/redis-self.infra.module.d.ts.map +1 -1
  35. package/dist/esm/redis-self/redis-self.infra.module.js +1 -2
  36. package/dist/esm/redis-self/redis-self.infra.module.js.map +1 -1
  37. package/dist/tsconfig.build.tsbuildinfo +1 -1
  38. package/package.json +6 -6
  39. package/src/__tests__/servable-infra-providers.test.ts +1 -1
  40. package/src/aws-s3/__tests__/aws-s3.infra.module.test.ts +1 -2
  41. package/src/aws-s3/aws-s3.infra.module.ts +14 -12
  42. package/src/clamav-self/__tests__/clamav-self.infra.module.test.ts +1 -2
  43. package/src/clamav-self/clamav-self.infra.module.ts +1 -2
  44. package/src/index.ts +2 -2
  45. package/src/minio-self/__tests__/minio-self.infra.module.test.ts +1 -2
  46. package/src/minio-self/minio-self.infra.module.ts +1 -4
  47. package/src/mongodb-atlas/__tests__/mongodb-atlas.infra.module.test.ts +5 -2
  48. package/src/mongodb-atlas/mongodb-atlas.infra.module.ts +1 -2
  49. package/src/mongodb-self/__tests__/mongodb-self.infra.module.test.ts +15 -7
  50. package/src/mongodb-self/mongodb-self.infra.module.ts +1 -2
  51. package/src/postgres-self/__tests__/postgres-self.infra.module.test.ts +3 -4
  52. package/src/postgres-self/postgres-self.infra.module.ts +1 -2
  53. package/src/rabbitmq-self/__tests__/rabbitmq-self.infra.module.test.ts +2 -3
  54. package/src/rabbitmq-self/rabbitmq-self.infra.module.ts +4 -7
  55. package/src/redis-self/__tests__/redis-self.infra.module.test.ts +1 -2
  56. package/src/redis-self/redis-self.infra.module.ts +1 -2
@@ -1,6 +1,5 @@
1
1
  /**
2
- * `AwsS3InfraProviderModule` — seventh concrete `InfraProviderModule`
3
- * (Slice 5.1 of `infra-provider-planner.md`).
2
+ * `AwsS3InfraProviderModule` — seventh concrete `InfraProviderModule`.
4
3
  *
5
4
  * Implements the `AWS_S3` `InfraProvider`. Shares the one-bucket,
6
5
  * prefix-namespaced object layout of `MinioSelfInfraProviderModule` —
@@ -17,10 +16,13 @@
17
16
  * obtain short-lived, prefix-confined credentials from apps-manager.
18
17
  *
19
18
  * That replacement is implemented for **MinIO only**. apps-manager's
20
- * `ObjectStorageStsBrokerService` speaks MinIO's STS `AssumeRole` with an
21
- * inline session policy; AWS STS requires a role ARN the broker does not
22
- * supply, so an `AWS_S3` deployment would fail at storage initialisation
23
- * with no credential and no path to one.
19
+ * `ObjectStorageStsBrokerService` speaks STS `AssumeRole` with an inline
20
+ * session policy. Since #2172 it names a role when one is configured
21
+ * (`platformStorage.stsRoleArn` → `STORAGE_STS_ROLE_ARN`), and refuses to
22
+ * issue against AWS STS without one. What still stops an `AWS_S3`
23
+ * deployment is #14: apps-manager admits only `STORAGE_PROVIDER=minio`,
24
+ * the STS signing region is fixed at `us-east-1` rather than the regional
25
+ * endpoint's, and the path is unproven against a real AWS account.
24
26
  *
25
27
  * No environment selects this provider today (every example uses
26
28
  * `BackingServiceSource.SELF` → MinIO), which is why this is recorded as
@@ -28,8 +30,7 @@
28
30
  * `provider: 'aws'` still RESOLVE here, but since #1693 such a
29
31
  * declaration is refused at authoring time: `unservableReason` below
30
32
  * takes this provider out of the servable set until the AWS STS path
31
- * exists. Tracked in
32
- * `.claude/plans/object-storage-root-credential-distribution.md`.
33
+ * exists (#14).
33
34
  *
34
35
  * The module still reuses the `STORAGE_*` env contract for the
35
36
  * NON-secret values (endpoint, region, bucket, provider); it is only the
@@ -57,8 +58,8 @@
57
58
  * credential-rotation safety dissolves instead of needing a design. The
58
59
  * AWS equivalent is the same shape: `AssumeRole` against a role ARN the
59
60
  * operator supplies, with a session policy confining the principal to
60
- * `applications/<applicationId>/`. That role ARN is the one input the
61
- * broker does not have today, and is the whole of the gap.
61
+ * `applications/<applicationId>/`. The broker takes that role since #2172;
62
+ * the rest of the gap is #14 (see above).
62
63
  */
63
64
  import { InfraProviderModule } from '@wildo-ai/platform-config-lib';
64
65
  export declare const AwsS3InfraProviderModule: InfraProviderModule;
@@ -1 +1 @@
1
- {"version":3,"file":"aws-s3.infra.module.d.ts","sourceRoot":"","sources":["../../../src/aws-s3/aws-s3.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAIL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAEvC,eAAO,MAAM,wBAAwB,EAAE,mBA2DtC,CAAC"}
1
+ {"version":3,"file":"aws-s3.infra.module.d.ts","sourceRoot":"","sources":["../../../src/aws-s3/aws-s3.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAIL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAEvC,eAAO,MAAM,wBAAwB,EAAE,mBA4DtC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * `AwsS3InfraProviderModule` — seventh concrete `InfraProviderModule`
3
- * (Slice 5.1 of `infra-provider-planner.md`).
2
+ * `AwsS3InfraProviderModule` — seventh concrete `InfraProviderModule`.
4
3
  *
5
4
  * Implements the `AWS_S3` `InfraProvider`. Shares the one-bucket,
6
5
  * prefix-namespaced object layout of `MinioSelfInfraProviderModule` —
@@ -17,10 +16,13 @@
17
16
  * obtain short-lived, prefix-confined credentials from apps-manager.
18
17
  *
19
18
  * That replacement is implemented for **MinIO only**. apps-manager's
20
- * `ObjectStorageStsBrokerService` speaks MinIO's STS `AssumeRole` with an
21
- * inline session policy; AWS STS requires a role ARN the broker does not
22
- * supply, so an `AWS_S3` deployment would fail at storage initialisation
23
- * with no credential and no path to one.
19
+ * `ObjectStorageStsBrokerService` speaks STS `AssumeRole` with an inline
20
+ * session policy. Since #2172 it names a role when one is configured
21
+ * (`platformStorage.stsRoleArn` → `STORAGE_STS_ROLE_ARN`), and refuses to
22
+ * issue against AWS STS without one. What still stops an `AWS_S3`
23
+ * deployment is #14: apps-manager admits only `STORAGE_PROVIDER=minio`,
24
+ * the STS signing region is fixed at `us-east-1` rather than the regional
25
+ * endpoint's, and the path is unproven against a real AWS account.
24
26
  *
25
27
  * No environment selects this provider today (every example uses
26
28
  * `BackingServiceSource.SELF` → MinIO), which is why this is recorded as
@@ -28,8 +30,7 @@
28
30
  * `provider: 'aws'` still RESOLVE here, but since #1693 such a
29
31
  * declaration is refused at authoring time: `unservableReason` below
30
32
  * takes this provider out of the servable set until the AWS STS path
31
- * exists. Tracked in
32
- * `.claude/plans/object-storage-root-credential-distribution.md`.
33
+ * exists (#14).
33
34
  *
34
35
  * The module still reuses the `STORAGE_*` env contract for the
35
36
  * NON-secret values (endpoint, region, bucket, provider); it is only the
@@ -57,8 +58,8 @@
57
58
  * credential-rotation safety dissolves instead of needing a design. The
58
59
  * AWS equivalent is the same shape: `AssumeRole` against a role ARN the
59
60
  * operator supplies, with a session policy confining the principal to
60
- * `applications/<applicationId>/`. That role ARN is the one input the
61
- * broker does not have today, and is the whole of the gap.
61
+ * `applications/<applicationId>/`. The broker takes that role since #2172;
62
+ * the rest of the gap is #14 (see above).
62
63
  */
63
64
  import { InfraCapability, InfraPlatformAdminConsumer, InfraProvider, } from '@wildo-ai/platform-config-lib';
64
65
  export const AwsS3InfraProviderModule = {
@@ -69,8 +70,9 @@ export const AwsS3InfraProviderModule = {
69
70
  * MANAGED }`, or `provider: 'aws'`) is refused by `wildo config validate` / `config sync` /
70
71
  * `lock check` until this field is deleted — in the change that teaches the broker AWS STS (#14).
71
72
  */
72
- unservableReason: 'The object-storage credential broker speaks only MinIO AssumeRole, so an application on AWS S3 '
73
- + 'would receive no storage credential (#14).',
73
+ unservableReason: 'The object-storage credential broker is wired and proven only against a MinIO-compatible store: apps-manager '
74
+ + 'admits only STORAGE_PROVIDER=minio and signs STS for us-east-1, so an application on AWS S3 would receive no '
75
+ + 'storage credential (#14).',
74
76
  /**
75
77
  * Shared bucket, shared access key — no per-app credential is minted, so there is nothing
76
78
  * per-principal to confine. Confinement for object storage is done by STS session policy at
@@ -1 +1 @@
1
- {"version":3,"file":"aws-s3.infra.module.js","sourceRoot":"","sources":["../../../../src/aws-s3/aws-s3.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IAC3D,QAAQ,EAAE,aAAa,CAAC,MAAM;IAC9B,qBAAqB,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC;IAEvD;;;;OAIG;IACH,gBAAgB,EACd,iGAAiG;UAC/F,4CAA4C;IAEhD;;;;OAIG;IACH,2BAA2B,EAAE,EAAE;IAE/B,IAAI;QACF,OAAO;YACL,4CAA4C;YAC5C,iCAAiC;YACjC,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,gBAAgB,EAAE,IAAI;oBACtB,6DAA6D;oBAC7D,yDAAyD;oBACzD,8CAA8C;oBAC9C,eAAe,EAAE,MAAM;iBACxB;gBACD,aAAa,EAAE;oBACb,oBAAoB;oBACpB,oBAAoB;oBACpB,uDAAuD;oBACvD,yDAAyD;oBACzD,yDAAyD;oBACzD,2DAA2D;oBAC3D,qDAAqD;oBACrD,iCAAiC;oBACjC,gBAAgB;iBACjB;gBACD,SAAS,EAAE;oBACT,0BAA0B,CAAC,YAAY;oBACvC,0BAA0B,CAAC,SAAS;iBACrC;aACF;YACD,gEAAgE;YAChE,oEAAoE;YACpE,mEAAmE;YACnE,oEAAoE;SACrE,CAAC;IACJ,CAAC;IAED,2EAA2E;IAC3E,oEAAoE;IACpE,8EAA8E;IAC9E,0DAA0D;CAC3D,CAAC","sourcesContent":["/**\n * `AwsS3InfraProviderModule` — seventh concrete `InfraProviderModule`\n * (Slice 5.1 of `infra-provider-planner.md`).\n *\n * Implements the `AWS_S3` `InfraProvider`. Shares the one-bucket,\n * prefix-namespaced object layout of `MinioSelfInfraProviderModule` —\n * the only differences are (a) no compose / K8s contribution (S3 is\n * managed), and (b) the bucket endpoint is the regional AWS hostname\n * instead of the in-cluster `minio` service.\n *\n * ## ⚠️ NOT USABLE TODAY — selecting this provider leaves apps with no\n * storage credential (2026-08-10)\n *\n * The application-tier `STORAGE_ACCESS_KEY` / `STORAGE_SECRET_KEY` env\n * vars were removed **for every provider**: they were the object store's\n * ROOT pair, handed to every app, minion and worker. Applications now\n * obtain short-lived, prefix-confined credentials from apps-manager.\n *\n * That replacement is implemented for **MinIO only**. apps-manager's\n * `ObjectStorageStsBrokerService` speaks MinIO's STS `AssumeRole` with an\n * inline session policy; AWS STS requires a role ARN the broker does not\n * supply, so an `AWS_S3` deployment would fail at storage initialisation\n * with no credential and no path to one.\n *\n * No environment selects this provider today (every example uses\n * `BackingServiceSource.SELF` → MinIO), which is why this is recorded as\n * a gap rather than an outage. `s3: { source: MANAGED }` and\n * `provider: 'aws'` still RESOLVE here, but since #1693 such a\n * declaration is refused at authoring time: `unservableReason` below\n * takes this provider out of the servable set until the AWS STS path\n * exists. Tracked in\n * `.claude/plans/object-storage-root-credential-distribution.md`.\n *\n * The module still reuses the `STORAGE_*` env contract for the\n * NON-secret values (endpoint, region, bucket, provider); it is only the\n * credential half that is gone.\n *\n * **Why this module exists despite \"no compose / no mint\"**: it\n * gives the lockfile a stable digest entry (so a switch from\n * `minio-self` to `aws-s3` shows up as a `wildo lock check` drift)\n * AND it formalizes which env vars the operator must set for AWS\n * (`STORAGE_REGION` is mandatory; `STORAGE_ENDPOINT` is optional —\n * defaults to the AWS regional endpoint when unset).\n *\n * **No mint methods here** — and the reason is no longer the one this\n * block used to give. It said per-app credentials were out of scope\n * \"because the engine adapter uses a single shared SDK client\", which\n * stopped being true when the adapter moved to a credential provider that\n * rebuilds its client whenever the credential changes. Per-application\n * isolation exists; what is missing for AWS is only the broker's ability\n * to speak AWS STS.\n *\n * Nor should the missing piece be per-app IAM users or roles, which is\n * what this block previously anticipated. The MinIO path deliberately\n * rejected long-lived per-principal accounts in favour of `AssumeRole`\n * with an inline session policy — nothing long-lived exists to leak, and\n * credential-rotation safety dissolves instead of needing a design. The\n * AWS equivalent is the same shape: `AssumeRole` against a role ARN the\n * operator supplies, with a session policy confining the principal to\n * `applications/<applicationId>/`. That role ARN is the one input the\n * broker does not have today, and is the whole of the gap.\n */\n\nimport {\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\nexport const AwsS3InfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.AWS_S3,\n supportedCapabilities: [InfraCapability.OBJECT_STORAGE],\n\n /**\n * What the ⚠️ block above says, made mechanical: a declaration resolving here (`s3: { source:\n * MANAGED }`, or `provider: 'aws'`) is refused by `wildo config validate` / `config sync` /\n * `lock check` until this field is deleted — in the change that teaches the broker AWS STS (#14).\n */\n unservableReason:\n 'The object-storage credential broker speaks only MinIO AssumeRole, so an application on AWS S3 '\n + 'would receive no storage credential (#14).',\n\n /**\n * Shared bucket, shared access key — no per-app credential is minted, so there is nothing\n * per-principal to confine. Confinement for object storage is done by STS session policy at\n * request time, not by a secret in the application blob.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n // No compose service — S3 is fully managed.\n // No K8s manifest — same reason.\n platformAdmin: {\n envVars: {\n STORAGE_PROVIDER: 's3',\n // Endpoint and port have AWS defaults; operator may override\n // for region-specific or VPC-endpoint topologies via the\n // env's authored `backingServices.s3` config.\n STORAGE_USE_SSL: 'true',\n },\n secretEnvVars: [\n 'STORAGE_ACCESS_KEY',\n 'STORAGE_SECRET_KEY',\n // Region is sensitive-ish (deployment topology) and is\n // delivered via the secret env channel for symmetry with\n // the access keys, even though it's not strictly secret.\n // The legacy treatment was env-var, not secret-env-var; if\n // operators object, this can flip to `envVars` later\n // without breaking the contract.\n 'STORAGE_REGION',\n ],\n consumers: [\n InfraPlatformAdminConsumer.APPS_MANAGER,\n InfraPlatformAdminConsumer.COMPANION,\n ],\n },\n // Same shared bucket as MinIO_Self. Apps receive the NON-secret\n // `STORAGE_*` values via the bootstrap env contract; the credential\n // half is no longer emitted for any provider — see the ⚠️ block in\n // this module's JSDoc for why that makes AWS_S3 currently unusable.\n };\n },\n\n // No `mintAppCredentials` / `revokeAppCredentials` — not because the model\n // is shared-bucket (it is, but that is not the reason), but because\n // per-application isolation is delivered by BROKERED STS SESSIONS rather than\n // by minted long-lived accounts. See this module's JSDoc.\n};\n"]}
1
+ {"version":3,"file":"aws-s3.infra.module.js","sourceRoot":"","sources":["../../../src/aws-s3/aws-s3.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IAC3D,QAAQ,EAAE,aAAa,CAAC,MAAM;IAC9B,qBAAqB,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC;IAEvD;;;;OAIG;IACH,gBAAgB,EACd,+GAA+G;UAC7G,+GAA+G;UAC/G,2BAA2B;IAE/B;;;;OAIG;IACH,2BAA2B,EAAE,EAAE;IAE/B,IAAI;QACF,OAAO;YACL,4CAA4C;YAC5C,iCAAiC;YACjC,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,gBAAgB,EAAE,IAAI;oBACtB,6DAA6D;oBAC7D,yDAAyD;oBACzD,8CAA8C;oBAC9C,eAAe,EAAE,MAAM;iBACxB;gBACD,aAAa,EAAE;oBACb,oBAAoB;oBACpB,oBAAoB;oBACpB,uDAAuD;oBACvD,yDAAyD;oBACzD,yDAAyD;oBACzD,2DAA2D;oBAC3D,qDAAqD;oBACrD,iCAAiC;oBACjC,gBAAgB;iBACjB;gBACD,SAAS,EAAE;oBACT,0BAA0B,CAAC,YAAY;oBACvC,0BAA0B,CAAC,SAAS;iBACrC;aACF;YACD,gEAAgE;YAChE,oEAAoE;YACpE,mEAAmE;YACnE,oEAAoE;SACrE,CAAC;IACJ,CAAC;IAED,2EAA2E;IAC3E,oEAAoE;IACpE,8EAA8E;IAC9E,0DAA0D;CAC3D,CAAC","sourcesContent":["/**\n * `AwsS3InfraProviderModule` — seventh concrete `InfraProviderModule`.\n *\n * Implements the `AWS_S3` `InfraProvider`. Shares the one-bucket,\n * prefix-namespaced object layout of `MinioSelfInfraProviderModule` —\n * the only differences are (a) no compose / K8s contribution (S3 is\n * managed), and (b) the bucket endpoint is the regional AWS hostname\n * instead of the in-cluster `minio` service.\n *\n * ## ⚠️ NOT USABLE TODAY — selecting this provider leaves apps with no\n * storage credential (2026-08-10)\n *\n * The application-tier `STORAGE_ACCESS_KEY` / `STORAGE_SECRET_KEY` env\n * vars were removed **for every provider**: they were the object store's\n * ROOT pair, handed to every app, minion and worker. Applications now\n * obtain short-lived, prefix-confined credentials from apps-manager.\n *\n * That replacement is implemented for **MinIO only**. apps-manager's\n * `ObjectStorageStsBrokerService` speaks STS `AssumeRole` with an inline\n * session policy. Since #2172 it names a role when one is configured\n * (`platformStorage.stsRoleArn` → `STORAGE_STS_ROLE_ARN`), and refuses to\n * issue against AWS STS without one. What still stops an `AWS_S3`\n * deployment is #14: apps-manager admits only `STORAGE_PROVIDER=minio`,\n * the STS signing region is fixed at `us-east-1` rather than the regional\n * endpoint's, and the path is unproven against a real AWS account.\n *\n * No environment selects this provider today (every example uses\n * `BackingServiceSource.SELF` → MinIO), which is why this is recorded as\n * a gap rather than an outage. `s3: { source: MANAGED }` and\n * `provider: 'aws'` still RESOLVE here, but since #1693 such a\n * declaration is refused at authoring time: `unservableReason` below\n * takes this provider out of the servable set until the AWS STS path\n * exists (#14).\n *\n * The module still reuses the `STORAGE_*` env contract for the\n * NON-secret values (endpoint, region, bucket, provider); it is only the\n * credential half that is gone.\n *\n * **Why this module exists despite \"no compose / no mint\"**: it\n * gives the lockfile a stable digest entry (so a switch from\n * `minio-self` to `aws-s3` shows up as a `wildo lock check` drift)\n * AND it formalizes which env vars the operator must set for AWS\n * (`STORAGE_REGION` is mandatory; `STORAGE_ENDPOINT` is optional —\n * defaults to the AWS regional endpoint when unset).\n *\n * **No mint methods here** — and the reason is no longer the one this\n * block used to give. It said per-app credentials were out of scope\n * \"because the engine adapter uses a single shared SDK client\", which\n * stopped being true when the adapter moved to a credential provider that\n * rebuilds its client whenever the credential changes. Per-application\n * isolation exists; what is missing for AWS is only the broker's ability\n * to speak AWS STS.\n *\n * Nor should the missing piece be per-app IAM users or roles, which is\n * what this block previously anticipated. The MinIO path deliberately\n * rejected long-lived per-principal accounts in favour of `AssumeRole`\n * with an inline session policy — nothing long-lived exists to leak, and\n * credential-rotation safety dissolves instead of needing a design. The\n * AWS equivalent is the same shape: `AssumeRole` against a role ARN the\n * operator supplies, with a session policy confining the principal to\n * `applications/<applicationId>/`. The broker takes that role since #2172;\n * the rest of the gap is #14 (see above).\n */\n\nimport {\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\nexport const AwsS3InfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.AWS_S3,\n supportedCapabilities: [InfraCapability.OBJECT_STORAGE],\n\n /**\n * What the ⚠️ block above says, made mechanical: a declaration resolving here (`s3: { source:\n * MANAGED }`, or `provider: 'aws'`) is refused by `wildo config validate` / `config sync` /\n * `lock check` until this field is deleted — in the change that teaches the broker AWS STS (#14).\n */\n unservableReason:\n 'The object-storage credential broker is wired and proven only against a MinIO-compatible store: apps-manager '\n + 'admits only STORAGE_PROVIDER=minio and signs STS for us-east-1, so an application on AWS S3 would receive no '\n + 'storage credential (#14).',\n\n /**\n * Shared bucket, shared access key — no per-app credential is minted, so there is nothing\n * per-principal to confine. Confinement for object storage is done by STS session policy at\n * request time, not by a secret in the application blob.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n // No compose service — S3 is fully managed.\n // No K8s manifest — same reason.\n platformAdmin: {\n envVars: {\n STORAGE_PROVIDER: 's3',\n // Endpoint and port have AWS defaults; operator may override\n // for region-specific or VPC-endpoint topologies via the\n // env's authored `backingServices.s3` config.\n STORAGE_USE_SSL: 'true',\n },\n secretEnvVars: [\n 'STORAGE_ACCESS_KEY',\n 'STORAGE_SECRET_KEY',\n // Region is sensitive-ish (deployment topology) and is\n // delivered via the secret env channel for symmetry with\n // the access keys, even though it's not strictly secret.\n // The legacy treatment was env-var, not secret-env-var; if\n // operators object, this can flip to `envVars` later\n // without breaking the contract.\n 'STORAGE_REGION',\n ],\n consumers: [\n InfraPlatformAdminConsumer.APPS_MANAGER,\n InfraPlatformAdminConsumer.COMPANION,\n ],\n },\n // Same shared bucket as MinIO_Self. Apps receive the NON-secret\n // `STORAGE_*` values via the bootstrap env contract; the credential\n // half is no longer emitted for any provider — see the ⚠️ block in\n // this module's JSDoc for why that makes AWS_S3 currently unusable.\n };\n },\n\n // No `mintAppCredentials` / `revokeAppCredentials` — not because the model\n // is shared-bucket (it is, but that is not the reason), but because\n // per-application isolation is delivered by BROKERED STS SESSIONS rather than\n // by minted long-lived accounts. See this module's JSDoc.\n};\n"]}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * `ClamavSelfInfraProviderModule` — eighth concrete `InfraProviderModule`
3
- * (Slice 5.2 of `infra-provider-planner.md`).
2
+ * `ClamavSelfInfraProviderModule` — eighth concrete `InfraProviderModule`.
4
3
  *
5
4
  * Implements the `CLAMAV_SELF` `InfraProvider`. **Stateless**: ClamAV
6
5
  * is a network virus-scanning service with no auth and no per-tenant
@@ -1 +1 @@
1
- {"version":3,"file":"clamav-self.infra.module.d.ts","sourceRoot":"","sources":["../../../src/clamav-self/clamav-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAIL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,6BAA6B,EAAE,mBAiC3C,CAAC"}
1
+ {"version":3,"file":"clamav-self.infra.module.d.ts","sourceRoot":"","sources":["../../../src/clamav-self/clamav-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAIL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,6BAA6B,EAAE,mBAiC3C,CAAC"}
@@ -1,6 +1,5 @@
1
1
  /**
2
- * `ClamavSelfInfraProviderModule` — eighth concrete `InfraProviderModule`
3
- * (Slice 5.2 of `infra-provider-planner.md`).
2
+ * `ClamavSelfInfraProviderModule` — eighth concrete `InfraProviderModule`.
4
3
  *
5
4
  * Implements the `CLAMAV_SELF` `InfraProvider`. **Stateless**: ClamAV
6
5
  * is a network virus-scanning service with no auth and no per-tenant
@@ -1 +1 @@
1
- {"version":3,"file":"clamav-self.infra.module.js","sourceRoot":"","sources":["../../../../src/clamav-self/clamav-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IAChE,QAAQ,EAAE,aAAa,CAAC,WAAW;IACnC,qBAAqB,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC;IAE3D;;OAEG;IACH,2BAA2B,EAAE,EAAE;IAE/B,IAAI;QACF,OAAO;YACL,qBAAqB,EAAE,CAAC,QAAQ,CAAC;YACjC,YAAY,EAAE,CAAC,yDAAyD,CAAC;YACzE,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,WAAW,EAAE,QAAQ;oBACrB,WAAW,EAAE,MAAM,CAAC,mBAAmB,CAAC;iBACzC;gBACD,2CAA2C;gBAC3C,2DAA2D;gBAC3D,wDAAwD;gBACxD,qDAAqD;gBACrD,SAAS,EAAE;oBACT,0BAA0B,CAAC,YAAY;oBACvC,0BAA0B,CAAC,SAAS;iBACrC;aACF;YACD,yDAAyD;YACzD,wDAAwD;SACzD,CAAC;IACJ,CAAC;IAED,yCAAyC;CAC1C,CAAC","sourcesContent":["/**\n * `ClamavSelfInfraProviderModule` — eighth concrete `InfraProviderModule`\n * (Slice 5.2 of `infra-provider-planner.md`).\n *\n * Implements the `CLAMAV_SELF` `InfraProvider`. **Stateless**: ClamAV\n * is a network virus-scanning service with no auth and no per-tenant\n * state. Apps connect to the shared host:port and submit files for\n * scanning over the ClamAV protocol; nothing is persisted, nothing\n * is per-app. The module's only job is to declare the resource +\n * env vars in `plan()`; there are no `mintAppCredentials`,\n * `revokeAppCredentials`, or `mintPlatformServiceCredentials`\n * methods because there are no credentials.\n *\n * **Apps consume**: `CLAMAV_HOST`, `CLAMAV_PORT` env vars (delivered\n * via the bootstrap env contract). The engine's antivirus-scanning\n * adapter (`saas-backend-lib/.../antivirus/...`) opens a TCP\n * connection per scan request.\n *\n * **Why declare it as a module at all (vs. inline compose service)?**\n * The module gives the lockfile a stable `planContributionDigest`\n * for `ANTIVIRUS_SCANNING` so `wildo lock check` catches drift in\n * the ClamAV resource shape (port change, env-var rename, K8s\n * manifest move). Without a module, the digest would be the\n * authored-entry digest (which is empty — ClamAV has no configurable\n * `BackingService` shape today, just the `BackingServiceKind`\n * enum value).\n */\n\nimport {\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\nconst DEFAULT_CLAMAV_PORT = 3310;\n\nexport const ClamavSelfInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.CLAMAV_SELF,\n supportedCapabilities: [InfraCapability.ANTIVIRUS_SCANNING],\n\n /**\n * Stateless infra with no authentication and no per-app state — `plan()` only.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n dockerComposeServices: ['clamav'],\n k8sResources: ['templates/infra/k8s/internal/clamav/deployment.yaml.hbs'],\n platformAdmin: {\n envVars: {\n CLAMAV_HOST: 'clamav',\n CLAMAV_PORT: String(DEFAULT_CLAMAV_PORT),\n },\n // No secret env vars — ClamAV has no auth.\n // Audience-1 declared so the planner emits the env vars to\n // both apps-manager and companion (companion runs scans\n // locally during dev for parity with prod behavior).\n consumers: [\n InfraPlatformAdminConsumer.APPS_MANAGER,\n InfraPlatformAdminConsumer.COMPANION,\n ],\n },\n // No `appRuntime` blob paths — apps connect via the same\n // `CLAMAV_HOST:CLAMAV_PORT` regardless of app identity.\n };\n },\n\n // No mint methods — ClamAV is stateless.\n};\n"]}
1
+ {"version":3,"file":"clamav-self.infra.module.js","sourceRoot":"","sources":["../../../src/clamav-self/clamav-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IAChE,QAAQ,EAAE,aAAa,CAAC,WAAW;IACnC,qBAAqB,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC;IAE3D;;OAEG;IACH,2BAA2B,EAAE,EAAE;IAE/B,IAAI;QACF,OAAO;YACL,qBAAqB,EAAE,CAAC,QAAQ,CAAC;YACjC,YAAY,EAAE,CAAC,yDAAyD,CAAC;YACzE,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,WAAW,EAAE,QAAQ;oBACrB,WAAW,EAAE,MAAM,CAAC,mBAAmB,CAAC;iBACzC;gBACD,2CAA2C;gBAC3C,2DAA2D;gBAC3D,wDAAwD;gBACxD,qDAAqD;gBACrD,SAAS,EAAE;oBACT,0BAA0B,CAAC,YAAY;oBACvC,0BAA0B,CAAC,SAAS;iBACrC;aACF;YACD,yDAAyD;YACzD,wDAAwD;SACzD,CAAC;IACJ,CAAC;IAED,yCAAyC;CAC1C,CAAC","sourcesContent":["/**\n * `ClamavSelfInfraProviderModule` — eighth concrete `InfraProviderModule`.\n *\n * Implements the `CLAMAV_SELF` `InfraProvider`. **Stateless**: ClamAV\n * is a network virus-scanning service with no auth and no per-tenant\n * state. Apps connect to the shared host:port and submit files for\n * scanning over the ClamAV protocol; nothing is persisted, nothing\n * is per-app. The module's only job is to declare the resource +\n * env vars in `plan()`; there are no `mintAppCredentials`,\n * `revokeAppCredentials`, or `mintPlatformServiceCredentials`\n * methods because there are no credentials.\n *\n * **Apps consume**: `CLAMAV_HOST`, `CLAMAV_PORT` env vars (delivered\n * via the bootstrap env contract). The engine's antivirus-scanning\n * adapter (`saas-backend-lib/.../antivirus/...`) opens a TCP\n * connection per scan request.\n *\n * **Why declare it as a module at all (vs. inline compose service)?**\n * The module gives the lockfile a stable `planContributionDigest`\n * for `ANTIVIRUS_SCANNING` so `wildo lock check` catches drift in\n * the ClamAV resource shape (port change, env-var rename, K8s\n * manifest move). Without a module, the digest would be the\n * authored-entry digest (which is empty — ClamAV has no configurable\n * `BackingService` shape today, just the `BackingServiceKind`\n * enum value).\n */\n\nimport {\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\nconst DEFAULT_CLAMAV_PORT = 3310;\n\nexport const ClamavSelfInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.CLAMAV_SELF,\n supportedCapabilities: [InfraCapability.ANTIVIRUS_SCANNING],\n\n /**\n * Stateless infra with no authentication and no per-app state — `plan()` only.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n dockerComposeServices: ['clamav'],\n k8sResources: ['templates/infra/k8s/internal/clamav/deployment.yaml.hbs'],\n platformAdmin: {\n envVars: {\n CLAMAV_HOST: 'clamav',\n CLAMAV_PORT: String(DEFAULT_CLAMAV_PORT),\n },\n // No secret env vars — ClamAV has no auth.\n // Audience-1 declared so the planner emits the env vars to\n // both apps-manager and companion (companion runs scans\n // locally during dev for parity with prod behavior).\n consumers: [\n InfraPlatformAdminConsumer.APPS_MANAGER,\n InfraPlatformAdminConsumer.COMPANION,\n ],\n },\n // No `appRuntime` blob paths — apps connect via the same\n // `CLAMAV_HOST:CLAMAV_PORT` regardless of app identity.\n };\n },\n\n // No mint methods — ClamAV is stateless.\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"immudb-self.infra.module.js","sourceRoot":"","sources":["../../../../src/immudb-self/immudb-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,+BAA+B,EAI/B,wBAAwB,EACxB,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,iEAAiE;AACjE,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,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AAoB,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAiC,CAAC;QAC9D,MAAM,WAAW,CAAC,sBAAsB,CAAC,EAAE,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,sFAAsF;CACvF,CAAC","sourcesContent":["/**\n * `ImmudbSelfInfraProviderModule` — the self-hosted tamper-evident audit store (#1696).\n *\n * ## What it replaces\n *\n * Until #1696 the platform ran ONE immudb and every application's audit sink logged into it as the server's\n * built-in `immudb` SYSADMIN, into the same `defaultdb`: any application's backend held a superuser credential over\n * every application's tamper-evident audit data, and the server's admin password was copied from the OWNING\n * application's provider secret, so every hosted application had to be handed the owner's sysadmin password to write\n * at all. `IMMUDB_SELF` was servable only as an operator-credentialed exemption because nothing could mint anything\n * narrower.\n *\n * ## What it mints\n *\n * Per application: ONE immudb database and ONE user holding `READ_WRITE` on that database only — the permission an\n * audit sink needs to append and verify, and nothing that administers users, databases or the server. The values\n * reach the application in its platform secrets at `database.immudb.{username,password,database}`, the same paths the\n * engine's immudb provider reads first (`platformMintedSecretPath`), so the operator-authored `IMMUDB_USER` /\n * `IMMUDB_PASSWORD` / `IMMUDB_DATABASE` no longer decide anything on a self-hosted platform.\n *\n * The admin credential apps-manager mints with is a framework-managed PLATFORM secret (`immudb.adminPassword`),\n * delivered to apps-manager only (`IMMUDB_ADMIN_*`), and never to an application.\n *\n * ## Naming, and why it is this narrow\n *\n * immudb accepts only letters and digits in a database name (\"punctuation marks and symbols are not allowed in\n * database name\", immudb issue #1770) and `^[a-zA-Z0-9_]+$` up to 63 characters for a username. The application\n * namespace (`<slug>-<environment>`) carries hyphens, so the database name is its lowercased letters and digits plus\n * a short digest of the namespace itself: stripping punctuation alone would give `wonder-todos` and `wondertodos` the\n * SAME database, which is exactly the sharing this module exists to remove.\n * spec-cite: immudb v1.11.1 `pkg/auth/user.go` — `usernameRegex = ^[a-zA-Z0-9_]+$`, `maxUsernameLen = 63`\n * (https://raw.githubusercontent.com/codenotary/immudb/v1.11.1/pkg/auth/user.go, fetched 2026-09-29); the database\n * name rule is the server's error text quoted in https://github.com/codenotary/immudb/issues/1770.\n *\n * ## Runtime principals\n *\n * The APPLICATION BACKEND only. A minion's audit events go through the same application's audit trail, so it\n * receives the application's credential through the ordinary delivery (`perPrincipalSecretBlobPaths` is empty, so\n * nothing is stripped for it). A named principal passed here is refused rather than given a second database.\n *\n * ## Revocation\n *\n * `revokeAppCredentials` DEACTIVATES the user and revokes its permission — immudb has no user deletion, and the\n * database and its events are kept, because an append-only audit history must outlive the credential that wrote it\n * (#1307, #1562). `mintAppCredentials` re-activates and re-grants, which is what a restore runs.\n */\n\nimport { createHash } from 'node:crypto';\n\nimport {\n ApplicationRuntimePrincipalKind,\n AppCredentialMintingContext,\n AppCredentialMintingResult,\n IImmudbAdminClient,\n ImmudbDatabasePermission,\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\n/** immudb's gRPC port (matches `INFRA_DEFAULT_PORTS.IMMUDB`). */\nconst DEFAULT_IMMUDB_PORT = 3322;\n\n/**\n * The `Wildo_Application_Secrets` paths this module writes — the SAME strings the engine's immudb provider names as\n * `platformMintedSecretPath` (`IMMUDB_MINTED_SECRET_PATHS` in external-connectors-private). Each side is pinned to the\n * engine's `AppConfigurationSecrets.database.immudb` schema, which is where the two ends meet: these constants by\n * apps-manager's `immudb-minted-secret-paths` test, the engine's by saas-backend-lib's\n * `app-config-secrets.boundaries` test. The lifecycle imports these, never literals.\n */\nexport const IMMUDB_USERNAME_PATH = 'database.immudb.username';\nexport const IMMUDB_PASSWORD_PATH = 'database.immudb.password';\nexport const IMMUDB_DATABASE_PATH = 'database.immudb.database';\n\n/**\n * `applicationConfigInputs` key for the database name RECORDED at the first mint (apps-manager passes the stored\n * `database.immudb.database` back, so a revoke, a restore and a re-registration address the database the first mint\n * created even if the derivation ever changes). Not an authored value: `backingServices.immudb.database` is not read\n * for a self-hosted store.\n */\nconst DATABASE_NAME_INPUT_KEY = 'databaseName';\n\n/**\n * The longest database name whose `<name>_audit` user still fits immudb's 63-character username limit, and the\n * database name's own character rule (letters and digits). A recorded name outside either is refused rather than sent.\n */\nconst MAX_DATABASE_NAME_LENGTH = 63 - '_audit'.length;\nconst DATABASE_NAME_PATTERN = /^[a-zA-Z0-9]+$/;\n\n/**\n * immudb's password rule, checked here so a non-compliant value fails naming the application rather than as a bare\n * gRPC error from the server.\n * spec-cite: immudb v1.11.1 `pkg/auth/passwords.go` — \"password must have between 8 and 32 letters, digits and\n * special characters of which at least 1 uppercase letter, 1 digit and 1 special character\"\n * (https://raw.githubusercontent.com/codenotary/immudb/v1.11.1/pkg/auth/passwords.go, fetched 2026-09-29).\n */\nexport function isImmudbCompliantPassword(password: string): boolean {\n return password.length >= 8\n && password.length <= 32\n && /[A-Z]/.test(password)\n && /[0-9]/.test(password)\n && /[^A-Za-z0-9]/.test(password);\n}\n\n/**\n * The per-application database name: the namespace's lowercased letters and digits (capped) plus the first 8 hex of\n * its SHA-256, so two namespaces differing only in punctuation still get two databases. Deterministic, so a revoke,\n * a restore and a re-registration all address the database the first mint created.\n */\nexport function buildImmudbDatabaseName(applicationNamespace: string): string {\n const letters = applicationNamespace.toLowerCase().replace(/[^a-z0-9]/g, '').slice(0, 40);\n const digest = createHash('sha256').update(applicationNamespace).digest('hex').slice(0, 8);\n return `${letters}${digest}`;\n}\n\n/** The per-application audit user: the database name plus a role suffix, inside immudb's username rule. */\nexport function buildImmudbUsername(databaseName: string): string {\n return `${databaseName}_audit`;\n}\n\nfunction refuseNamedPrincipal(context: AppCredentialMintingContext, verb: string): void {\n if (context.principal && context.principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n throw new Error(\n `ImmudbSelfInfraProviderModule.${verb}: principal '${context.principal.kind}:${context.principal.name}' is not `\n + 'the application backend. An application has ONE audit database and ONE audit user; its runtimes write through '\n + 'the application\\'s credential, so a per-principal immudb credential is never minted or revoked.',\n );\n }\n}\n\nfunction resolveDatabaseName(context: AppCredentialMintingContext): string {\n if (!context.applicationNamespace) {\n throw new Error('ImmudbSelfInfraProviderModule: applicationNamespace is empty. The orchestrator MUST supply it.');\n }\n const recorded = context.applicationConfigInputs?.[DATABASE_NAME_INPUT_KEY];\n if (recorded && (!DATABASE_NAME_PATTERN.test(recorded) || recorded.length > MAX_DATABASE_NAME_LENGTH)) {\n throw new Error(\n `ImmudbSelfInfraProviderModule: the recorded database name '${recorded}' is outside immudb's rules (letters and `\n + `digits only, at most ${MAX_DATABASE_NAME_LENGTH} characters so its audit user fits the 63-character limit).`,\n );\n }\n return recorded || buildImmudbDatabaseName(context.applicationNamespace);\n}\n\nexport const ImmudbSelfInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.IMMUDB_SELF,\n supportedCapabilities: [InfraCapability.AUDIT_LOG_STORAGE],\n\n /**\n * Empty: minions write through the application's audit credential (see the module JSDoc), so the delivery must\n * not strip it from them.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n dockerComposeServices: ['immudb'],\n k8sResources: ['templates/infra/k8s/internal/immudb/deployment.yaml.hbs'],\n platformAdmin: {\n envVars: {\n IMMUDB_ADMIN_HOST: 'immudb',\n IMMUDB_ADMIN_PORT: String(DEFAULT_IMMUDB_PORT),\n },\n // The server's built-in sysadmin password: a framework-managed platform secret (`immudb.adminPassword`),\n // written by the CLI's env builder into apps-manager's env only.\n secretEnvVars: ['IMMUDB_ADMIN_PASSWORD'],\n consumers: [InfraPlatformAdminConsumer.APPS_MANAGER],\n },\n appRuntime: {\n perAppSecretBlobPaths: [IMMUDB_USERNAME_PATH, IMMUDB_PASSWORD_PATH, IMMUDB_DATABASE_PATH],\n },\n };\n },\n\n // assurance-control: WILDO.ACCESS.LEAST_PRIVILEGE — READ_WRITE on the application's own database only, never ADMIN or SYSADMIN.\n async mintAppCredentials(context: AppCredentialMintingContext): Promise<AppCredentialMintingResult> {\n refuseNamedPrincipal(context, 'mintAppCredentials');\n const password = context.secretInputs[IMMUDB_PASSWORD_PATH];\n if (!password) {\n throw new Error(\n `ImmudbSelfInfraProviderModule.mintAppCredentials: secretInputs is missing '${IMMUDB_PASSWORD_PATH}'. `\n + 'The orchestrator MUST supply the password — modules are upsert-only.',\n );\n }\n if (!isImmudbCompliantPassword(password)) {\n throw new Error(\n 'ImmudbSelfInfraProviderModule.mintAppCredentials: the supplied password does not meet immudb\\'s rule '\n + '(8 to 32 characters with at least one uppercase letter, one digit and one special character).',\n );\n }\n const databaseName = resolveDatabaseName(context);\n const username = buildImmudbUsername(databaseName);\n const adminClient = context.adminClient as IImmudbAdminClient;\n await adminClient.ensureDatabase({ databaseName });\n await adminClient.upsertDatabaseUser({\n username,\n password,\n databaseName,\n permission: ImmudbDatabasePermission.READ_WRITE,\n });\n return {\n secretBlobValues: {\n [IMMUDB_USERNAME_PATH]: username,\n [IMMUDB_PASSWORD_PATH]: password,\n [IMMUDB_DATABASE_PATH]: databaseName,\n },\n };\n },\n\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — a withdrawn application's audit user is deactivated and its permission revoked.\n async revokeAppCredentials(context: AppCredentialMintingContext): Promise<void> {\n refuseNamedPrincipal(context, 'revokeAppCredentials');\n const databaseName = resolveDatabaseName(context);\n const adminClient = context.adminClient as IImmudbAdminClient;\n await adminClient.deactivateDatabaseUser({ username: buildImmudbUsername(databaseName), databaseName });\n },\n\n // No `mintPlatformServiceCredentials`: no platform service writes to the audit store.\n};\n"]}
1
+ {"version":3,"file":"immudb-self.infra.module.js","sourceRoot":"","sources":["../../../src/immudb-self/immudb-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,UAAU;SAChD,CAAC,CAAC;QACH,OAAO;YACL,gBAAgB,EAAE;gBAChB,CAAC,oBAAoB,CAAC,EAAE,QAAQ;gBAChC,CAAC,oBAAoB,CAAC,EAAE,QAAQ;gBAChC,CAAC,oBAAoB,CAAC,EAAE,YAAY;aACrC;SACF,CAAC;IACJ,CAAC;IAED,2IAA2I;IAC3I,KAAK,CAAC,oBAAoB,CAAC,OAAoC;QAC7D,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAiC,CAAC;QAC9D,MAAM,WAAW,CAAC,sBAAsB,CAAC,EAAE,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,sFAAsF;CACvF,CAAC","sourcesContent":["/**\n * `ImmudbSelfInfraProviderModule` — the self-hosted tamper-evident audit store (#1696).\n *\n * ## What it replaces\n *\n * Until #1696 the platform ran ONE immudb and every application's audit sink logged into it as the server's\n * built-in `immudb` SYSADMIN, into the same `defaultdb`: any application's backend held a superuser credential over\n * every application's tamper-evident audit data, and the server's admin password was copied from the OWNING\n * application's provider secret, so every hosted application had to be handed the owner's sysadmin password to write\n * at all. `IMMUDB_SELF` was servable only as an operator-credentialed exemption because nothing could mint anything\n * narrower.\n *\n * ## What it mints\n *\n * Per application: ONE immudb database and ONE user holding `READ_WRITE` on that database only — the permission an\n * audit sink needs to append and verify, and nothing that administers users, databases or the server. The values\n * reach the application in its platform secrets at `database.immudb.{username,password,database}`, the same paths the\n * engine's immudb provider reads first (`platformMintedSecretPath`), so the operator-authored `IMMUDB_USER` /\n * `IMMUDB_PASSWORD` / `IMMUDB_DATABASE` no longer decide anything on a self-hosted platform.\n *\n * The admin credential apps-manager mints with is a framework-managed PLATFORM secret (`immudb.adminPassword`),\n * delivered to apps-manager only (`IMMUDB_ADMIN_*`), and never to an application.\n *\n * ## Naming, and why it is this narrow\n *\n * immudb accepts only letters and digits in a database name (\"punctuation marks and symbols are not allowed in\n * database name\", immudb issue #1770) and `^[a-zA-Z0-9_]+$` up to 63 characters for a username. The application\n * namespace (`<slug>-<environment>`) carries hyphens, so the database name is its lowercased letters and digits plus\n * a short digest of the namespace itself: stripping punctuation alone would give `wonder-todos` and `wondertodos` the\n * SAME database, which is exactly the sharing this module exists to remove.\n * spec-cite: immudb v1.11.1 `pkg/auth/user.go` — `usernameRegex = ^[a-zA-Z0-9_]+$`, `maxUsernameLen = 63`\n * (https://raw.githubusercontent.com/codenotary/immudb/v1.11.1/pkg/auth/user.go, fetched 2026-09-29); the database\n * name rule is the server's error text quoted in https://github.com/codenotary/immudb/issues/1770.\n *\n * ## Runtime principals\n *\n * The APPLICATION BACKEND only. A minion's audit events go through the same application's audit trail, so it\n * receives the application's credential through the ordinary delivery (`perPrincipalSecretBlobPaths` is empty, so\n * nothing is stripped for it). A named principal passed here is refused rather than given a second database.\n *\n * ## Revocation\n *\n * `revokeAppCredentials` DEACTIVATES the user and revokes its permission — immudb has no user deletion, and the\n * database and its events are kept, because an append-only audit history must outlive the credential that wrote it\n * (#1307, #1562). `mintAppCredentials` re-activates and re-grants, which is what a restore runs.\n */\n\nimport { createHash } from 'node:crypto';\n\nimport {\n ApplicationRuntimePrincipalKind,\n AppCredentialMintingContext,\n AppCredentialMintingResult,\n IImmudbAdminClient,\n ImmudbDatabasePermission,\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\n/** immudb's gRPC port (matches `INFRA_DEFAULT_PORTS.IMMUDB`). */\nconst DEFAULT_IMMUDB_PORT = 3322;\n\n/**\n * The `Wildo_Application_Secrets` paths this module writes — the SAME strings the engine's immudb provider names as\n * `platformMintedSecretPath` (`IMMUDB_MINTED_SECRET_PATHS` in external-connectors-private). Each side is pinned to the\n * engine's `AppConfigurationSecrets.database.immudb` schema, which is where the two ends meet: these constants by\n * apps-manager's `immudb-minted-secret-paths` test, the engine's by saas-backend-lib's\n * `app-config-secrets.boundaries` test. The lifecycle imports these, never literals.\n */\nexport const IMMUDB_USERNAME_PATH = 'database.immudb.username';\nexport const IMMUDB_PASSWORD_PATH = 'database.immudb.password';\nexport const IMMUDB_DATABASE_PATH = 'database.immudb.database';\n\n/**\n * `applicationConfigInputs` key for the database name RECORDED at the first mint (apps-manager passes the stored\n * `database.immudb.database` back, so a revoke, a restore and a re-registration address the database the first mint\n * created even if the derivation ever changes). Not an authored value: `backingServices.immudb.database` is not read\n * for a self-hosted store.\n */\nconst DATABASE_NAME_INPUT_KEY = 'databaseName';\n\n/**\n * The longest database name whose `<name>_audit` user still fits immudb's 63-character username limit, and the\n * database name's own character rule (letters and digits). A recorded name outside either is refused rather than sent.\n */\nconst MAX_DATABASE_NAME_LENGTH = 63 - '_audit'.length;\nconst DATABASE_NAME_PATTERN = /^[a-zA-Z0-9]+$/;\n\n/**\n * immudb's password rule, checked here so a non-compliant value fails naming the application rather than as a bare\n * gRPC error from the server.\n * spec-cite: immudb v1.11.1 `pkg/auth/passwords.go` — \"password must have between 8 and 32 letters, digits and\n * special characters of which at least 1 uppercase letter, 1 digit and 1 special character\"\n * (https://raw.githubusercontent.com/codenotary/immudb/v1.11.1/pkg/auth/passwords.go, fetched 2026-09-29).\n */\nexport function isImmudbCompliantPassword(password: string): boolean {\n return password.length >= 8\n && password.length <= 32\n && /[A-Z]/.test(password)\n && /[0-9]/.test(password)\n && /[^A-Za-z0-9]/.test(password);\n}\n\n/**\n * The per-application database name: the namespace's lowercased letters and digits (capped) plus the first 8 hex of\n * its SHA-256, so two namespaces differing only in punctuation still get two databases. Deterministic, so a revoke,\n * a restore and a re-registration all address the database the first mint created.\n */\nexport function buildImmudbDatabaseName(applicationNamespace: string): string {\n const letters = applicationNamespace.toLowerCase().replace(/[^a-z0-9]/g, '').slice(0, 40);\n const digest = createHash('sha256').update(applicationNamespace).digest('hex').slice(0, 8);\n return `${letters}${digest}`;\n}\n\n/** The per-application audit user: the database name plus a role suffix, inside immudb's username rule. */\nexport function buildImmudbUsername(databaseName: string): string {\n return `${databaseName}_audit`;\n}\n\nfunction refuseNamedPrincipal(context: AppCredentialMintingContext, verb: string): void {\n if (context.principal && context.principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n throw new Error(\n `ImmudbSelfInfraProviderModule.${verb}: principal '${context.principal.kind}:${context.principal.name}' is not `\n + 'the application backend. An application has ONE audit database and ONE audit user; its runtimes write through '\n + 'the application\\'s credential, so a per-principal immudb credential is never minted or revoked.',\n );\n }\n}\n\nfunction resolveDatabaseName(context: AppCredentialMintingContext): string {\n if (!context.applicationNamespace) {\n throw new Error('ImmudbSelfInfraProviderModule: applicationNamespace is empty. The orchestrator MUST supply it.');\n }\n const recorded = context.applicationConfigInputs?.[DATABASE_NAME_INPUT_KEY];\n if (recorded && (!DATABASE_NAME_PATTERN.test(recorded) || recorded.length > MAX_DATABASE_NAME_LENGTH)) {\n throw new Error(\n `ImmudbSelfInfraProviderModule: the recorded database name '${recorded}' is outside immudb's rules (letters and `\n + `digits only, at most ${MAX_DATABASE_NAME_LENGTH} characters so its audit user fits the 63-character limit).`,\n );\n }\n return recorded || buildImmudbDatabaseName(context.applicationNamespace);\n}\n\nexport const ImmudbSelfInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.IMMUDB_SELF,\n supportedCapabilities: [InfraCapability.AUDIT_LOG_STORAGE],\n\n /**\n * Empty: minions write through the application's audit credential (see the module JSDoc), so the delivery must\n * not strip it from them.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n dockerComposeServices: ['immudb'],\n k8sResources: ['templates/infra/k8s/internal/immudb/deployment.yaml.hbs'],\n platformAdmin: {\n envVars: {\n IMMUDB_ADMIN_HOST: 'immudb',\n IMMUDB_ADMIN_PORT: String(DEFAULT_IMMUDB_PORT),\n },\n // The server's built-in sysadmin password: a framework-managed platform secret (`immudb.adminPassword`),\n // written by the CLI's env builder into apps-manager's env only.\n secretEnvVars: ['IMMUDB_ADMIN_PASSWORD'],\n consumers: [InfraPlatformAdminConsumer.APPS_MANAGER],\n },\n appRuntime: {\n perAppSecretBlobPaths: [IMMUDB_USERNAME_PATH, IMMUDB_PASSWORD_PATH, IMMUDB_DATABASE_PATH],\n },\n };\n },\n\n // assurance-control: WILDO.ACCESS.LEAST_PRIVILEGE — READ_WRITE on the application's own database only, never ADMIN or SYSADMIN.\n async mintAppCredentials(context: AppCredentialMintingContext): Promise<AppCredentialMintingResult> {\n refuseNamedPrincipal(context, 'mintAppCredentials');\n const password = context.secretInputs[IMMUDB_PASSWORD_PATH];\n if (!password) {\n throw new Error(\n `ImmudbSelfInfraProviderModule.mintAppCredentials: secretInputs is missing '${IMMUDB_PASSWORD_PATH}'. `\n + 'The orchestrator MUST supply the password — modules are upsert-only.',\n );\n }\n if (!isImmudbCompliantPassword(password)) {\n throw new Error(\n 'ImmudbSelfInfraProviderModule.mintAppCredentials: the supplied password does not meet immudb\\'s rule '\n + '(8 to 32 characters with at least one uppercase letter, one digit and one special character).',\n );\n }\n const databaseName = resolveDatabaseName(context);\n const username = buildImmudbUsername(databaseName);\n const adminClient = context.adminClient as IImmudbAdminClient;\n await adminClient.ensureDatabase({ databaseName });\n await adminClient.upsertDatabaseUser({\n username,\n password,\n databaseName,\n permission: ImmudbDatabasePermission.READ_WRITE,\n });\n return {\n secretBlobValues: {\n [IMMUDB_USERNAME_PATH]: username,\n [IMMUDB_PASSWORD_PATH]: password,\n [IMMUDB_DATABASE_PATH]: databaseName,\n },\n };\n },\n\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — a withdrawn application's audit user is deactivated and its permission revoked.\n async revokeAppCredentials(context: AppCredentialMintingContext): Promise<void> {\n refuseNamedPrincipal(context, 'revokeAppCredentials');\n const databaseName = resolveDatabaseName(context);\n const adminClient = context.adminClient as IImmudbAdminClient;\n await adminClient.deactivateDatabaseUser({ username: buildImmudbUsername(databaseName), databaseName });\n },\n\n // No `mintPlatformServiceCredentials`: no platform service writes to the audit store.\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * `@wildo-ai/platform-infra-providers` — concrete `InfraProviderModule`
3
- * catalog (Slice 2.5c-1 of `infra-provider-planner.md`).
3
+ * catalog.
4
4
  *
5
5
  * Tier-portable: the modules import only `@wildo-ai/platform-config-lib`
6
6
  * (contracts) and have no DI / mongoose / axios runtime dependencies.
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * `@wildo-ai/platform-infra-providers` — concrete `InfraProviderModule`
3
- * catalog (Slice 2.5c-1 of `infra-provider-planner.md`).
3
+ * catalog.
4
4
  *
5
5
  * Tier-portable: the modules import only `@wildo-ai/platform-config-lib`
6
6
  * (contracts) and have no DI / mongoose / axios runtime dependencies.
@@ -21,7 +21,7 @@ import { RedisSelfInfraProviderModule } from './redis-self/redis-self.infra.modu
21
21
  import { PostgresSelfInfraProviderModule } from './postgres-self/postgres-self.infra.module.js';
22
22
  import { MongodbAtlasInfraProviderModule } from './mongodb-atlas/mongodb-atlas.infra.module.js';
23
23
  import { MongodbSelfInfraProviderModule } from './mongodb-self/mongodb-self.infra.module.js';
24
- // Slice 5 of `infra-provider-planner.md` — object-storage + stateless infra.
24
+ // Object-storage + stateless infra.
25
25
  import { MinioSelfInfraProviderModule } from './minio-self/minio-self.infra.module.js';
26
26
  import { AwsS3InfraProviderModule } from './aws-s3/aws-s3.infra.module.js';
27
27
  import { ClamavSelfInfraProviderModule } from './clamav-self/clamav-self.infra.module.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO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GAAG,EAAiB,CAAC;AAE1G;;;;;;;;GAQG;AACH,MAAM,UAAU,6BAA6B;IAC3C,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAgB,qCAAqC,CAAC,CAAC;IAC/E,KAAK,MAAM,MAAM,IAAI,sBAAsB,EAAE,CAAC;QAC5C,IAAI,MAAM,CAAC,gBAAgB,KAAK,SAAS;YAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kCAAkC;IAChD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,MAAM,IAAI,sBAAsB,EAAE,CAAC;QAC5C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,2BAA2B,EAAE,CAAC;YACtD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B;IACzC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAsC,CAAC;IAC1D,KAAK,MAAM,CAAC,IAAI,sBAAsB,EAAE,CAAC;QACvC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,uDAAuD,CAAC,CAAC,QAAQ,MAAM;gBACvE,iDAAiD,CAClD,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * `@wildo-ai/platform-infra-providers` — concrete `InfraProviderModule`\n * catalog (Slice 2.5c-1 of `infra-provider-planner.md`).\n *\n * Tier-portable: the modules import only `@wildo-ai/platform-config-lib`\n * (contracts) and have no DI / mongoose / axios runtime dependencies.\n * This lets both `platform-apps-manager` (orchestrator) and\n * `wildo-cli` (lockfile materializer) consume the same module\n * objects — apps-manager passes a real admin-client implementation\n * via `AppCredentialMintingContext.adminClient`; wildo-cli only\n * needs `module.plan()` for the lockfile digest.\n *\n * Each module is exported by name (no intermediary barrels per\n * platform/CLAUDE.md \"no intermediary index.ts barrels\"). The\n * `INFRA_PROVIDER_MODULES` map below is the canonical catalog —\n * consumers iterate it (or look up by `InfraProvider` value) instead\n * of importing modules one by one.\n */\n\nimport { InfraProvider, type InfraProviderModule } from '@wildo-ai/platform-config-lib';\n\nimport { RabbitmqSelfInfraProviderModule } from './rabbitmq-self/rabbitmq-self.infra.module';\nimport { RedisSelfInfraProviderModule } from './redis-self/redis-self.infra.module';\nimport { PostgresSelfInfraProviderModule } from './postgres-self/postgres-self.infra.module';\nimport { MongodbAtlasInfraProviderModule } from './mongodb-atlas/mongodb-atlas.infra.module';\nimport { MongodbSelfInfraProviderModule } from './mongodb-self/mongodb-self.infra.module';\n// Slice 5 of `infra-provider-planner.md` — object-storage + stateless infra.\nimport { MinioSelfInfraProviderModule } from './minio-self/minio-self.infra.module';\nimport { AwsS3InfraProviderModule } from './aws-s3/aws-s3.infra.module';\nimport { ClamavSelfInfraProviderModule } from './clamav-self/clamav-self.infra.module';\nimport { ImmudbSelfInfraProviderModule } from './immudb-self/immudb-self.infra.module';\n\nexport { RabbitmqSelfInfraProviderModule } from './rabbitmq-self/rabbitmq-self.infra.module';\nexport { RedisSelfInfraProviderModule } from './redis-self/redis-self.infra.module';\nexport { PostgresSelfInfraProviderModule } from './postgres-self/postgres-self.infra.module';\nexport { MongodbAtlasInfraProviderModule } from './mongodb-atlas/mongodb-atlas.infra.module';\nexport { MongodbSelfInfraProviderModule } from './mongodb-self/mongodb-self.infra.module';\nexport { MinioSelfInfraProviderModule } from './minio-self/minio-self.infra.module';\nexport { AwsS3InfraProviderModule } from './aws-s3/aws-s3.infra.module';\nexport { ClamavSelfInfraProviderModule } from './clamav-self/clamav-self.infra.module';\nexport * from './immudb-self/immudb-self.infra.module';\n\n/**\n * Canonical `InfraProvider` → `InfraProviderModule` catalog. Caller\n * (CLI, apps-manager) builds a `Map<InfraProvider, InfraProviderModule>`\n * from this constant when threading modules into\n * `materializeInfraSection`.\n *\n * **Why a const array instead of a `Map` literal**: arrays serialize\n * stably under tsc and roll up to a deterministic order. The\n * downstream `Map` is built once at program start; the catalog\n * itself is a value-level fixture.\n *\n * **Coverage** (Slice 5 baseline, 2026-05-10):\n * - `RABBITMQ_SELF`, `REDIS_SELF`, `POSTGRES_SELF`, `MONGODB_SELF`,\n * `MONGODB_ATLAS` — five stateful modules with mint/revoke\n * methods.\n * - `MINIO_SELF`, `AWS_S3` — object storage (shared-bucket model;\n * no per-app credentials). `AWS_S3` declares `unservableReason`\n * (no AWS STS path in the credential broker, #14), so it plans but is\n * not servable.\n * - `CLAMAV_SELF` — stateless infra (no auth, no per-app state;\n * `plan()` only).\n *\n * **NOT covered** (catalog entries without modules):\n * - `POSTGRES_MANAGED`, `POSTGRES_AWS_RDS`, `POSTGRES_GCP_CLOUD_SQL`,\n * `POSTGRES_AZURE_DATABASE`, `POSTGRES_SUPABASE`, `POSTGRES_NEON`,\n * `POSTGRES_RENDER` — managed-Postgres brand catalog entries\n * (Slice 4.B.0). No module yet; trigger = real customer.\n *\n * A declaration resolving to a provider outside\n * {@link collectServableInfraProviders} is REFUSED by `wildo config\n * validate`, `config sync` and `lock check` (#1693) — it no longer falls\n * through to an authored-entry digest.\n */\nexport const INFRA_PROVIDER_MODULES: ReadonlyArray<InfraProviderModule> = [\n RabbitmqSelfInfraProviderModule,\n RedisSelfInfraProviderModule,\n PostgresSelfInfraProviderModule,\n MongodbAtlasInfraProviderModule,\n MongodbSelfInfraProviderModule,\n MinioSelfInfraProviderModule,\n AwsS3InfraProviderModule,\n ClamavSelfInfraProviderModule,\n // #1696: one immudb database and one confined user per application, replacing the operator-credentialed\n // exemption under which every application logged in as the server's sysadmin.\n ImmudbSelfInfraProviderModule,\n];\n\n/**\n * Providers the platform serves WITHOUT a module in {@link INFRA_PROVIDER_MODULES}, because their\n * application credential is the operator's to supply rather than the catalogue's to mint.\n *\n * ## Why this is the one exception, and why it is a list of exemptions rather than of refusals\n *\n * The servable set is DERIVED from the catalogue ({@link collectServableInfraProviders}); a hand-kept\n * list of refused providers would silently admit every provider added later. So the only thing\n * written down by hand is the exception, and it must be argued for here, one entry at a time.\n *\n * EMPTY since #1696, and kept as the named place such an exemption would be argued. `IMMUDB_SELF` was the one entry:\n * the self-hosted audit store had no module, and every application on the server logged in as its sysadmin into\n * one shared database. Its module now mints one database and one confined user per application, which makes it\n * servable on its own — and REFUSED on a platform that holds no immudb admin credential, like every minting kind.\n */\nexport const OPERATOR_CREDENTIALED_INFRA_PROVIDERS: ReadonlySet<InfraProvider> = new Set<InfraProvider>();\n\n/**\n * The providers a `backingServices` declaration may resolve to — every module in the catalogue that\n * does not declare `unservableReason`, plus {@link OPERATOR_CREDENTIALED_INFRA_PROVIDERS}.\n *\n * The one source both lockfile projections (`wildo config sync`, `wildo lock check`) and\n * `wildo config validate` pass to the shared check in `@wildo-ai/platform-config-lib`\n * (`findUnservableBackingServiceDeclarations`), so all three refuse the same declarations (#1693).\n * Derived, so a module entering the catalogue makes its provider declarable the day it lands.\n */\nexport function collectServableInfraProviders(): ReadonlySet<InfraProvider> {\n const servable = new Set<InfraProvider>(OPERATOR_CREDENTIALED_INFRA_PROVIDERS);\n for (const module of INFRA_PROVIDER_MODULES) {\n if (module.unservableReason === undefined) servable.add(module.provider);\n }\n return servable;\n}\n\n/**\n * Every `Wildo_Application_Secrets` JSON path that ANY provider module can mint per runtime\n * principal — the union of the catalog's own static declarations.\n *\n * ## Why this is derived rather than written down\n *\n * The consumer is the secret-DELIVERY path in apps-manager: it strips exactly this set from the\n * application blob before overlaying a principal's own material, so a principal receives a\n * credential only where one was minted FOR IT. A hand-maintained copy at that consumer would be a\n * second source — add a provider that mints a new credential path and delivery keeps shipping the\n * APPLICATION's value for it, silently. That is the defect class this repo has paid for twice: the\n * party that CONSTRAINS is not the party that DECLARES.\n *\n * Derived from `INFRA_PROVIDER_MODULES`, so a new module is covered the day it enters the catalog.\n *\n * Deliberately the union across ALL modules, not the ones a given application selected: a principal\n * must not receive an application-wide credential for a provider it does not use either, and the\n * selected set is not knowable at the delivery call site without threading app config through it.\n * Stripping a path no module minted for this app is harmless — it is absent from the blob anyway.\n */\nexport function collectPerPrincipalSecretBlobPaths(): ReadonlySet<string> {\n const paths = new Set<string>();\n for (const module of INFRA_PROVIDER_MODULES) {\n for (const path of module.perPrincipalSecretBlobPaths) {\n paths.add(path);\n }\n }\n return paths;\n}\n\n/**\n * Build a `Map<InfraProvider, InfraProviderModule>` for the\n * canonical catalog. Callers store the result once at startup and\n * pass it to `materializeInfraSection` (digest derivation) or to\n * orchestrator paths that look up modules by `InfraProvider`.\n */\nexport function buildInfraProviderModuleMap(): ReadonlyMap<InfraProvider, InfraProviderModule> {\n const map = new Map<InfraProvider, InfraProviderModule>();\n for (const m of INFRA_PROVIDER_MODULES) {\n if (map.has(m.provider)) {\n throw new Error(\n `INFRA_PROVIDER_MODULES contains duplicate provider '${m.provider}' — ` +\n `each InfraProvider may have at most one module.`,\n );\n }\n map.set(m.provider, m);\n }\n return map;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,oCAAoC;AACpC,OAAO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AAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kCAAkC;IAChD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,MAAM,IAAI,sBAAsB,EAAE,CAAC;QAC5C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,2BAA2B,EAAE,CAAC;YACtD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B;IACzC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAsC,CAAC;IAC1D,KAAK,MAAM,CAAC,IAAI,sBAAsB,EAAE,CAAC;QACvC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,uDAAuD,CAAC,CAAC,QAAQ,MAAM;gBACvE,iDAAiD,CAClD,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * `@wildo-ai/platform-infra-providers` — concrete `InfraProviderModule`\n * catalog.\n *\n * Tier-portable: the modules import only `@wildo-ai/platform-config-lib`\n * (contracts) and have no DI / mongoose / axios runtime dependencies.\n * This lets both `platform-apps-manager` (orchestrator) and\n * `wildo-cli` (lockfile materializer) consume the same module\n * objects — apps-manager passes a real admin-client implementation\n * via `AppCredentialMintingContext.adminClient`; wildo-cli only\n * needs `module.plan()` for the lockfile digest.\n *\n * Each module is exported by name (no intermediary barrels per\n * platform/CLAUDE.md \"no intermediary index.ts barrels\"). The\n * `INFRA_PROVIDER_MODULES` map below is the canonical catalog —\n * consumers iterate it (or look up by `InfraProvider` value) instead\n * of importing modules one by one.\n */\n\nimport { InfraProvider, type InfraProviderModule } from '@wildo-ai/platform-config-lib';\n\nimport { RabbitmqSelfInfraProviderModule } from './rabbitmq-self/rabbitmq-self.infra.module';\nimport { RedisSelfInfraProviderModule } from './redis-self/redis-self.infra.module';\nimport { PostgresSelfInfraProviderModule } from './postgres-self/postgres-self.infra.module';\nimport { MongodbAtlasInfraProviderModule } from './mongodb-atlas/mongodb-atlas.infra.module';\nimport { MongodbSelfInfraProviderModule } from './mongodb-self/mongodb-self.infra.module';\n// Object-storage + stateless infra.\nimport { MinioSelfInfraProviderModule } from './minio-self/minio-self.infra.module';\nimport { AwsS3InfraProviderModule } from './aws-s3/aws-s3.infra.module';\nimport { ClamavSelfInfraProviderModule } from './clamav-self/clamav-self.infra.module';\nimport { ImmudbSelfInfraProviderModule } from './immudb-self/immudb-self.infra.module';\n\nexport { RabbitmqSelfInfraProviderModule } from './rabbitmq-self/rabbitmq-self.infra.module';\nexport { RedisSelfInfraProviderModule } from './redis-self/redis-self.infra.module';\nexport { PostgresSelfInfraProviderModule } from './postgres-self/postgres-self.infra.module';\nexport { MongodbAtlasInfraProviderModule } from './mongodb-atlas/mongodb-atlas.infra.module';\nexport { MongodbSelfInfraProviderModule } from './mongodb-self/mongodb-self.infra.module';\nexport { MinioSelfInfraProviderModule } from './minio-self/minio-self.infra.module';\nexport { AwsS3InfraProviderModule } from './aws-s3/aws-s3.infra.module';\nexport { ClamavSelfInfraProviderModule } from './clamav-self/clamav-self.infra.module';\nexport * from './immudb-self/immudb-self.infra.module';\n\n/**\n * Canonical `InfraProvider` → `InfraProviderModule` catalog. Caller\n * (CLI, apps-manager) builds a `Map<InfraProvider, InfraProviderModule>`\n * from this constant when threading modules into\n * `materializeInfraSection`.\n *\n * **Why a const array instead of a `Map` literal**: arrays serialize\n * stably under tsc and roll up to a deterministic order. The\n * downstream `Map` is built once at program start; the catalog\n * itself is a value-level fixture.\n *\n * **Coverage** (Slice 5 baseline, 2026-05-10):\n * - `RABBITMQ_SELF`, `REDIS_SELF`, `POSTGRES_SELF`, `MONGODB_SELF`,\n * `MONGODB_ATLAS` — five stateful modules with mint/revoke\n * methods.\n * - `MINIO_SELF`, `AWS_S3` — object storage (shared-bucket model;\n * no per-app credentials). `AWS_S3` declares `unservableReason`\n * (no AWS STS path in the credential broker, #14), so it plans but is\n * not servable.\n * - `CLAMAV_SELF` — stateless infra (no auth, no per-app state;\n * `plan()` only).\n *\n * **NOT covered** (catalog entries without modules):\n * - `POSTGRES_MANAGED`, `POSTGRES_AWS_RDS`, `POSTGRES_GCP_CLOUD_SQL`,\n * `POSTGRES_AZURE_DATABASE`, `POSTGRES_SUPABASE`, `POSTGRES_NEON`,\n * `POSTGRES_RENDER` — managed-Postgres brand catalog entries\n * (Slice 4.B.0). No module yet; trigger = real customer.\n *\n * A declaration resolving to a provider outside\n * {@link collectServableInfraProviders} is REFUSED by `wildo config\n * validate`, `config sync` and `lock check` (#1693) — it no longer falls\n * through to an authored-entry digest.\n */\nexport const INFRA_PROVIDER_MODULES: ReadonlyArray<InfraProviderModule> = [\n RabbitmqSelfInfraProviderModule,\n RedisSelfInfraProviderModule,\n PostgresSelfInfraProviderModule,\n MongodbAtlasInfraProviderModule,\n MongodbSelfInfraProviderModule,\n MinioSelfInfraProviderModule,\n AwsS3InfraProviderModule,\n ClamavSelfInfraProviderModule,\n // #1696: one immudb database and one confined user per application, replacing the operator-credentialed\n // exemption under which every application logged in as the server's sysadmin.\n ImmudbSelfInfraProviderModule,\n];\n\n/**\n * Providers the platform serves WITHOUT a module in {@link INFRA_PROVIDER_MODULES}, because their\n * application credential is the operator's to supply rather than the catalogue's to mint.\n *\n * ## Why this is the one exception, and why it is a list of exemptions rather than of refusals\n *\n * The servable set is DERIVED from the catalogue ({@link collectServableInfraProviders}); a hand-kept\n * list of refused providers would silently admit every provider added later. So the only thing\n * written down by hand is the exception, and it must be argued for here, one entry at a time.\n *\n * EMPTY since #1696, and kept as the named place such an exemption would be argued. `IMMUDB_SELF` was the one entry:\n * the self-hosted audit store had no module, and every application on the server logged in as its sysadmin into\n * one shared database. Its module now mints one database and one confined user per application, which makes it\n * servable on its own — and REFUSED on a platform that holds no immudb admin credential, like every minting kind.\n */\nexport const OPERATOR_CREDENTIALED_INFRA_PROVIDERS: ReadonlySet<InfraProvider> = new Set<InfraProvider>();\n\n/**\n * The providers a `backingServices` declaration may resolve to — every module in the catalogue that\n * does not declare `unservableReason`, plus {@link OPERATOR_CREDENTIALED_INFRA_PROVIDERS}.\n *\n * The one source both lockfile projections (`wildo config sync`, `wildo lock check`) and\n * `wildo config validate` pass to the shared check in `@wildo-ai/platform-config-lib`\n * (`findUnservableBackingServiceDeclarations`), so all three refuse the same declarations (#1693).\n * Derived, so a module entering the catalogue makes its provider declarable the day it lands.\n */\nexport function collectServableInfraProviders(): ReadonlySet<InfraProvider> {\n const servable = new Set<InfraProvider>(OPERATOR_CREDENTIALED_INFRA_PROVIDERS);\n for (const module of INFRA_PROVIDER_MODULES) {\n if (module.unservableReason === undefined) servable.add(module.provider);\n }\n return servable;\n}\n\n/**\n * Every `Wildo_Application_Secrets` JSON path that ANY provider module can mint per runtime\n * principal — the union of the catalog's own static declarations.\n *\n * ## Why this is derived rather than written down\n *\n * The consumer is the secret-DELIVERY path in apps-manager: it strips exactly this set from the\n * application blob before overlaying a principal's own material, so a principal receives a\n * credential only where one was minted FOR IT. A hand-maintained copy at that consumer would be a\n * second source — add a provider that mints a new credential path and delivery keeps shipping the\n * APPLICATION's value for it, silently. That is the defect class this repo has paid for twice: the\n * party that CONSTRAINS is not the party that DECLARES.\n *\n * Derived from `INFRA_PROVIDER_MODULES`, so a new module is covered the day it enters the catalog.\n *\n * Deliberately the union across ALL modules, not the ones a given application selected: a principal\n * must not receive an application-wide credential for a provider it does not use either, and the\n * selected set is not knowable at the delivery call site without threading app config through it.\n * Stripping a path no module minted for this app is harmless — it is absent from the blob anyway.\n */\nexport function collectPerPrincipalSecretBlobPaths(): ReadonlySet<string> {\n const paths = new Set<string>();\n for (const module of INFRA_PROVIDER_MODULES) {\n for (const path of module.perPrincipalSecretBlobPaths) {\n paths.add(path);\n }\n }\n return paths;\n}\n\n/**\n * Build a `Map<InfraProvider, InfraProviderModule>` for the\n * canonical catalog. Callers store the result once at startup and\n * pass it to `materializeInfraSection` (digest derivation) or to\n * orchestrator paths that look up modules by `InfraProvider`.\n */\nexport function buildInfraProviderModuleMap(): ReadonlyMap<InfraProvider, InfraProviderModule> {\n const map = new Map<InfraProvider, InfraProviderModule>();\n for (const m of INFRA_PROVIDER_MODULES) {\n if (map.has(m.provider)) {\n throw new Error(\n `INFRA_PROVIDER_MODULES contains duplicate provider '${m.provider}' — ` +\n `each InfraProvider may have at most one module.`,\n );\n }\n map.set(m.provider, m);\n }\n return map;\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * `MinioSelfInfraProviderModule` — sixth concrete `InfraProviderModule`
3
- * (Slice 5.1 of `infra-provider-planner.md`, generalizing the
4
- * Slice 2 / 4.B pattern to object storage).
3
+ * (generalizing the module pattern to object storage).
5
4
  *
6
5
  * Implements the `MINIO_SELF` `InfraProvider`. One shared MinIO bucket
7
6
  * serves every application; the object-key tree is namespaced
@@ -56,8 +55,6 @@
56
55
  * but applications DO receive a per-application storage credential at
57
56
  * runtime, from apps-manager. "No app-scoped audience in this module" is
58
57
  * not "no app-scoped credential in the system".
59
- *
60
- * See `.claude/plans/object-storage-root-credential-distribution.md`.
61
58
  */
62
59
  import { InfraProviderModule } from '@wildo-ai/platform-config-lib';
63
60
  export declare const MinioSelfInfraProviderModule: InfraProviderModule;
@@ -1 +1 @@
1
- {"version":3,"file":"minio-self.infra.module.d.ts","sourceRoot":"","sources":["../../../src/minio-self/minio-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,EAIL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,4BAA4B,EAAE,mBA6C1C,CAAC"}
1
+ {"version":3,"file":"minio-self.infra.module.d.ts","sourceRoot":"","sources":["../../../src/minio-self/minio-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EAIL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AAIvC,eAAO,MAAM,4BAA4B,EAAE,mBA6C1C,CAAC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * `MinioSelfInfraProviderModule` — sixth concrete `InfraProviderModule`
3
- * (Slice 5.1 of `infra-provider-planner.md`, generalizing the
4
- * Slice 2 / 4.B pattern to object storage).
3
+ * (generalizing the module pattern to object storage).
5
4
  *
6
5
  * Implements the `MINIO_SELF` `InfraProvider`. One shared MinIO bucket
7
6
  * serves every application; the object-key tree is namespaced
@@ -56,8 +55,6 @@
56
55
  * but applications DO receive a per-application storage credential at
57
56
  * runtime, from apps-manager. "No app-scoped audience in this module" is
58
57
  * not "no app-scoped credential in the system".
59
- *
60
- * See `.claude/plans/object-storage-root-credential-distribution.md`.
61
58
  */
62
59
  import { InfraCapability, InfraPlatformAdminConsumer, InfraProvider, } from '@wildo-ai/platform-config-lib';
63
60
  const DEFAULT_MINIO_PORT = 9000;
@@ -1 +1 @@
1
- {"version":3,"file":"minio-self.infra.module.js","sourceRoot":"","sources":["../../../../src/minio-self/minio-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,CAAC,MAAM,4BAA4B,GAAwB;IAC/D,QAAQ,EAAE,aAAa,CAAC,UAAU;IAClC,qBAAqB,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC;IAEvD;;;OAGG;IACH,2BAA2B,EAAE,EAAE;IAE/B,IAAI;QACF,OAAO;YACL,qBAAqB,EAAE,CAAC,OAAO,CAAC;YAChC,YAAY,EAAE,CAAC,wDAAwD,CAAC;YACxE,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,gBAAgB,EAAE,OAAO;oBACzB,gBAAgB,EAAE,OAAO;oBACzB,YAAY,EAAE,MAAM,CAAC,kBAAkB,CAAC;oBACxC,eAAe,EAAE,OAAO;iBACzB;gBACD,4DAA4D;gBAC5D,yDAAyD;gBACzD,sBAAsB;gBACtB,aAAa,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;gBAC3D,SAAS,EAAE;oBACT,0BAA0B,CAAC,YAAY;oBACvC,0BAA0B,CAAC,SAAS;iBACrC;aACF;YACD,0DAA0D;YAC1D,2DAA2D;YAC3D,oEAAoE;YACpE,oEAAoE;YACpE,gEAAgE;YAChE,iEAAiE;YACjE,uCAAuC;SACxC,CAAC;IACJ,CAAC;IAED,iEAAiE;IACjE,oEAAoE;IACpE,0DAA0D;IAC1D,8DAA8D;IAC9D,qDAAqD;CACtD,CAAC","sourcesContent":["/**\n * `MinioSelfInfraProviderModule` — sixth concrete `InfraProviderModule`\n * (Slice 5.1 of `infra-provider-planner.md`, generalizing the\n * Slice 2 / 4.B pattern to object storage).\n *\n * Implements the `MINIO_SELF` `InfraProvider`. One shared MinIO bucket\n * serves every application; the object-key tree is namespaced\n * `${prefix}/applications/${applicationId}/files/${fileId}`.\n *\n * `mintAppCredentials` / `revokeAppCredentials` are absent from THIS\n * module, and that remains accurate — but it no longer means what it\n * used to. Per-application credential isolation exists; it is simply\n * not implemented here. See below.\n *\n * ## ⚠️ Corrected 2026-08-10 — this block described a posture the\n * system no longer has\n *\n * It previously stated that every app shares \"one access-key/secret-key\n * pair\", that per-app isolation \"comes from `STORAGE_BUCKET_PREFIX`\",\n * and that app-scoped credentials were \"NONE — apps consume the shared\n * `STORAGE_*` env\". All three were true when written and are now false:\n *\n * - Applications no longer receive any long-lived storage credential.\n * `STORAGE_ACCESS_KEY` / `STORAGE_SECRET_KEY` are no longer emitted\n * into application-tier env at all — they were the object store's\n * ROOT pair, and handing them to every app, minion and worker is the\n * exposure this was corrected to remove.\n * - Isolation is enforced by a **credential**, not by a prefix\n * convention. `apps-manager`'s `ObjectStorageStsBrokerService` issues\n * short-lived STS sessions whose inline policy confines each\n * application to `applications/<applicationId>/`, keyed on the\n * platform-minted id — never on `STORAGE_BUCKET_PREFIX`, which an\n * application authors for itself and therefore cannot be a security\n * boundary. The prefix is now cosmetic namespacing.\n *\n * The three prerequisites this block listed for per-app credentials\n * were addressed rather than deferred: the adapter threads per-principal\n * credentials through a credential provider (1); the session policy\n * replaces per-app bucket-policy authoring (2); and rotation safety (3)\n * dissolved — STS credentials expire by construction, so there is no\n * long-lived key whose rotation must be coordinated across pods.\n *\n * **Why the mint methods still do not live here.** MinIO's JS client\n * ships no user-management API, so minting would need the `mc` binary or\n * hand-written admin-API crypto. STS needs neither, and belongs with the\n * service that holds the admin credential — apps-manager — rather than\n * with this planning module, which contributes deployment topology.\n *\n * **Audience-1 (platform-admin)**: cluster-wide MinIO admin creds\n * delivered via env. Consumers: `apps-manager` (which brokers STS from\n * them) and `companion`. Whether these consumers should hold *root*\n * specifically, rather than a narrower admin credential, is OQ-2 in the\n * plan below.\n *\n * **Audience-3 (app-scoped)**: no per-app MinIO STATE is minted here —\n * but applications DO receive a per-application storage credential at\n * runtime, from apps-manager. \"No app-scoped audience in this module\" is\n * not \"no app-scoped credential in the system\".\n *\n * See `.claude/plans/object-storage-root-credential-distribution.md`.\n */\n\nimport {\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\nconst DEFAULT_MINIO_PORT = 9000;\n\nexport const MinioSelfInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.MINIO_SELF,\n supportedCapabilities: [InfraCapability.OBJECT_STORAGE],\n\n /**\n * Shared bucket, shared root key — same as AWS S3: object-storage confinement is an STS session\n * policy minted per request, never a per-principal secret in the application blob.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n dockerComposeServices: ['minio'],\n k8sResources: ['templates/infra/k8s/internal/minio/deployment.yaml.hbs'],\n platformAdmin: {\n envVars: {\n STORAGE_PROVIDER: 'minio',\n STORAGE_ENDPOINT: 'minio',\n STORAGE_PORT: String(DEFAULT_MINIO_PORT),\n STORAGE_USE_SSL: 'false',\n },\n // Cluster-wide bucket access creds. Every app uses the same\n // pair. Per-app isolation is via `STORAGE_BUCKET_PREFIX`\n // (see module JSDoc).\n secretEnvVars: ['STORAGE_ACCESS_KEY', 'STORAGE_SECRET_KEY'],\n consumers: [\n InfraPlatformAdminConsumer.APPS_MANAGER,\n InfraPlatformAdminConsumer.COMPANION,\n ],\n },\n // Apps receive `STORAGE_*` via the bootstrap env contract\n // (engine-side `application-backend-env.contracts.ts`). No\n // per-app blob paths: storage holds no per-app SECRET (sessions are\n // STS-issued by apps-manager). The BUCKET is per application — each\n // authors `backingServices.s3.bucket`, sent at registration and\n // recorded by apps-manager (#1107) — but it is addressing, not a\n // secret, so `appRuntime` stays empty.\n };\n },\n\n // No `mintAppCredentials` / `revokeAppCredentials` — application\n // storage access is an STS session apps-manager issues per request,\n // confined to that application's recorded bucket (#1107).\n // No `mintPlatformServiceCredentials` — platform services use\n // apps-manager's own bucket through the same broker.\n};\n"]}
1
+ {"version":3,"file":"minio-self.infra.module.js","sourceRoot":"","sources":["../../../src/minio-self/minio-self.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,CAAC,MAAM,4BAA4B,GAAwB;IAC/D,QAAQ,EAAE,aAAa,CAAC,UAAU;IAClC,qBAAqB,EAAE,CAAC,eAAe,CAAC,cAAc,CAAC;IAEvD;;;OAGG;IACH,2BAA2B,EAAE,EAAE;IAE/B,IAAI;QACF,OAAO;YACL,qBAAqB,EAAE,CAAC,OAAO,CAAC;YAChC,YAAY,EAAE,CAAC,wDAAwD,CAAC;YACxE,aAAa,EAAE;gBACb,OAAO,EAAE;oBACP,gBAAgB,EAAE,OAAO;oBACzB,gBAAgB,EAAE,OAAO;oBACzB,YAAY,EAAE,MAAM,CAAC,kBAAkB,CAAC;oBACxC,eAAe,EAAE,OAAO;iBACzB;gBACD,4DAA4D;gBAC5D,yDAAyD;gBACzD,sBAAsB;gBACtB,aAAa,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;gBAC3D,SAAS,EAAE;oBACT,0BAA0B,CAAC,YAAY;oBACvC,0BAA0B,CAAC,SAAS;iBACrC;aACF;YACD,0DAA0D;YAC1D,2DAA2D;YAC3D,oEAAoE;YACpE,oEAAoE;YACpE,gEAAgE;YAChE,iEAAiE;YACjE,uCAAuC;SACxC,CAAC;IACJ,CAAC;IAED,iEAAiE;IACjE,oEAAoE;IACpE,0DAA0D;IAC1D,8DAA8D;IAC9D,qDAAqD;CACtD,CAAC","sourcesContent":["/**\n * `MinioSelfInfraProviderModule` — sixth concrete `InfraProviderModule`\n * (generalizing the module pattern to object storage).\n *\n * Implements the `MINIO_SELF` `InfraProvider`. One shared MinIO bucket\n * serves every application; the object-key tree is namespaced\n * `${prefix}/applications/${applicationId}/files/${fileId}`.\n *\n * `mintAppCredentials` / `revokeAppCredentials` are absent from THIS\n * module, and that remains accurate — but it no longer means what it\n * used to. Per-application credential isolation exists; it is simply\n * not implemented here. See below.\n *\n * ## ⚠️ Corrected 2026-08-10 — this block described a posture the\n * system no longer has\n *\n * It previously stated that every app shares \"one access-key/secret-key\n * pair\", that per-app isolation \"comes from `STORAGE_BUCKET_PREFIX`\",\n * and that app-scoped credentials were \"NONE — apps consume the shared\n * `STORAGE_*` env\". All three were true when written and are now false:\n *\n * - Applications no longer receive any long-lived storage credential.\n * `STORAGE_ACCESS_KEY` / `STORAGE_SECRET_KEY` are no longer emitted\n * into application-tier env at all — they were the object store's\n * ROOT pair, and handing them to every app, minion and worker is the\n * exposure this was corrected to remove.\n * - Isolation is enforced by a **credential**, not by a prefix\n * convention. `apps-manager`'s `ObjectStorageStsBrokerService` issues\n * short-lived STS sessions whose inline policy confines each\n * application to `applications/<applicationId>/`, keyed on the\n * platform-minted id — never on `STORAGE_BUCKET_PREFIX`, which an\n * application authors for itself and therefore cannot be a security\n * boundary. The prefix is now cosmetic namespacing.\n *\n * The three prerequisites this block listed for per-app credentials\n * were addressed rather than deferred: the adapter threads per-principal\n * credentials through a credential provider (1); the session policy\n * replaces per-app bucket-policy authoring (2); and rotation safety (3)\n * dissolved — STS credentials expire by construction, so there is no\n * long-lived key whose rotation must be coordinated across pods.\n *\n * **Why the mint methods still do not live here.** MinIO's JS client\n * ships no user-management API, so minting would need the `mc` binary or\n * hand-written admin-API crypto. STS needs neither, and belongs with the\n * service that holds the admin credential — apps-manager — rather than\n * with this planning module, which contributes deployment topology.\n *\n * **Audience-1 (platform-admin)**: cluster-wide MinIO admin creds\n * delivered via env. Consumers: `apps-manager` (which brokers STS from\n * them) and `companion`. Whether these consumers should hold *root*\n * specifically, rather than a narrower admin credential, is OQ-2 in the\n * plan below.\n *\n * **Audience-3 (app-scoped)**: no per-app MinIO STATE is minted here —\n * but applications DO receive a per-application storage credential at\n * runtime, from apps-manager. \"No app-scoped audience in this module\" is\n * not \"no app-scoped credential in the system\".\n */\n\nimport {\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n} from '@wildo-ai/platform-config-lib';\n\nconst DEFAULT_MINIO_PORT = 9000;\n\nexport const MinioSelfInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.MINIO_SELF,\n supportedCapabilities: [InfraCapability.OBJECT_STORAGE],\n\n /**\n * Shared bucket, shared root key — same as AWS S3: object-storage confinement is an STS session\n * policy minted per request, never a per-principal secret in the application blob.\n */\n perPrincipalSecretBlobPaths: [],\n\n plan(): InfraProviderPlanContribution {\n return {\n dockerComposeServices: ['minio'],\n k8sResources: ['templates/infra/k8s/internal/minio/deployment.yaml.hbs'],\n platformAdmin: {\n envVars: {\n STORAGE_PROVIDER: 'minio',\n STORAGE_ENDPOINT: 'minio',\n STORAGE_PORT: String(DEFAULT_MINIO_PORT),\n STORAGE_USE_SSL: 'false',\n },\n // Cluster-wide bucket access creds. Every app uses the same\n // pair. Per-app isolation is via `STORAGE_BUCKET_PREFIX`\n // (see module JSDoc).\n secretEnvVars: ['STORAGE_ACCESS_KEY', 'STORAGE_SECRET_KEY'],\n consumers: [\n InfraPlatformAdminConsumer.APPS_MANAGER,\n InfraPlatformAdminConsumer.COMPANION,\n ],\n },\n // Apps receive `STORAGE_*` via the bootstrap env contract\n // (engine-side `application-backend-env.contracts.ts`). No\n // per-app blob paths: storage holds no per-app SECRET (sessions are\n // STS-issued by apps-manager). The BUCKET is per application — each\n // authors `backingServices.s3.bucket`, sent at registration and\n // recorded by apps-manager (#1107) — but it is addressing, not a\n // secret, so `appRuntime` stays empty.\n };\n },\n\n // No `mintAppCredentials` / `revokeAppCredentials` — application\n // storage access is an STS session apps-manager issues per request,\n // confined to that application's recorded bucket (#1107).\n // No `mintPlatformServiceCredentials` — platform services use\n // apps-manager's own bucket through the same broker.\n};\n"]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * `MongodbAtlasInfraProviderModule` — fourth concrete `InfraProviderModule`
3
- * (Slice 4.B.3 of `infra-provider-planner.md`, generalizing the Slice
4
- * 2 / 4.B.1 / 4.B.2 pattern to MongoDB Atlas).
3
+ * (generalizing the RabbitMQ / Redis / PostgreSQL module pattern to MongoDB Atlas).
5
4
  *
6
5
  * Implements the `MONGODB_ATLAS` `InfraProvider` over the
7
6
  * `IMongoAtlasClient` transport (Atlas REST API + digest auth, exposed
@@ -1 +1 @@
1
- {"version":3,"file":"mongodb-atlas.infra.module.d.ts","sourceRoot":"","sources":["../../../src/mongodb-atlas/mongodb-atlas.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,OAAO,EAQL,mBAAmB,EAKpB,MAAM,+BAA+B,CAAC;AA0IvC,eAAO,MAAM,+BAA+B,EAAE,mBA2K7C,CAAC"}
1
+ {"version":3,"file":"mongodb-atlas.infra.module.d.ts","sourceRoot":"","sources":["../../../src/mongodb-atlas/mongodb-atlas.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EAQL,mBAAmB,EAKpB,MAAM,+BAA+B,CAAC;AA0IvC,eAAO,MAAM,+BAA+B,EAAE,mBA2K7C,CAAC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * `MongodbAtlasInfraProviderModule` — fourth concrete `InfraProviderModule`
3
- * (Slice 4.B.3 of `infra-provider-planner.md`, generalizing the Slice
4
- * 2 / 4.B.1 / 4.B.2 pattern to MongoDB Atlas).
3
+ * (generalizing the RabbitMQ / Redis / PostgreSQL module pattern to MongoDB Atlas).
5
4
  *
6
5
  * Implements the `MONGODB_ATLAS` `InfraProvider` over the
7
6
  * `IMongoAtlasClient` transport (Atlas REST API + digest auth, exposed
@@ -1 +1 @@
1
- {"version":3,"file":"mongodb-atlas.infra.module.js","sourceRoot":"","sources":["../../../../src/mongodb-atlas/mongodb-atlas.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,IAAI,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACxC,mGAAmG;YACnG,+FAA+F;YAC/F,4FAA4F;YAC5F,MAAM,WAAW,CAAC,gCAAgC,CAChD,6BAA6B,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,CAC/E,CAAC;YACF,OAAO;QACT,CAAC;QACD,MAAM,WAAW,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACvH,CAAC;IAED,6CAA6C;CAC9C,CAAC","sourcesContent":["/**\n * `MongodbAtlasInfraProviderModule` — fourth concrete `InfraProviderModule`\n * (Slice 4.B.3 of `infra-provider-planner.md`, generalizing the Slice\n * 2 / 4.B.1 / 4.B.2 pattern to MongoDB Atlas).\n *\n * Implements the `MONGODB_ATLAS` `InfraProvider` over the\n * `IMongoAtlasClient` transport (Atlas REST API + digest auth, exposed\n * by `MongoAtlasManagerService` after the Slice 4.B.3 5C policy/\n * transport split). Owns the Atlas naming and grant policy; the USERNAME\n * policy itself is shared with the self-hosted module through\n * `buildMongodbPrincipalUsername` (`<applicationNamespace>_user` for the\n * application backend, `<namespace>_<kind>_<name>_user` for a principal).\n *\n * **What this module reads from `AppCredentialMintingContext`**:\n * - `applicationNamespace` + `principal` — the username source (above).\n * - `secretInputs['database.mongodb.password']` — orchestrator-\n * supplied password (module is upsert-only, never generator).\n * - `applicationConfigInputs['databaseName']` — required, the\n * per-app database name.\n * - `applicationConfigInputs['clusterName']` — required, the Atlas\n * cluster name. apps-manager resolves it once (`resolveAtlasClusterName`)\n * for the application user and every principal user, and a later\n * reconcile reads back the cluster recorded at registration.\n * - `resourceGrants` — required for a named principal: its declared\n * access, to which the engine floor is added here.\n * - `adminClient` — narrowed to `IMongoAtlasClient`.\n *\n * **Two audiences this module serves:**\n *\n * 1. **Audience-1 (platform-admin)**: Atlas API public/private key\n * pair + project id + base URL. Consumers: `apps-manager` only\n * (companion uses self-managed locally; Atlas is remote-only).\n *\n * 2. **Audience-3 (app-scoped, via `mintAppCredentials`)**:\n * per-customer-app Atlas database user. Result threaded into\n * `Wildo_Application_Secrets.database.mongodb.{username,password}`\n * via `_merge_WildoApplicationSecrets`; the cluster's connection\n * string (its SRV address, or the `mongoURIWithOptions` seed list\n * when it has none, #1969) returned via `runtimeArtifacts.connectionString` for\n * transient app-init operations (NOT persisted — the persistence\n * shape is split between config (host/protocol/options/database)\n * and secrets (username/password)).\n *\n * **NOT served (D-4 of Slice 4.B locked decisions, 2026-05-10)**:\n * - **Audience-2 (platform-service-scoped)**: no platform service\n * uses Atlas for inter-service messaging today. Method omitted.\n *\n * **`revokeAppCredentials`**: for a runtime principal, apps-manager's\n * declaration reconcile calls it when a minion is removed. For the application\n * backend, apps-manager calls it when the application is withdrawn from the\n * platform (`deregisterApplication`, #1307): the database user is deleted and\n * the database is kept, so `restoreApplication` can re-mint it.\n *\n * **Runtime principals (minions), #1694**: each gets its OWN Atlas database\n * user holding ONE Atlas custom database role — the Atlas twin of the\n * self-hosted module's collection-scoped user:\n * - the username comes from `buildMongodbPrincipalUsername`, the SAME\n * derivation the self-hosted module uses, so it can never be the backend's\n * `<namespace>_user`, and the mint and the revoke cannot disagree about it;\n * - the role carries the principal's declared `resourceAccess` PLUS the engine\n * execution-history floor every enabled Node minion needs, derived through\n * `deriveMinionDatabaseGrants` → `buildMinionMongodbPrivileges`, the same\n * pair the self-hosted module uses, then translated into Atlas's action names;\n * - the user is scoped to the application's cluster alone;\n * - revoking deletes that user and that role, and nothing else.\n *\n * Before #1694 the module ignored `principal` and derived `<namespace>_user`\n * for every input, so a minion mint would have overwritten the backend's user\n * and a minion revoke would have deleted it; apps-manager refused the\n * combination at registration instead.\n */\n\nimport {\n ApplicationRuntimePrincipalKind,\n AppCredentialMintingContext,\n AppCredentialMintingResult,\n IMongoAtlasClient,\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n deriveMinionDatabaseGrants,\n resolveGrantStorageNames,\n type ApplicationRuntimePrincipal,\n} from '@wildo-ai/platform-config-lib';\nimport {\n buildMinionMongodbPrivileges,\n buildMongodbPrincipalUsername,\n type MongodbCollectionPrivilege,\n} from '../mongodb-self/mongodb-self.infra.module';\n\n/**\n * The `Wildo_Application_Secrets` JSON paths this module writes\n * through `mintAppCredentials.secretBlobValues`. Declared once and\n * reused as `appRuntime.perAppSecretBlobPaths` in `plan()` AND as\n * the keys of the result, so a refactor that renames a path fails\n * loudly at one place.\n */\nconst MONGODB_USERNAME_PATH = 'database.mongodb.username';\nconst MONGODB_PASSWORD_PATH = 'database.mongodb.password';\n/**\n * The paths this module mints PER RUNTIME PRINCIPAL — the single source for both consumers.\n *\n * Read by `InfraProviderModule.perPrincipalSecretBlobPaths` (statically, so apps-manager can strip\n * these from the application blob before delivering a principal's own material) AND spread into\n * `appRuntime.perAppSecretBlobPaths` inside `plan()`. Declaring the list twice is how the delivery\n * path would silently stop covering a path this module still mints.\n */\nconst PER_PRINCIPAL_SECRET_BLOB_PATHS: ReadonlyArray<string> = [MONGODB_USERNAME_PATH, MONGODB_PASSWORD_PATH];\n\n\n/**\n * Key the module looks for in `secretInputs` for the orchestrator-\n * supplied password.\n */\nconst MONGODB_PASSWORD_INPUT_KEY = 'database.mongodb.password';\n\n/**\n * Required keys in `applicationConfigInputs`. The orchestrator\n * derives both before calling `mintAppCredentials`.\n */\nconst DATABASE_NAME_INPUT_KEY = 'databaseName';\nconst CLUSTER_NAME_INPUT_KEY = 'clusterName';\n\n/**\n * Key in `runtimeArtifacts` carrying the cluster's connection string — its SRV\n * address, or the `mongoURIWithOptions` seed list when it has none (#1969) — with\n * credentials embedded. Exposed for orchestrator transient use\n * (app-init seeding); deliberately NOT persisted.\n */\nconst CONNECTION_STRING_ARTIFACT_KEY = 'connectionString';\n\n/**\n * A named runtime principal (a minion) — anything but the application backend, which keeps the\n * application-level `<namespace>_user` and its database-wide role.\n */\nfunction isNamedPrincipal(principal: ApplicationRuntimePrincipal | undefined): principal is ApplicationRuntimePrincipal {\n return principal !== undefined && principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND;\n}\n\n/**\n * The Atlas custom role a principal's user holds — derived from the principal's username exactly as the\n * self-hosted module derives its role (`<username>_role`), so the mint and the revoke name the same role.\n *\n * Custom roles are PROJECT-wide in Atlas, not per database or cluster, so the name must be unique across\n * every application the project hosts. It is: the username embeds the application namespace.\n */\nfunction buildAtlasPrincipalRoleName(username: string): string {\n return `${username}_role`;\n}\n\n/**\n * Atlas's rule for a custom role name, checked before any request so a name Atlas would refuse fails here,\n * naming the principal, rather than as a bare HTTP 400 from the Admin API.\n *\n * spec-cite: https://www.mongodb.com/docs/atlas/security-add-mongodb-roles/ — \"The specified role name can\n * only contain letters, numbers, underscores or hyphens.\" (fetched 2026-09-27). The OpenAPI schema for\n * `UserCustomDBRole.roleName` states no pattern, so the prose page is the authority.\n */\nconst ATLAS_CUSTOM_ROLE_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;\n\n/**\n * MongoDB's privilege action (the vocabulary `buildMinionMongodbPrivileges` speaks, shared with the\n * self-hosted module) → the Atlas Admin API's name for the same action.\n *\n * semantic-literal-boundary: both sides are EXTERNAL vocabularies — MongoDB's `createRole` action names and\n * the Atlas Admin API's `DatabasePrivilegeAction.action` enum — and this table is the one place they meet.\n * spec-cite: Atlas Administration API v1.0 OpenAPI (github.com/mongodb/openapi, `openapi/v1-deprecated/v1.json`),\n * schema `DatabasePrivilegeAction`, enum `action`: `FIND`, `INSERT`, `REMOVE`, `UPDATE` (fetched 2026-09-27).\n *\n * Closed on purpose: an action with no entry is REFUSED rather than dropped (a silently narrower role reads\n * as a working grant until the minion fails) or passed through (a spelling Atlas does not know is a 400 at\n * best). Grants only ever reach Atlas through this table, so nothing can widen them on the way.\n */\nconst ATLAS_PRIVILEGE_ACTION_BY_MONGODB_ACTION: Readonly<Record<string, string>> = {\n find: 'FIND',\n insert: 'INSERT',\n update: 'UPDATE',\n remove: 'REMOVE',\n};\n\nfunction toAtlasPrivileges(privileges: readonly MongodbCollectionPrivilege[]): MongodbCollectionPrivilege[] {\n return privileges.map((privilege) => ({\n resource: privilege.resource,\n actions: privilege.actions.map((action) => {\n const atlasAction = ATLAS_PRIVILEGE_ACTION_BY_MONGODB_ACTION[action];\n if (!atlasAction) {\n throw new Error(\n `MongodbAtlasInfraProviderModule: MongoDB privilege action '${action}' has no Atlas Admin API equivalent `\n + `in ATLAS_PRIVILEGE_ACTION_BY_MONGODB_ACTION. Refusing to mint a role that would silently lack it.`,\n );\n }\n return atlasAction;\n }),\n }));\n}\n\n/** The principal's username and role, checked against Atlas's role-name rule. One derivation for mint and revoke. */\nfunction resolvePrincipalAtlasIdentity(\n applicationNamespace: string,\n principal: ApplicationRuntimePrincipal,\n): { username: string; roleName: string } {\n const username = buildMongodbPrincipalUsername(applicationNamespace, principal);\n // The whole point of this path. `buildMongodbPrincipalUsername` returns the backend's name only for the\n // backend, but this is the one assertion whose failure would hand a minion the backend's user, so it is\n // made here rather than inferred from the helper.\n if (username === buildMongodbPrincipalUsername(applicationNamespace, undefined)) {\n throw new Error(\n `MongodbAtlasInfraProviderModule: principal '${principal.kind}:${principal.name ?? ''}' resolved to the `\n + `application backend's Atlas user '${username}'. Refusing: minting would overwrite it and revoking would delete it.`,\n );\n }\n const roleName = buildAtlasPrincipalRoleName(username);\n if (!ATLAS_CUSTOM_ROLE_NAME_PATTERN.test(roleName)) {\n throw new Error(\n `MongodbAtlasInfraProviderModule: the custom role name '${roleName}' for principal `\n + `'${principal.kind}:${principal.name ?? ''}' is not one Atlas accepts (letters, numbers, underscores or hyphens only).`,\n );\n }\n return { username, roleName };\n}\n\nexport const MongodbAtlasInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.MONGODB_ATLAS,\n supportedCapabilities: [InfraCapability.DOCUMENT_DATABASE],\n perPrincipalSecretBlobPaths: PER_PRINCIPAL_SECRET_BLOB_PATHS,\n\n plan(): InfraProviderPlanContribution {\n return {\n // Atlas is remote-only — no compose service / no K8s manifest.\n // The plan's `externalEndpoints` (in the wider envelope) carry\n // the Atlas host topology; this module's `plan()` covers only\n // admin-API access + per-app secret paths.\n platformAdmin: {\n envVars: {\n // ATLAS_API_BASE_URL is non-secret because it identifies\n // the Atlas API surface (default https://cloud.mongodb.com/api/atlas/v1.0).\n // ATLAS_PROJECT_ID + ATLAS_CLUSTER_NAME are non-secret\n // identifiers — public information about the customer's\n // Atlas project.\n ATLAS_API_BASE_URL: 'https://cloud.mongodb.com/api/atlas/v1.0',\n // PROJECT_ID + CLUSTER_NAME default to authored values; the\n // CLI's env-vars-builder writes them per-env from the\n // operator's `wildo.infra.<env>.config.ts > backingServices.mongodb`.\n ATLAS_PROJECT_ID: '',\n ATLAS_CLUSTER_NAME: 'Cluster0',\n },\n secretEnvVars: ['ATLAS_PUBLIC_KEY', 'ATLAS_PRIVATE_KEY'],\n // Atlas is admin-API only for apps-manager. Companion runs\n // locally against self-managed Mongo, NOT Atlas (no\n // companion consumer for the Atlas variant).\n consumers: [InfraPlatformAdminConsumer.APPS_MANAGER],\n },\n appRuntime: {\n // Static topology for the app pod. The actual host /\n // protocol / options for Atlas connections are derived\n // server-side at runtime from cluster info; the persistence\n // shape mirrors the legacy `_merge_WildoApplicationConfig`\n // mongodb section.\n perAppSecretBlobPaths: [...PER_PRINCIPAL_SECRET_BLOB_PATHS],\n },\n };\n },\n\n async mintAppCredentials(\n context: AppCredentialMintingContext,\n ): Promise<AppCredentialMintingResult> {\n const adminClient = context.adminClient as IMongoAtlasClient;\n const password = context.secretInputs[MONGODB_PASSWORD_INPUT_KEY];\n if (!password) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `secretInputs is missing '${MONGODB_PASSWORD_INPUT_KEY}'. ` +\n `The orchestrator MUST supply the Mongo password — modules are upsert-only.`,\n );\n }\n if (!context.applicationNamespace) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `applicationNamespace is empty. ` +\n `The orchestrator MUST supply a non-empty namespace.`,\n );\n }\n const databaseName = context.applicationConfigInputs?.[DATABASE_NAME_INPUT_KEY];\n if (!databaseName) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `applicationConfigInputs is missing '${DATABASE_NAME_INPUT_KEY}'. ` +\n `The orchestrator MUST supply the per-app database name.`,\n );\n }\n const clusterName = context.applicationConfigInputs?.[CLUSTER_NAME_INPUT_KEY];\n if (!clusterName) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `applicationConfigInputs is missing '${CLUSTER_NAME_INPUT_KEY}'. ` +\n `The orchestrator MUST supply the Atlas cluster name.`,\n );\n }\n\n let username: string;\n let connectionString: string;\n if (isNamedPrincipal(context.principal)) {\n // A named principal gets a COLLECTION-SCOPED user on ONE custom role (#1694) — never the\n // application's `<namespace>_user`, which holds `readWrite` on the whole database.\n //\n // `resourceGrants` is REQUIRED and its absence is an error rather than a default, exactly as in the\n // self-hosted module: falling back to the application-wide upsert would hand a minion `readWrite` on\n // the whole database AND overwrite the backend's password, through a path that looks narrow.\n const grants = context.resourceGrants;\n if (!grants) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: `\n + `principal '${context.principal.kind}:${context.principal.name}' has no resourceGrants. `\n + `Refusing to fall back to the database-wide application user. The orchestrator must pass `\n + `an explicit empty resource grant when only the mandatory runtime floor is required.`,\n );\n }\n const identity = resolvePrincipalAtlasIdentity(context.applicationNamespace, context.principal);\n username = identity.username;\n // Authored declaration + the engine floor, through the SAME derivation the self-hosted and PostgreSQL\n // adapters use, so the three cannot disagree about what every runtime principal needs.\n const databaseGrants = deriveMinionDatabaseGrants(grants);\n ({ connectionString } = await adminClient.upsertCollectionScopedDatabaseUser({\n clusterName,\n databaseName,\n username,\n password,\n roleName: identity.roleName,\n privileges: toAtlasPrivileges(buildMinionMongodbPrivileges({\n databaseName,\n readCollections: resolveGrantStorageNames(databaseGrants.read),\n writeCollections: resolveGrantStorageNames(databaseGrants.write),\n appendCollections: resolveGrantStorageNames(databaseGrants.append),\n maintainCollections: resolveGrantStorageNames(databaseGrants.maintain),\n })),\n }));\n } else {\n username = buildMongodbPrincipalUsername(context.applicationNamespace, context.principal);\n // POST /databaseUsers (with PATCH-fallback) — idempotent upsert.\n // Returns the cluster's connection string (SRV address, or the seed list when it has none) with credentials embedded.\n ({ connectionString } = await adminClient.upsertApplicationDatabase({\n clusterName,\n databaseName,\n username,\n password,\n }));\n }\n\n return {\n secretBlobValues: {\n [MONGODB_USERNAME_PATH]: username,\n // Echo of input password — proves upsert-only.\n [MONGODB_PASSWORD_PATH]: password,\n },\n runtimeArtifacts: {\n // Transient only — orchestrator uses for app-init seeding,\n // does NOT persist.\n [CONNECTION_STRING_ARTIFACT_KEY]: connectionString,\n },\n };\n },\n\n /**\n * Tear down an Atlas database user. Idempotent.\n *\n * **Caller status**: for a runtime principal, apps-manager's declaration reconcile calls this when a\n * minion is removed. For the application backend (and every minion), apps-manager's withdrawal calls it\n * (`deregisterApplication`, #1307): the user is deleted, the database is kept, and `restoreApplication`\n * re-mints the user with the recorded password.\n */\n async revokeAppCredentials(context: AppCredentialMintingContext): Promise<void> {\n if (!context.applicationNamespace) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.revokeAppCredentials: ` +\n `applicationNamespace is empty. ` +\n `The orchestrator MUST supply a non-empty namespace.`,\n );\n }\n const adminClient = context.adminClient as IMongoAtlasClient;\n if (isNamedPrincipal(context.principal)) {\n // The principal's user AND its role, derived through the SAME function the mint uses. Before #1694\n // this derived `<namespace>_user` for every input, so revoking a minion would have deleted the\n // application backend's user — `invariant-call-site-enumeration.md` #18, on the Atlas side.\n await adminClient.dropCollectionScopedDatabaseUser(\n resolvePrincipalAtlasIdentity(context.applicationNamespace, context.principal),\n );\n return;\n }\n await adminClient.deleteDatabaseUser(buildMongodbPrincipalUsername(context.applicationNamespace, context.principal));\n },\n\n // No `mintPlatformServiceCredentials` (D-4).\n};\n"]}
1
+ {"version":3,"file":"mongodb-atlas.infra.module.js","sourceRoot":"","sources":["../../../src/mongodb-atlas/mongodb-atlas.infra.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EACL,+BAA+B,EAI/B,eAAe,EACf,0BAA0B,EAC1B,aAAa,EAGb,0BAA0B,EAC1B,wBAAwB,GAEzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAE9B,MAAM,2CAA2C,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAC1D,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAC1D;;;;;;;GAOG;AACH,MAAM,+BAA+B,GAA0B,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;AAG9G;;;GAGG;AACH,MAAM,0BAA0B,GAAG,2BAA2B,CAAC;AAE/D;;;GAGG;AACH,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAC/C,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,SAAS,gBAAgB,CAAC,SAAkD;IAC1E,OAAO,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,KAAK,+BAA+B,CAAC,mBAAmB,CAAC;AAC3G,CAAC;AAED;;;;;;GAMG;AACH,SAAS,2BAA2B,CAAC,QAAgB;IACnD,OAAO,GAAG,QAAQ,OAAO,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,8BAA8B,GAAG,kBAAkB,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,wCAAwC,GAAqC;IACjF,IAAI,E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AC;YAClC,MAAM,IAAI,KAAK,CACb,wDAAwD;gBACxD,iCAAiC;gBACjC,qDAAqD,CACtD,CAAC;QACJ,CAAC;QACD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAgC,CAAC;QAC7D,IAAI,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACxC,mGAAmG;YACnG,+FAA+F;YAC/F,4FAA4F;YAC5F,MAAM,WAAW,CAAC,gCAAgC,CAChD,6BAA6B,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,CAC/E,CAAC;YACF,OAAO;QACT,CAAC;QACD,MAAM,WAAW,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACvH,CAAC;IAED,6CAA6C;CAC9C,CAAC","sourcesContent":["/**\n * `MongodbAtlasInfraProviderModule` — fourth concrete `InfraProviderModule`\n * (generalizing the RabbitMQ / Redis / PostgreSQL module pattern to MongoDB Atlas).\n *\n * Implements the `MONGODB_ATLAS` `InfraProvider` over the\n * `IMongoAtlasClient` transport (Atlas REST API + digest auth, exposed\n * by `MongoAtlasManagerService` after the Slice 4.B.3 5C policy/\n * transport split). Owns the Atlas naming and grant policy; the USERNAME\n * policy itself is shared with the self-hosted module through\n * `buildMongodbPrincipalUsername` (`<applicationNamespace>_user` for the\n * application backend, `<namespace>_<kind>_<name>_user` for a principal).\n *\n * **What this module reads from `AppCredentialMintingContext`**:\n * - `applicationNamespace` + `principal` — the username source (above).\n * - `secretInputs['database.mongodb.password']` — orchestrator-\n * supplied password (module is upsert-only, never generator).\n * - `applicationConfigInputs['databaseName']` — required, the\n * per-app database name.\n * - `applicationConfigInputs['clusterName']` — required, the Atlas\n * cluster name. apps-manager resolves it once (`resolveAtlasClusterName`)\n * for the application user and every principal user, and a later\n * reconcile reads back the cluster recorded at registration.\n * - `resourceGrants` — required for a named principal: its declared\n * access, to which the engine floor is added here.\n * - `adminClient` — narrowed to `IMongoAtlasClient`.\n *\n * **Two audiences this module serves:**\n *\n * 1. **Audience-1 (platform-admin)**: Atlas API public/private key\n * pair + project id + base URL. Consumers: `apps-manager` only\n * (companion uses self-managed locally; Atlas is remote-only).\n *\n * 2. **Audience-3 (app-scoped, via `mintAppCredentials`)**:\n * per-customer-app Atlas database user. Result threaded into\n * `Wildo_Application_Secrets.database.mongodb.{username,password}`\n * via `_merge_WildoApplicationSecrets`; the cluster's connection\n * string (its SRV address, or the `mongoURIWithOptions` seed list\n * when it has none, #1969) returned via `runtimeArtifacts.connectionString` for\n * transient app-init operations (NOT persisted — the persistence\n * shape is split between config (host/protocol/options/database)\n * and secrets (username/password)).\n *\n * **NOT served (D-4 of Slice 4.B locked decisions, 2026-05-10)**:\n * - **Audience-2 (platform-service-scoped)**: no platform service\n * uses Atlas for inter-service messaging today. Method omitted.\n *\n * **`revokeAppCredentials`**: for a runtime principal, apps-manager's\n * declaration reconcile calls it when a minion is removed. For the application\n * backend, apps-manager calls it when the application is withdrawn from the\n * platform (`deregisterApplication`, #1307): the database user is deleted and\n * the database is kept, so `restoreApplication` can re-mint it.\n *\n * **Runtime principals (minions), #1694**: each gets its OWN Atlas database\n * user holding ONE Atlas custom database role — the Atlas twin of the\n * self-hosted module's collection-scoped user:\n * - the username comes from `buildMongodbPrincipalUsername`, the SAME\n * derivation the self-hosted module uses, so it can never be the backend's\n * `<namespace>_user`, and the mint and the revoke cannot disagree about it;\n * - the role carries the principal's declared `resourceAccess` PLUS the engine\n * execution-history floor every enabled Node minion needs, derived through\n * `deriveMinionDatabaseGrants` → `buildMinionMongodbPrivileges`, the same\n * pair the self-hosted module uses, then translated into Atlas's action names;\n * - the user is scoped to the application's cluster alone;\n * - revoking deletes that user and that role, and nothing else.\n *\n * Before #1694 the module ignored `principal` and derived `<namespace>_user`\n * for every input, so a minion mint would have overwritten the backend's user\n * and a minion revoke would have deleted it; apps-manager refused the\n * combination at registration instead.\n */\n\nimport {\n ApplicationRuntimePrincipalKind,\n AppCredentialMintingContext,\n AppCredentialMintingResult,\n IMongoAtlasClient,\n InfraCapability,\n InfraPlatformAdminConsumer,\n InfraProvider,\n InfraProviderModule,\n InfraProviderPlanContribution,\n deriveMinionDatabaseGrants,\n resolveGrantStorageNames,\n type ApplicationRuntimePrincipal,\n} from '@wildo-ai/platform-config-lib';\nimport {\n buildMinionMongodbPrivileges,\n buildMongodbPrincipalUsername,\n type MongodbCollectionPrivilege,\n} from '../mongodb-self/mongodb-self.infra.module';\n\n/**\n * The `Wildo_Application_Secrets` JSON paths this module writes\n * through `mintAppCredentials.secretBlobValues`. Declared once and\n * reused as `appRuntime.perAppSecretBlobPaths` in `plan()` AND as\n * the keys of the result, so a refactor that renames a path fails\n * loudly at one place.\n */\nconst MONGODB_USERNAME_PATH = 'database.mongodb.username';\nconst MONGODB_PASSWORD_PATH = 'database.mongodb.password';\n/**\n * The paths this module mints PER RUNTIME PRINCIPAL — the single source for both consumers.\n *\n * Read by `InfraProviderModule.perPrincipalSecretBlobPaths` (statically, so apps-manager can strip\n * these from the application blob before delivering a principal's own material) AND spread into\n * `appRuntime.perAppSecretBlobPaths` inside `plan()`. Declaring the list twice is how the delivery\n * path would silently stop covering a path this module still mints.\n */\nconst PER_PRINCIPAL_SECRET_BLOB_PATHS: ReadonlyArray<string> = [MONGODB_USERNAME_PATH, MONGODB_PASSWORD_PATH];\n\n\n/**\n * Key the module looks for in `secretInputs` for the orchestrator-\n * supplied password.\n */\nconst MONGODB_PASSWORD_INPUT_KEY = 'database.mongodb.password';\n\n/**\n * Required keys in `applicationConfigInputs`. The orchestrator\n * derives both before calling `mintAppCredentials`.\n */\nconst DATABASE_NAME_INPUT_KEY = 'databaseName';\nconst CLUSTER_NAME_INPUT_KEY = 'clusterName';\n\n/**\n * Key in `runtimeArtifacts` carrying the cluster's connection string — its SRV\n * address, or the `mongoURIWithOptions` seed list when it has none (#1969) — with\n * credentials embedded. Exposed for orchestrator transient use\n * (app-init seeding); deliberately NOT persisted.\n */\nconst CONNECTION_STRING_ARTIFACT_KEY = 'connectionString';\n\n/**\n * A named runtime principal (a minion) — anything but the application backend, which keeps the\n * application-level `<namespace>_user` and its database-wide role.\n */\nfunction isNamedPrincipal(principal: ApplicationRuntimePrincipal | undefined): principal is ApplicationRuntimePrincipal {\n return principal !== undefined && principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND;\n}\n\n/**\n * The Atlas custom role a principal's user holds — derived from the principal's username exactly as the\n * self-hosted module derives its role (`<username>_role`), so the mint and the revoke name the same role.\n *\n * Custom roles are PROJECT-wide in Atlas, not per database or cluster, so the name must be unique across\n * every application the project hosts. It is: the username embeds the application namespace.\n */\nfunction buildAtlasPrincipalRoleName(username: string): string {\n return `${username}_role`;\n}\n\n/**\n * Atlas's rule for a custom role name, checked before any request so a name Atlas would refuse fails here,\n * naming the principal, rather than as a bare HTTP 400 from the Admin API.\n *\n * spec-cite: https://www.mongodb.com/docs/atlas/security-add-mongodb-roles/ — \"The specified role name can\n * only contain letters, numbers, underscores or hyphens.\" (fetched 2026-09-27). The OpenAPI schema for\n * `UserCustomDBRole.roleName` states no pattern, so the prose page is the authority.\n */\nconst ATLAS_CUSTOM_ROLE_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;\n\n/**\n * MongoDB's privilege action (the vocabulary `buildMinionMongodbPrivileges` speaks, shared with the\n * self-hosted module) → the Atlas Admin API's name for the same action.\n *\n * semantic-literal-boundary: both sides are EXTERNAL vocabularies — MongoDB's `createRole` action names and\n * the Atlas Admin API's `DatabasePrivilegeAction.action` enum — and this table is the one place they meet.\n * spec-cite: Atlas Administration API v1.0 OpenAPI (github.com/mongodb/openapi, `openapi/v1-deprecated/v1.json`),\n * schema `DatabasePrivilegeAction`, enum `action`: `FIND`, `INSERT`, `REMOVE`, `UPDATE` (fetched 2026-09-27).\n *\n * Closed on purpose: an action with no entry is REFUSED rather than dropped (a silently narrower role reads\n * as a working grant until the minion fails) or passed through (a spelling Atlas does not know is a 400 at\n * best). Grants only ever reach Atlas through this table, so nothing can widen them on the way.\n */\nconst ATLAS_PRIVILEGE_ACTION_BY_MONGODB_ACTION: Readonly<Record<string, string>> = {\n find: 'FIND',\n insert: 'INSERT',\n update: 'UPDATE',\n remove: 'REMOVE',\n};\n\nfunction toAtlasPrivileges(privileges: readonly MongodbCollectionPrivilege[]): MongodbCollectionPrivilege[] {\n return privileges.map((privilege) => ({\n resource: privilege.resource,\n actions: privilege.actions.map((action) => {\n const atlasAction = ATLAS_PRIVILEGE_ACTION_BY_MONGODB_ACTION[action];\n if (!atlasAction) {\n throw new Error(\n `MongodbAtlasInfraProviderModule: MongoDB privilege action '${action}' has no Atlas Admin API equivalent `\n + `in ATLAS_PRIVILEGE_ACTION_BY_MONGODB_ACTION. Refusing to mint a role that would silently lack it.`,\n );\n }\n return atlasAction;\n }),\n }));\n}\n\n/** The principal's username and role, checked against Atlas's role-name rule. One derivation for mint and revoke. */\nfunction resolvePrincipalAtlasIdentity(\n applicationNamespace: string,\n principal: ApplicationRuntimePrincipal,\n): { username: string; roleName: string } {\n const username = buildMongodbPrincipalUsername(applicationNamespace, principal);\n // The whole point of this path. `buildMongodbPrincipalUsername` returns the backend's name only for the\n // backend, but this is the one assertion whose failure would hand a minion the backend's user, so it is\n // made here rather than inferred from the helper.\n if (username === buildMongodbPrincipalUsername(applicationNamespace, undefined)) {\n throw new Error(\n `MongodbAtlasInfraProviderModule: principal '${principal.kind}:${principal.name ?? ''}' resolved to the `\n + `application backend's Atlas user '${username}'. Refusing: minting would overwrite it and revoking would delete it.`,\n );\n }\n const roleName = buildAtlasPrincipalRoleName(username);\n if (!ATLAS_CUSTOM_ROLE_NAME_PATTERN.test(roleName)) {\n throw new Error(\n `MongodbAtlasInfraProviderModule: the custom role name '${roleName}' for principal `\n + `'${principal.kind}:${principal.name ?? ''}' is not one Atlas accepts (letters, numbers, underscores or hyphens only).`,\n );\n }\n return { username, roleName };\n}\n\nexport const MongodbAtlasInfraProviderModule: InfraProviderModule = {\n provider: InfraProvider.MONGODB_ATLAS,\n supportedCapabilities: [InfraCapability.DOCUMENT_DATABASE],\n perPrincipalSecretBlobPaths: PER_PRINCIPAL_SECRET_BLOB_PATHS,\n\n plan(): InfraProviderPlanContribution {\n return {\n // Atlas is remote-only — no compose service / no K8s manifest.\n // The plan's `externalEndpoints` (in the wider envelope) carry\n // the Atlas host topology; this module's `plan()` covers only\n // admin-API access + per-app secret paths.\n platformAdmin: {\n envVars: {\n // ATLAS_API_BASE_URL is non-secret because it identifies\n // the Atlas API surface (default https://cloud.mongodb.com/api/atlas/v1.0).\n // ATLAS_PROJECT_ID + ATLAS_CLUSTER_NAME are non-secret\n // identifiers — public information about the customer's\n // Atlas project.\n ATLAS_API_BASE_URL: 'https://cloud.mongodb.com/api/atlas/v1.0',\n // PROJECT_ID + CLUSTER_NAME default to authored values; the\n // CLI's env-vars-builder writes them per-env from the\n // operator's `wildo.infra.<env>.config.ts > backingServices.mongodb`.\n ATLAS_PROJECT_ID: '',\n ATLAS_CLUSTER_NAME: 'Cluster0',\n },\n secretEnvVars: ['ATLAS_PUBLIC_KEY', 'ATLAS_PRIVATE_KEY'],\n // Atlas is admin-API only for apps-manager. Companion runs\n // locally against self-managed Mongo, NOT Atlas (no\n // companion consumer for the Atlas variant).\n consumers: [InfraPlatformAdminConsumer.APPS_MANAGER],\n },\n appRuntime: {\n // Static topology for the app pod. The actual host /\n // protocol / options for Atlas connections are derived\n // server-side at runtime from cluster info; the persistence\n // shape mirrors the legacy `_merge_WildoApplicationConfig`\n // mongodb section.\n perAppSecretBlobPaths: [...PER_PRINCIPAL_SECRET_BLOB_PATHS],\n },\n };\n },\n\n async mintAppCredentials(\n context: AppCredentialMintingContext,\n ): Promise<AppCredentialMintingResult> {\n const adminClient = context.adminClient as IMongoAtlasClient;\n const password = context.secretInputs[MONGODB_PASSWORD_INPUT_KEY];\n if (!password) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `secretInputs is missing '${MONGODB_PASSWORD_INPUT_KEY}'. ` +\n `The orchestrator MUST supply the Mongo password — modules are upsert-only.`,\n );\n }\n if (!context.applicationNamespace) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `applicationNamespace is empty. ` +\n `The orchestrator MUST supply a non-empty namespace.`,\n );\n }\n const databaseName = context.applicationConfigInputs?.[DATABASE_NAME_INPUT_KEY];\n if (!databaseName) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `applicationConfigInputs is missing '${DATABASE_NAME_INPUT_KEY}'. ` +\n `The orchestrator MUST supply the per-app database name.`,\n );\n }\n const clusterName = context.applicationConfigInputs?.[CLUSTER_NAME_INPUT_KEY];\n if (!clusterName) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: ` +\n `applicationConfigInputs is missing '${CLUSTER_NAME_INPUT_KEY}'. ` +\n `The orchestrator MUST supply the Atlas cluster name.`,\n );\n }\n\n let username: string;\n let connectionString: string;\n if (isNamedPrincipal(context.principal)) {\n // A named principal gets a COLLECTION-SCOPED user on ONE custom role (#1694) — never the\n // application's `<namespace>_user`, which holds `readWrite` on the whole database.\n //\n // `resourceGrants` is REQUIRED and its absence is an error rather than a default, exactly as in the\n // self-hosted module: falling back to the application-wide upsert would hand a minion `readWrite` on\n // the whole database AND overwrite the backend's password, through a path that looks narrow.\n const grants = context.resourceGrants;\n if (!grants) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.mintAppCredentials: `\n + `principal '${context.principal.kind}:${context.principal.name}' has no resourceGrants. `\n + `Refusing to fall back to the database-wide application user. The orchestrator must pass `\n + `an explicit empty resource grant when only the mandatory runtime floor is required.`,\n );\n }\n const identity = resolvePrincipalAtlasIdentity(context.applicationNamespace, context.principal);\n username = identity.username;\n // Authored declaration + the engine floor, through the SAME derivation the self-hosted and PostgreSQL\n // adapters use, so the three cannot disagree about what every runtime principal needs.\n const databaseGrants = deriveMinionDatabaseGrants(grants);\n ({ connectionString } = await adminClient.upsertCollectionScopedDatabaseUser({\n clusterName,\n databaseName,\n username,\n password,\n roleName: identity.roleName,\n privileges: toAtlasPrivileges(buildMinionMongodbPrivileges({\n databaseName,\n readCollections: resolveGrantStorageNames(databaseGrants.read),\n writeCollections: resolveGrantStorageNames(databaseGrants.write),\n appendCollections: resolveGrantStorageNames(databaseGrants.append),\n maintainCollections: resolveGrantStorageNames(databaseGrants.maintain),\n })),\n }));\n } else {\n username = buildMongodbPrincipalUsername(context.applicationNamespace, context.principal);\n // POST /databaseUsers (with PATCH-fallback) — idempotent upsert.\n // Returns the cluster's connection string (SRV address, or the seed list when it has none) with credentials embedded.\n ({ connectionString } = await adminClient.upsertApplicationDatabase({\n clusterName,\n databaseName,\n username,\n password,\n }));\n }\n\n return {\n secretBlobValues: {\n [MONGODB_USERNAME_PATH]: username,\n // Echo of input password — proves upsert-only.\n [MONGODB_PASSWORD_PATH]: password,\n },\n runtimeArtifacts: {\n // Transient only — orchestrator uses for app-init seeding,\n // does NOT persist.\n [CONNECTION_STRING_ARTIFACT_KEY]: connectionString,\n },\n };\n },\n\n /**\n * Tear down an Atlas database user. Idempotent.\n *\n * **Caller status**: for a runtime principal, apps-manager's declaration reconcile calls this when a\n * minion is removed. For the application backend (and every minion), apps-manager's withdrawal calls it\n * (`deregisterApplication`, #1307): the user is deleted, the database is kept, and `restoreApplication`\n * re-mints the user with the recorded password.\n */\n async revokeAppCredentials(context: AppCredentialMintingContext): Promise<void> {\n if (!context.applicationNamespace) {\n throw new Error(\n `MongodbAtlasInfraProviderModule.revokeAppCredentials: ` +\n `applicationNamespace is empty. ` +\n `The orchestrator MUST supply a non-empty namespace.`,\n );\n }\n const adminClient = context.adminClient as IMongoAtlasClient;\n if (isNamedPrincipal(context.principal)) {\n // The principal's user AND its role, derived through the SAME function the mint uses. Before #1694\n // this derived `<namespace>_user` for every input, so revoking a minion would have deleted the\n // application backend's user — `invariant-call-site-enumeration.md` #18, on the Atlas side.\n await adminClient.dropCollectionScopedDatabaseUser(\n resolvePrincipalAtlasIdentity(context.applicationNamespace, context.principal),\n );\n return;\n }\n await adminClient.deleteDatabaseUser(buildMongodbPrincipalUsername(context.applicationNamespace, context.principal));\n },\n\n // No `mintPlatformServiceCredentials` (D-4).\n};\n"]}