@wildo-ai/platform-config-lib 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts +24 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +25 -0
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +117 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +63 -4
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +24 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +24 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
- package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts +29 -0
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js +39 -0
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts +40 -0
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -0
- package/dist/esm/lockfile/build-parallelism.js +64 -0
- package/dist/esm/lockfile/build-parallelism.js.map +1 -0
- package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +17 -3
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +28 -7
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +24 -11
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +886 -29
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +395 -16
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +1 -2
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +142 -25
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +229 -26
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts +59 -0
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -0
- package/dist/esm/project-config/hosted-infra-env-config.js +187 -0
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -0
- package/dist/esm/project-config/index.d.ts +6 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +6 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts +35 -0
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +148 -8
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts +23 -0
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
- package/dist/esm/project-config/npm-version-range.js +175 -0
- package/dist/esm/project-config/npm-version-range.js.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts +288 -30
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +795 -46
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +192 -20
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +381 -42
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +14 -35
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js +14 -35
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
- package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +66 -66
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +75 -67
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js +41 -2
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +11 -12
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +11 -12
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +152 -12
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +186 -9
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +185 -10
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -3
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +77 -47
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +114 -52
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts +50 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js +57 -0
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +35 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.js +37 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +81 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js +74 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -0
- package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
- package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
- package/dist/esm/project-config/static-asset-import-noop.js +49 -0
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
- package/dist/esm/registry/artifact-domain.schemas.d.ts +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
- package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
- package/dist/esm/registry/companion-api.schemas.js.map +0 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/index.d.ts +3 -1
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +3 -1
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts +31 -0
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
- package/dist/esm/registry/local-checkout-source.js +45 -0
- package/dist/esm/registry/local-checkout-source.js.map +1 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.js +36 -0
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +403 -23
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +502 -60
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts +80 -0
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
- package/dist/esm/registry/module-search.schemas.js +112 -0
- package/dist/esm/registry/module-search.schemas.js.map +1 -0
- package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-config.schemas.js +8 -0
- package/dist/esm/registry/registry-config.schemas.js.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts +126 -2
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +183 -14
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
- package/dist/esm/registry/registry-keys.schemas.js +68 -0
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
- package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +12 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +14 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +17 -14
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js +8 -7
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +15 -6
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js +23 -9
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/package.json +7 -7
- package/dist/esm/registry/companion-api.schemas.js +0 -165
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;IAChC;;;;;;;;;OASG;;IAEH;;;;;;OAMG;;kBAEH,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -10,9 +10,9 @@ import { z } from 'zod';
|
|
|
10
10
|
* refreshTokenExpirationDays}`. The runtime backend reads them at
|
|
11
11
|
* token-sign time (`auth-token-issuer.backend.service.ts`,
|
|
12
12
|
* `jwt.backend.service.ts`).
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* - First registration uses the schema defaults when `serviceAuth` is absent. Ordinary
|
|
14
|
+
* re-registration preserves the stored policy when the whole block is omitted. A present
|
|
15
|
+
* block resolves omitted members through these defaults and reconciles both lifetimes.
|
|
16
16
|
*
|
|
17
17
|
* Default tightening (Auth-hardening Slice A Step 5, 2026-04-13):
|
|
18
18
|
* - `accessTokenExpirationMinutes` default was lowered from 60 \u2192 15 in
|
|
@@ -35,39 +35,18 @@ import { z } from 'zod';
|
|
|
35
35
|
* `platform-services-to-manager.apps-manager.platform.controller.ts`).
|
|
36
36
|
* Authoring an algorithm here would add a knob with no honest consumer.
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
* - The CLI forwards
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* -
|
|
46
|
-
*
|
|
38
|
+
* Publication lifecycle:
|
|
39
|
+
* - The CLI forwards `env.serviceAuth` through the admin initialization request. Existing
|
|
40
|
+
* applications reconcile an explicitly supplied policy even when no other settings changed;
|
|
41
|
+
* no broad initialization override is required for a token-lifetime-only change.
|
|
42
|
+
* - Ordinary initialization with an omitted block preserves existing lifetimes, including
|
|
43
|
+
* incidental public-key/database repairs. Explicit `override:true` retains its wider reset
|
|
44
|
+
* semantics: absent `serviceAuth` resets lifetimes to the schema defaults below.
|
|
45
|
+
* - Applications retrieve the persisted policy at startup. Running processes do not receive
|
|
46
|
+
* live policy updates, and existing tokens retain the expiration already encoded in them.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* `_merge_WildoApplicationConfig(currentConfig=null, newConfig={})`,
|
|
51
|
-
* which reduces to "return the freshly-built `defaultConfig`". The
|
|
52
|
-
* `defaultConfig` is seeded by `_getDefault_WildoApplicationConfig`
|
|
53
|
-
* with `WildoAuthConfigSchema.parse(serviceAuth ?? {})`. So when an
|
|
54
|
-
* older CLI or a direct HTTP caller omits `serviceAuth` AND passes
|
|
55
|
-
* `override:true`, the persisted TTLs are RESET to the schema
|
|
56
|
-
* defaults below (60 min / 30 days) \u2014 they are NOT preserved. The
|
|
57
|
-
* only path that preserves the persisted TTLs is `override:false`,
|
|
58
|
-
* where the upstream guard at
|
|
59
|
-
* `wildo-application-lifecycle.apps-manager.platform.service.ts:~869`
|
|
60
|
-
* skips the `repository.update` call entirely.
|
|
61
|
-
* - Caveat: that upstream guard ALSO triggers `repository.update` on
|
|
62
|
-
* `needsPublicKeyUpdate` and `needsDatabaseConfigUpdate` (e.g. JWT
|
|
63
|
-
* key rotation, k8s host hydration). When either bypass fires with
|
|
64
|
-
* `override:false` AND `serviceAuth` omitted, the persisted TTLs
|
|
65
|
-
* silently rebind to the schema defaults too. See the JSDoc on
|
|
66
|
-
* `_merge_WildoApplicationConfig` for the full enumeration.
|
|
67
|
-
*
|
|
68
|
-
* Pinned by `wildo-application-lifecycle.defaults.test.ts` (production
|
|
69
|
-
* shape: `(null, {})` + omitted `serviceAuth` returns 15/30 from
|
|
70
|
-
* `WildoAuthConfigSchema.parse({})`).
|
|
48
|
+
* Pinned by `managed-token-policy-convergence.apps-manager.platform.test.ts` and the lifecycle
|
|
49
|
+
* default derivation tests; the former exercises persistence and the bootstrap consumer offline.
|
|
71
50
|
*/
|
|
72
51
|
/**
|
|
73
52
|
* `z.strictObject` (Zod 4) is intentional: any unknown key (e.g. a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"auth.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD;;;;;;;;;OASG;IACH,4BAA4B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACrE;;;;;;OAMG;IACH,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACpE,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Authored JWT TTL policy block for `wildo.infra.<env>.config.ts`.\n *\n * Source-of-truth contract (Slice 3.3, F-24):\n * - `accessTokenExpirationMinutes` and `refreshTokenExpirationDays` are\n * threaded by the CLI through the apps-manager init endpoint\n * (`AdminAppInitializeRequest.serviceAuth`) into\n * `Wildo_Application_Config.jwt.{accessTokenExpirationMinutes,\n * refreshTokenExpirationDays}`. The runtime backend reads them at\n * token-sign time (`auth-token-issuer.backend.service.ts`,\n * `jwt.backend.service.ts`).\n * - First registration uses the schema defaults when `serviceAuth` is absent. Ordinary\n * re-registration preserves the stored policy when the whole block is omitted. A present\n * block resolves omitted members through these defaults and reconciles both lifetimes.\n *\n * Default tightening (Auth-hardening Slice A Step 5, 2026-04-13):\n * - `accessTokenExpirationMinutes` default was lowered from 60 \\u2192 15 in\n * conjunction with the cookie migration (Slice A Steps 2 + 3). With the\n * refresh token now confined to an `HttpOnly` cookie, an XSS bug only\n * exposes the SHORT-lived access token; the smaller the access-token\n * window, the smaller the residual XSS-stolen-token blast radius.\n * Operator overrides via `serviceAuth.accessTokenExpirationMinutes` in\n * `wildo.infra.<env>.config.ts` are untouched \\u2014 author a value to\n * deviate from the framework recommendation. The refresh-token TTL\n * (`refreshTokenExpirationDays`) is unchanged at 30 days because the\n * cookie-confined refresh token does not benefit from an additional\n * TTL squeeze (rotation + JTI blacklist + reuse detection already bound\n * the steal window per use).\n *\n * Algorithm selection is intentionally NOT authored here: the application\n * JWT signing path (`jwt.backend.service.ts`) selects per the per-service\n * key convention, and the apps-manager response-signer pins ES256 for the\n * config-handshake envelope (anti-replay, see F-55 JSDoc on\n * `platform-services-to-manager.apps-manager.platform.controller.ts`).\n * Authoring an algorithm here would add a knob with no honest consumer.\n *\n * Publication lifecycle:\n * - The CLI forwards `env.serviceAuth` through the admin initialization request. Existing\n * applications reconcile an explicitly supplied policy even when no other settings changed;\n * no broad initialization override is required for a token-lifetime-only change.\n * - Ordinary initialization with an omitted block preserves existing lifetimes, including\n * incidental public-key/database repairs. Explicit `override:true` retains its wider reset\n * semantics: absent `serviceAuth` resets lifetimes to the schema defaults below.\n * - Applications retrieve the persisted policy at startup. Running processes do not receive\n * live policy updates, and existing tokens retain the expiration already encoded in them.\n *\n * Pinned by `managed-token-policy-convergence.apps-manager.platform.test.ts` and the lifecycle\n * default derivation tests; the former exercises persistence and the bootstrap consumer offline.\n */\n/**\n * `z.strictObject` (Zod 4) is intentional: any unknown key (e.g. a\n * re-introduced `jwtAlgorithm`, or a typo'd `accessTokenExpirationMinute`)\n * must surface as a parse error instead of being silently stripped. This\n * is the framework-mindset enforcement of the \"no honest consumer => no\n * authored knob\" rule documented in the file-level JSDoc above.\n */\nexport const WildoAuthConfigSchema = z.strictObject({\n /**\n * Access-token TTL in minutes. Authored value > schema default (15).\n * Threaded into `Wildo_Application_Config.jwt.accessTokenExpiration\n * Minutes` at apps-manager init time; consumed at token-sign time by\n * `AuthTokenIssuerBackendService.issueAccessToken`.\n *\n * Default = 15 (Auth-hardening Slice A Step 5, 2026-04-13). Pre-Slice-A\n * the default was 60 \\u2014 the file-level JSDoc above documents the\n * threat-model rationale for the tightening.\n */\n accessTokenExpirationMinutes: z.number().int().positive().default(15),\n /**\n * Refresh-token TTL in days. Authored value > schema default (30).\n * Threaded into `Wildo_Application_Config.jwt.refreshTokenExpiration\n * Days` at apps-manager init time; consumed at token-sign time by\n * `JwtBackendService.createRefreshToken` and at session-bookkeeping\n * time by `AuthTokenIssuerBackendService.invalidateAllTokensForUser`.\n */\n refreshTokenExpirationDays: z.number().int().positive().default(30),\n});\nexport type WildoAuthConfig = z.infer<typeof WildoAuthConfigSchema>;\nexport type WildoAuthConfigInput = z.input<typeof WildoAuthConfigSchema>;\n"]}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { BackingServiceKind, BackingServiceSource, type BackingServicesEnvConfig } from './backing-services.schemas';
|
|
2
|
+
import { InfraProvider } from './infra-providers.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Is a `backingServices` declaration one the platform can actually SERVE?
|
|
5
|
+
*
|
|
6
|
+
* ## The defect this closes (#1693)
|
|
7
|
+
*
|
|
8
|
+
* A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve
|
|
9
|
+
* nothing, and both passed `wildo config sync` and `wildo lock check` in silence:
|
|
10
|
+
*
|
|
11
|
+
* 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other
|
|
12
|
+
* than `'atlas'`. The lockfile materializer skipped the kind without a word.
|
|
13
|
+
* 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no
|
|
14
|
+
* module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer
|
|
15
|
+
* fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.
|
|
16
|
+
*
|
|
17
|
+
* Neither "provisions nothing". The generators honour `source`, so a MANAGED cache gets no
|
|
18
|
+
* self-hosted workload — while apps-manager, which named its modules and was never told the
|
|
19
|
+
* declaration, minted the application's credential on the PLATFORM's own server. The application
|
|
20
|
+
* received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches
|
|
21
|
+
* on the declared provider and refuses one it cannot serve
|
|
22
|
+
* ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same
|
|
23
|
+
* declarations before they reach it.
|
|
24
|
+
*
|
|
25
|
+
* ## Why the servable set is an INPUT here, not computed here
|
|
26
|
+
*
|
|
27
|
+
* Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),
|
|
28
|
+
* and that package depends on this one — never the reverse. So the catalogue derives the set
|
|
29
|
+
* (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,
|
|
30
|
+
* so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which
|
|
31
|
+
* declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,
|
|
32
|
+
* which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}
|
|
33
|
+
* directly.
|
|
34
|
+
*
|
|
35
|
+
* ## No opt-out, deliberately
|
|
36
|
+
*
|
|
37
|
+
* An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken
|
|
38
|
+
* configuration representable, which is exactly a setting that looks like a control and does
|
|
39
|
+
* nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.
|
|
40
|
+
*/
|
|
41
|
+
/** Why a declaration cannot be served. */
|
|
42
|
+
export declare enum BackingServiceUnservableReason {
|
|
43
|
+
/** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */
|
|
44
|
+
NO_PROVIDER = "no-provider",
|
|
45
|
+
/**
|
|
46
|
+
* It names a catalogue entry, but no provider module serves that entry — either none exists, or the
|
|
47
|
+
* one that exists declares `unservableReason`.
|
|
48
|
+
*/
|
|
49
|
+
NO_SERVING_MODULE = "no-serving-module",
|
|
50
|
+
/**
|
|
51
|
+
* A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas
|
|
52
|
+
* declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with
|
|
53
|
+
* no PostgreSQL admin (#1692).
|
|
54
|
+
*
|
|
55
|
+
* Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one
|
|
56
|
+
* platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)
|
|
57
|
+
* never produce it. apps-manager refuses the registration rather than minting on another provider — a
|
|
58
|
+
* substitution would hand the application a credential for a server it does not connect to.
|
|
59
|
+
*/
|
|
60
|
+
NOT_HELD_BY_PLATFORM = "not-held-by-platform"
|
|
61
|
+
}
|
|
62
|
+
/** The authored half of a backing-service entry that decides which provider it names. */
|
|
63
|
+
export interface BackingServiceProviderSelection {
|
|
64
|
+
source: BackingServiceSource;
|
|
65
|
+
/** The brand, when the kind distinguishes several. See `resolveInfraProvider` for the vocabulary. */
|
|
66
|
+
provider?: string;
|
|
67
|
+
}
|
|
68
|
+
/** The simplest authored declaration that selects one catalogue entry. */
|
|
69
|
+
export interface InfraProviderCanonicalDeclaration extends BackingServiceProviderSelection {
|
|
70
|
+
kind: BackingServiceKind;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of
|
|
74
|
+
* `resolveInfraProvider`, used to tell an author what they may write instead.
|
|
75
|
+
*
|
|
76
|
+
* Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error
|
|
77
|
+
* here until someone states how it is declared. That the inverse is truthful is pinned by a test that
|
|
78
|
+
* resolves every row back through `resolveInfraProvider`; it is never trusted by construction.
|
|
79
|
+
*/
|
|
80
|
+
export declare const INFRA_PROVIDER_CANONICAL_DECLARATIONS: Readonly<Record<InfraProvider, InfraProviderCanonicalDeclaration>>;
|
|
81
|
+
/** One declaration the platform cannot serve, with everything the refusal message needs. */
|
|
82
|
+
export interface UnservableBackingServiceDeclaration {
|
|
83
|
+
envName: string;
|
|
84
|
+
kind: BackingServiceKind;
|
|
85
|
+
declared: BackingServiceProviderSelection;
|
|
86
|
+
reason: BackingServiceUnservableReason;
|
|
87
|
+
/** The catalogue entry it names, when it names one (`NO_SERVING_MODULE`). */
|
|
88
|
+
resolvedProvider?: InfraProvider;
|
|
89
|
+
/** The simplest servable declarations for the same kind — what the author may write instead. */
|
|
90
|
+
servableAlternatives: ReadonlyArray<BackingServiceProviderSelection>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The servable declarations for one kind, one per servable provider, in catalogue order.
|
|
94
|
+
*
|
|
95
|
+
* Empty when nothing can serve the kind — then the only servable choice is not to declare it.
|
|
96
|
+
*/
|
|
97
|
+
export declare function servableBackingServiceDeclarations(kind: BackingServiceKind, servableProviders: ReadonlySet<InfraProvider>): ReadonlyArray<BackingServiceProviderSelection>;
|
|
98
|
+
/**
|
|
99
|
+
* Every declaration in one environment that the platform cannot serve. Empty means every declared
|
|
100
|
+
* kind resolves to a provider in `servableProviders`.
|
|
101
|
+
*
|
|
102
|
+
* Pure. `servableProviders` comes from `collectServableInfraProviders()` in
|
|
103
|
+
* `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.
|
|
104
|
+
*/
|
|
105
|
+
export declare function findUnservableBackingServiceDeclarations(input: {
|
|
106
|
+
envName: string;
|
|
107
|
+
backingServices: BackingServicesEnvConfig | undefined;
|
|
108
|
+
servableProviders: ReadonlySet<InfraProvider>;
|
|
109
|
+
}): UnservableBackingServiceDeclaration[];
|
|
110
|
+
/**
|
|
111
|
+
* The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of
|
|
112
|
+
* the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).
|
|
113
|
+
*
|
|
114
|
+
* Two sets, because they answer different questions:
|
|
115
|
+
*
|
|
116
|
+
* - `catalogueServableProviders` — what the provider-module catalogue can serve at all
|
|
117
|
+
* (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the
|
|
118
|
+
* catalogue refuses is refused here too, even if an older CLI let it through.
|
|
119
|
+
* - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a
|
|
120
|
+
* provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds
|
|
121
|
+
* apps-manager mints a credential on for THIS application: an environment's declaration also names stores
|
|
122
|
+
* only the platform uses, and refusing an application over an admin client it would never use would be a
|
|
123
|
+
* refusal with nothing behind it.
|
|
124
|
+
*
|
|
125
|
+
* A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not
|
|
126
|
+
* is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform
|
|
127
|
+
* can serve, because that is what the author can actually switch to here.
|
|
128
|
+
*
|
|
129
|
+
* Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous
|
|
130
|
+
* behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).
|
|
131
|
+
*/
|
|
132
|
+
export declare function findBackingServiceDeclarationsThePlatformCannotServe(input: {
|
|
133
|
+
envName: string;
|
|
134
|
+
declaredProviders: Partial<Record<BackingServiceKind, BackingServiceProviderSelection>> | undefined;
|
|
135
|
+
mintedKinds: ReadonlySet<BackingServiceKind>;
|
|
136
|
+
catalogueServableProviders: ReadonlySet<InfraProvider>;
|
|
137
|
+
platformServableProviders: ReadonlySet<InfraProvider>;
|
|
138
|
+
}): UnservableBackingServiceDeclaration[];
|
|
139
|
+
/**
|
|
140
|
+
* One line per finding: the environment, the kind, what was declared, why it cannot be served, and
|
|
141
|
+
* the declarations that ARE servable for that kind. Shared by every caller so the wording is one.
|
|
142
|
+
*/
|
|
143
|
+
export declare function describeUnservableBackingServiceDeclaration(finding: UnservableBackingServiceDeclaration): string;
|
|
144
|
+
/** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */
|
|
145
|
+
export declare class UnservableBackingServiceDeclarationError extends Error {
|
|
146
|
+
readonly findings: ReadonlyArray<UnservableBackingServiceDeclaration>;
|
|
147
|
+
constructor(findings: ReadonlyArray<UnservableBackingServiceDeclaration>);
|
|
148
|
+
}
|
|
149
|
+
/** Refuse, naming every unservable declaration across every environment at once. */
|
|
150
|
+
export declare function assertBackingServiceDeclarationsServable(input: {
|
|
151
|
+
envs: ReadonlyArray<{
|
|
152
|
+
envName: string;
|
|
153
|
+
backingServices: BackingServicesEnvConfig | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
servableProviders: ReadonlySet<InfraProvider>;
|
|
156
|
+
}): void;
|
|
157
|
+
//# sourceMappingURL=backing-service-servability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backing-service-servability.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-service-servability.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAEpB,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,0CAA0C;AAC1C,oBAAY,8BAA8B;IACxC,4FAA4F;IAC5F,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;;;;;;;OASG;IACH,oBAAoB,yBAAyB;CAC9C;AAED,yFAAyF;AACzF,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,0EAA0E;AAC1E,MAAM,WAAW,iCAAkC,SAAQ,+BAA+B;IACxF,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,iCAAiC,CAAC,CAiBpH,CAAC;AAEF,4FAA4F;AAC5F,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,MAAM,EAAE,8BAA8B,CAAC;IACvC,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,aAAa,CAAC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G,SAAS,CAAA;KAAE,CAAC,CAAC;IAChG,iBAAiB,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC/C,GAAG,IAAI,CAOP"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { BackingServiceKind, BackingServiceSource, resolveInfraProvider, } from './backing-services.schemas.js';
|
|
2
|
+
import { InfraProvider } from './infra-providers.schemas.js';
|
|
3
|
+
/**
|
|
4
|
+
* Is a `backingServices` declaration one the platform can actually SERVE?
|
|
5
|
+
*
|
|
6
|
+
* ## The defect this closes (#1693)
|
|
7
|
+
*
|
|
8
|
+
* A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve
|
|
9
|
+
* nothing, and both passed `wildo config sync` and `wildo lock check` in silence:
|
|
10
|
+
*
|
|
11
|
+
* 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other
|
|
12
|
+
* than `'atlas'`. The lockfile materializer skipped the kind without a word.
|
|
13
|
+
* 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no
|
|
14
|
+
* module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer
|
|
15
|
+
* fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.
|
|
16
|
+
*
|
|
17
|
+
* Neither "provisions nothing". The generators honour `source`, so a MANAGED cache gets no
|
|
18
|
+
* self-hosted workload — while apps-manager, which named its modules and was never told the
|
|
19
|
+
* declaration, minted the application's credential on the PLATFORM's own server. The application
|
|
20
|
+
* received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches
|
|
21
|
+
* on the declared provider and refuses one it cannot serve
|
|
22
|
+
* ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same
|
|
23
|
+
* declarations before they reach it.
|
|
24
|
+
*
|
|
25
|
+
* ## Why the servable set is an INPUT here, not computed here
|
|
26
|
+
*
|
|
27
|
+
* Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),
|
|
28
|
+
* and that package depends on this one — never the reverse. So the catalogue derives the set
|
|
29
|
+
* (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,
|
|
30
|
+
* so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which
|
|
31
|
+
* declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,
|
|
32
|
+
* which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}
|
|
33
|
+
* directly.
|
|
34
|
+
*
|
|
35
|
+
* ## No opt-out, deliberately
|
|
36
|
+
*
|
|
37
|
+
* An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken
|
|
38
|
+
* configuration representable, which is exactly a setting that looks like a control and does
|
|
39
|
+
* nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.
|
|
40
|
+
*/
|
|
41
|
+
/** Why a declaration cannot be served. */
|
|
42
|
+
export var BackingServiceUnservableReason;
|
|
43
|
+
(function (BackingServiceUnservableReason) {
|
|
44
|
+
/** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */
|
|
45
|
+
BackingServiceUnservableReason["NO_PROVIDER"] = "no-provider";
|
|
46
|
+
/**
|
|
47
|
+
* It names a catalogue entry, but no provider module serves that entry — either none exists, or the
|
|
48
|
+
* one that exists declares `unservableReason`.
|
|
49
|
+
*/
|
|
50
|
+
BackingServiceUnservableReason["NO_SERVING_MODULE"] = "no-serving-module";
|
|
51
|
+
/**
|
|
52
|
+
* A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas
|
|
53
|
+
* declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with
|
|
54
|
+
* no PostgreSQL admin (#1692).
|
|
55
|
+
*
|
|
56
|
+
* Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one
|
|
57
|
+
* platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)
|
|
58
|
+
* never produce it. apps-manager refuses the registration rather than minting on another provider — a
|
|
59
|
+
* substitution would hand the application a credential for a server it does not connect to.
|
|
60
|
+
*/
|
|
61
|
+
BackingServiceUnservableReason["NOT_HELD_BY_PLATFORM"] = "not-held-by-platform";
|
|
62
|
+
})(BackingServiceUnservableReason || (BackingServiceUnservableReason = {}));
|
|
63
|
+
/**
|
|
64
|
+
* For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of
|
|
65
|
+
* `resolveInfraProvider`, used to tell an author what they may write instead.
|
|
66
|
+
*
|
|
67
|
+
* Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error
|
|
68
|
+
* here until someone states how it is declared. That the inverse is truthful is pinned by a test that
|
|
69
|
+
* resolves every row back through `resolveInfraProvider`; it is never trusted by construction.
|
|
70
|
+
*/
|
|
71
|
+
export const INFRA_PROVIDER_CANONICAL_DECLARATIONS = {
|
|
72
|
+
[InfraProvider.MONGODB_SELF]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.SELF },
|
|
73
|
+
[InfraProvider.MONGODB_ATLAS]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.MANAGED, provider: 'atlas' },
|
|
74
|
+
[InfraProvider.POSTGRES_SELF]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.SELF },
|
|
75
|
+
[InfraProvider.POSTGRES_MANAGED]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED },
|
|
76
|
+
[InfraProvider.POSTGRES_AWS_RDS]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'aws-rds' },
|
|
77
|
+
[InfraProvider.POSTGRES_GCP_CLOUD_SQL]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'gcp-cloud-sql' },
|
|
78
|
+
[InfraProvider.POSTGRES_AZURE_DATABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'azure-database' },
|
|
79
|
+
[InfraProvider.POSTGRES_SUPABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'supabase' },
|
|
80
|
+
[InfraProvider.POSTGRES_NEON]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'neon' },
|
|
81
|
+
[InfraProvider.POSTGRES_RENDER]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'render' },
|
|
82
|
+
[InfraProvider.REDIS_SELF]: { kind: BackingServiceKind.REDIS, source: BackingServiceSource.SELF },
|
|
83
|
+
[InfraProvider.RABBITMQ_SELF]: { kind: BackingServiceKind.RABBITMQ, source: BackingServiceSource.SELF },
|
|
84
|
+
[InfraProvider.MINIO_SELF]: { kind: BackingServiceKind.S3, source: BackingServiceSource.SELF },
|
|
85
|
+
[InfraProvider.AWS_S3]: { kind: BackingServiceKind.S3, source: BackingServiceSource.MANAGED },
|
|
86
|
+
[InfraProvider.CLAMAV_SELF]: { kind: BackingServiceKind.CLAMAV, source: BackingServiceSource.SELF },
|
|
87
|
+
[InfraProvider.IMMUDB_SELF]: { kind: BackingServiceKind.IMMUDB, source: BackingServiceSource.SELF },
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* The servable declarations for one kind, one per servable provider, in catalogue order.
|
|
91
|
+
*
|
|
92
|
+
* Empty when nothing can serve the kind — then the only servable choice is not to declare it.
|
|
93
|
+
*/
|
|
94
|
+
export function servableBackingServiceDeclarations(kind, servableProviders) {
|
|
95
|
+
const alternatives = [];
|
|
96
|
+
for (const provider of Object.values(InfraProvider)) {
|
|
97
|
+
if (!servableProviders.has(provider))
|
|
98
|
+
continue;
|
|
99
|
+
const declaration = INFRA_PROVIDER_CANONICAL_DECLARATIONS[provider];
|
|
100
|
+
if (declaration.kind !== kind)
|
|
101
|
+
continue;
|
|
102
|
+
alternatives.push({
|
|
103
|
+
source: declaration.source,
|
|
104
|
+
...(declaration.provider === undefined ? {} : { provider: declaration.provider }),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return alternatives;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Every declaration in one environment that the platform cannot serve. Empty means every declared
|
|
111
|
+
* kind resolves to a provider in `servableProviders`.
|
|
112
|
+
*
|
|
113
|
+
* Pure. `servableProviders` comes from `collectServableInfraProviders()` in
|
|
114
|
+
* `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.
|
|
115
|
+
*/
|
|
116
|
+
export function findUnservableBackingServiceDeclarations(input) {
|
|
117
|
+
const findings = [];
|
|
118
|
+
if (!input.backingServices)
|
|
119
|
+
return findings;
|
|
120
|
+
for (const kind of Object.values(BackingServiceKind)) {
|
|
121
|
+
const entry = input.backingServices[kind];
|
|
122
|
+
if (!entry)
|
|
123
|
+
continue;
|
|
124
|
+
const finding = classifyBackingServiceDeclaration({
|
|
125
|
+
envName: input.envName,
|
|
126
|
+
kind,
|
|
127
|
+
declared: entry,
|
|
128
|
+
servableProviders: input.servableProviders,
|
|
129
|
+
});
|
|
130
|
+
if (finding)
|
|
131
|
+
findings.push(finding);
|
|
132
|
+
}
|
|
133
|
+
return findings;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* One kind's declaration against a servable set: `undefined` when it resolves to a provider in the set,
|
|
137
|
+
* otherwise the finding. The single place the resolve-then-check rule lives, so the offline checks above and
|
|
138
|
+
* apps-manager's registration check below cannot disagree about what a declaration names.
|
|
139
|
+
*/
|
|
140
|
+
function classifyBackingServiceDeclaration(input) {
|
|
141
|
+
const declared = {
|
|
142
|
+
source: input.declared.source,
|
|
143
|
+
...(input.declared.provider === undefined ? {} : { provider: input.declared.provider }),
|
|
144
|
+
};
|
|
145
|
+
const resolvedProvider = resolveInfraProvider(input.kind, declared.source, declared.provider);
|
|
146
|
+
if (resolvedProvider !== undefined && input.servableProviders.has(resolvedProvider))
|
|
147
|
+
return undefined;
|
|
148
|
+
return {
|
|
149
|
+
envName: input.envName,
|
|
150
|
+
kind: input.kind,
|
|
151
|
+
declared,
|
|
152
|
+
reason: resolvedProvider === undefined
|
|
153
|
+
? BackingServiceUnservableReason.NO_PROVIDER
|
|
154
|
+
: BackingServiceUnservableReason.NO_SERVING_MODULE,
|
|
155
|
+
...(resolvedProvider === undefined ? {} : { resolvedProvider }),
|
|
156
|
+
servableAlternatives: servableBackingServiceDeclarations(input.kind, input.servableProviders),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of
|
|
161
|
+
* the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).
|
|
162
|
+
*
|
|
163
|
+
* Two sets, because they answer different questions:
|
|
164
|
+
*
|
|
165
|
+
* - `catalogueServableProviders` — what the provider-module catalogue can serve at all
|
|
166
|
+
* (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the
|
|
167
|
+
* catalogue refuses is refused here too, even if an older CLI let it through.
|
|
168
|
+
* - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a
|
|
169
|
+
* provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds
|
|
170
|
+
* apps-manager mints a credential on for THIS application: an environment's declaration also names stores
|
|
171
|
+
* only the platform uses, and refusing an application over an admin client it would never use would be a
|
|
172
|
+
* refusal with nothing behind it.
|
|
173
|
+
*
|
|
174
|
+
* A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not
|
|
175
|
+
* is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform
|
|
176
|
+
* can serve, because that is what the author can actually switch to here.
|
|
177
|
+
*
|
|
178
|
+
* Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous
|
|
179
|
+
* behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).
|
|
180
|
+
*/
|
|
181
|
+
export function findBackingServiceDeclarationsThePlatformCannotServe(input) {
|
|
182
|
+
const findings = [];
|
|
183
|
+
if (!input.declaredProviders)
|
|
184
|
+
return findings;
|
|
185
|
+
const platformServable = new Set([...input.platformServableProviders].filter((provider) => input.catalogueServableProviders.has(provider)));
|
|
186
|
+
for (const kind of Object.values(BackingServiceKind)) {
|
|
187
|
+
const declared = input.declaredProviders[kind];
|
|
188
|
+
if (!declared)
|
|
189
|
+
continue;
|
|
190
|
+
const catalogueFinding = classifyBackingServiceDeclaration({
|
|
191
|
+
envName: input.envName,
|
|
192
|
+
kind,
|
|
193
|
+
declared,
|
|
194
|
+
servableProviders: input.catalogueServableProviders,
|
|
195
|
+
});
|
|
196
|
+
if (catalogueFinding) {
|
|
197
|
+
findings.push({ ...catalogueFinding, servableAlternatives: servableBackingServiceDeclarations(kind, platformServable) });
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (!input.mintedKinds.has(kind))
|
|
201
|
+
continue;
|
|
202
|
+
const platformFinding = classifyBackingServiceDeclaration({ envName: input.envName, kind, declared, servableProviders: platformServable });
|
|
203
|
+
if (platformFinding)
|
|
204
|
+
findings.push({ ...platformFinding, reason: BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM });
|
|
205
|
+
}
|
|
206
|
+
return findings;
|
|
207
|
+
}
|
|
208
|
+
function describeUnservableReason(finding) {
|
|
209
|
+
switch (finding.reason) {
|
|
210
|
+
case BackingServiceUnservableReason.NO_PROVIDER:
|
|
211
|
+
return 'names no infrastructure provider';
|
|
212
|
+
case BackingServiceUnservableReason.NO_SERVING_MODULE:
|
|
213
|
+
return `names provider '${finding.resolvedProvider}', which no provider module can serve yet`;
|
|
214
|
+
case BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM:
|
|
215
|
+
return `names provider '${finding.resolvedProvider}', for which this platform holds no administrative credentials, `
|
|
216
|
+
+ 'so apps-manager cannot mint on it (which admin clients a platform holds is platform configuration)';
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function renderSelection(selection) {
|
|
220
|
+
return selection.provider === undefined
|
|
221
|
+
? `{ source: '${selection.source}' }`
|
|
222
|
+
: `{ source: '${selection.source}', provider: '${selection.provider}' }`;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* One line per finding: the environment, the kind, what was declared, why it cannot be served, and
|
|
226
|
+
* the declarations that ARE servable for that kind. Shared by every caller so the wording is one.
|
|
227
|
+
*/
|
|
228
|
+
export function describeUnservableBackingServiceDeclaration(finding) {
|
|
229
|
+
const why = describeUnservableReason(finding);
|
|
230
|
+
const instead = finding.servableAlternatives.length === 0
|
|
231
|
+
? 'nothing can serve this kind today, so do not declare it'
|
|
232
|
+
: `servable declarations for '${finding.kind}': ${finding.servableAlternatives.map(renderSelection).join(' | ')}`;
|
|
233
|
+
return `environment '${finding.envName}': backingServices.${finding.kind} ${renderSelection(finding.declared)} ${why}; ${instead}.`;
|
|
234
|
+
}
|
|
235
|
+
/** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */
|
|
236
|
+
export class UnservableBackingServiceDeclarationError extends Error {
|
|
237
|
+
findings;
|
|
238
|
+
constructor(findings) {
|
|
239
|
+
super('These backing-service declarations cannot be served, so the platform would hand the application '
|
|
240
|
+
+ 'a credential for a server it never connects to:\n'
|
|
241
|
+
+ findings.map((finding) => ` - ${describeUnservableBackingServiceDeclaration(finding)}`).join('\n'));
|
|
242
|
+
this.name = 'UnservableBackingServiceDeclarationError';
|
|
243
|
+
this.findings = findings;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Refuse, naming every unservable declaration across every environment at once. */
|
|
247
|
+
export function assertBackingServiceDeclarationsServable(input) {
|
|
248
|
+
const findings = input.envs.flatMap((env) => findUnservableBackingServiceDeclarations({
|
|
249
|
+
envName: env.envName,
|
|
250
|
+
backingServices: env.backingServices,
|
|
251
|
+
servableProviders: input.servableProviders,
|
|
252
|
+
}));
|
|
253
|
+
if (findings.length > 0)
|
|
254
|
+
throw new UnservableBackingServiceDeclarationError(findings);
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=backing-service-servability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backing-service-servability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ACtI,CAAC;AAED,yFAAyF;AACzF,MAAM,OAAO,wCAAyC,SAAQ,KAAK;IACxD,QAAQ,CAAqD;IAEtE,YAAY,QAA4D;QACtE,KAAK,CACH,kGAAkG;cAChG,mDAAmD;cACnD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,2CAA2C,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACtG,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0CAA0C,CAAC;QACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,oFAAoF;AACpF,MAAM,UAAU,wCAAwC,CAAC,KAGxD;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,eAAe,EAAE,GAAG,CAAC,eAAe;QACpC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC3C,CAAC,CAAC,CAAC;IACJ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,wCAAwC,CAAC,QAAQ,CAAC,CAAC;AACxF,CAAC","sourcesContent":["import {\n BackingServiceKind,\n BackingServiceSource,\n resolveInfraProvider,\n type BackingServicesEnvConfig,\n} from './backing-services.schemas';\nimport { InfraProvider } from './infra-providers.schemas';\n\n/**\n * Is a `backingServices` declaration one the platform can actually SERVE?\n *\n * ## The defect this closes (#1693)\n *\n * A declaration used to be accepted when it merely parsed. Two classes of parseable declaration serve\n * nothing, and both passed `wildo config sync` and `wildo lock check` in silence:\n *\n * 1. **It resolves to no provider** — `redis: { source: MANAGED }`, a managed MongoDB brand other\n * than `'atlas'`. The lockfile materializer skipped the kind without a word.\n * 2. **It resolves to a provider no module can serve** — the seven managed PostgreSQL entries have no\n * module, and `AWS_S3` has one whose credential broker does not exist yet (#14). The materializer\n * fell back to hashing the authored entry, so the lockfile recorded a selection nothing executes.\n *\n * Neither \"provisions nothing\". The generators honour `source`, so a MANAGED cache gets no\n * self-hosted workload — while apps-manager, which named its modules and was never told the\n * declaration, minted the application's credential on the PLATFORM's own server. The application\n * received a credential for a server it never connects to. Since #1692 apps-manager is told, dispatches\n * on the declared provider and refuses one it cannot serve\n * ({@link findBackingServiceDeclarationsThePlatformCannotServe}); this offline check stops the same\n * declarations before they reach it.\n *\n * ## Why the servable set is an INPUT here, not computed here\n *\n * Servability is a property of the provider-module CATALOGUE (`@wildo-ai/platform-infra-providers`),\n * and that package depends on this one — never the reverse. So the catalogue derives the set\n * (`collectServableInfraProviders()`) and every caller hands it in. The check itself lives here, once,\n * so `wildo config validate`, `wildo config sync` and `wildo lock check` cannot disagree about which\n * declarations they refuse: the two lockfile projections reach it through `materializeInfraSection`,\n * which REQUIRES the set, and `config validate` calls {@link findUnservableBackingServiceDeclarations}\n * directly.\n *\n * ## No opt-out, deliberately\n *\n * An earlier design offered `acceptUnresolved: true`. It was dropped: it makes a known-broken\n * configuration representable, which is exactly a setting that looks like a control and does\n * nothing. A kind becomes declarable as `MANAGED` in the same change that adds the module serving it.\n */\n\n/** Why a declaration cannot be served. */\nexport enum BackingServiceUnservableReason {\n /** The `(kind, source, provider)` tuple names no `InfraProvider` catalogue entry at all. */\n NO_PROVIDER = 'no-provider',\n /**\n * It names a catalogue entry, but no provider module serves that entry — either none exists, or the\n * one that exists declares `unservableReason`.\n */\n NO_SERVING_MODULE = 'no-serving-module',\n /**\n * A module serves the entry, but THIS platform holds no administrative credentials for it — an Atlas\n * declaration on a platform with no Atlas API key, a self-hosted PostgreSQL declaration on a platform with\n * no PostgreSQL admin (#1692).\n *\n * Only apps-manager can know this: which admin clients a platform holds is platform configuration, and one\n * platform hosts many applications. The offline checks (`config validate` / `config sync` / `lock check`)\n * never produce it. apps-manager refuses the registration rather than minting on another provider — a\n * substitution would hand the application a credential for a server it does not connect to.\n */\n NOT_HELD_BY_PLATFORM = 'not-held-by-platform',\n}\n\n/** The authored half of a backing-service entry that decides which provider it names. */\nexport interface BackingServiceProviderSelection {\n source: BackingServiceSource;\n /** The brand, when the kind distinguishes several. See `resolveInfraProvider` for the vocabulary. */\n provider?: string;\n}\n\n/** The simplest authored declaration that selects one catalogue entry. */\nexport interface InfraProviderCanonicalDeclaration extends BackingServiceProviderSelection {\n kind: BackingServiceKind;\n}\n\n/**\n * For every `InfraProvider`, the SIMPLEST declaration that selects it — the inverse of\n * `resolveInfraProvider`, used to tell an author what they may write instead.\n *\n * Total over `InfraProvider` (a `Record`), so a provider added to the catalogue is a compile error\n * here until someone states how it is declared. That the inverse is truthful is pinned by a test that\n * resolves every row back through `resolveInfraProvider`; it is never trusted by construction.\n */\nexport const INFRA_PROVIDER_CANONICAL_DECLARATIONS: Readonly<Record<InfraProvider, InfraProviderCanonicalDeclaration>> = {\n [InfraProvider.MONGODB_SELF]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.SELF },\n [InfraProvider.MONGODB_ATLAS]: { kind: BackingServiceKind.MONGODB, source: BackingServiceSource.MANAGED, provider: 'atlas' },\n [InfraProvider.POSTGRES_SELF]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.SELF },\n [InfraProvider.POSTGRES_MANAGED]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED },\n [InfraProvider.POSTGRES_AWS_RDS]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'aws-rds' },\n [InfraProvider.POSTGRES_GCP_CLOUD_SQL]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'gcp-cloud-sql' },\n [InfraProvider.POSTGRES_AZURE_DATABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'azure-database' },\n [InfraProvider.POSTGRES_SUPABASE]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'supabase' },\n [InfraProvider.POSTGRES_NEON]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'neon' },\n [InfraProvider.POSTGRES_RENDER]: { kind: BackingServiceKind.POSTGRESQL, source: BackingServiceSource.MANAGED, provider: 'render' },\n [InfraProvider.REDIS_SELF]: { kind: BackingServiceKind.REDIS, source: BackingServiceSource.SELF },\n [InfraProvider.RABBITMQ_SELF]: { kind: BackingServiceKind.RABBITMQ, source: BackingServiceSource.SELF },\n [InfraProvider.MINIO_SELF]: { kind: BackingServiceKind.S3, source: BackingServiceSource.SELF },\n [InfraProvider.AWS_S3]: { kind: BackingServiceKind.S3, source: BackingServiceSource.MANAGED },\n [InfraProvider.CLAMAV_SELF]: { kind: BackingServiceKind.CLAMAV, source: BackingServiceSource.SELF },\n [InfraProvider.IMMUDB_SELF]: { kind: BackingServiceKind.IMMUDB, source: BackingServiceSource.SELF },\n};\n\n/** One declaration the platform cannot serve, with everything the refusal message needs. */\nexport interface UnservableBackingServiceDeclaration {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n reason: BackingServiceUnservableReason;\n /** The catalogue entry it names, when it names one (`NO_SERVING_MODULE`). */\n resolvedProvider?: InfraProvider;\n /** The simplest servable declarations for the same kind — what the author may write instead. */\n servableAlternatives: ReadonlyArray<BackingServiceProviderSelection>;\n}\n\n/**\n * The servable declarations for one kind, one per servable provider, in catalogue order.\n *\n * Empty when nothing can serve the kind — then the only servable choice is not to declare it.\n */\nexport function servableBackingServiceDeclarations(\n kind: BackingServiceKind,\n servableProviders: ReadonlySet<InfraProvider>,\n): ReadonlyArray<BackingServiceProviderSelection> {\n const alternatives: BackingServiceProviderSelection[] = [];\n for (const provider of Object.values(InfraProvider)) {\n if (!servableProviders.has(provider)) continue;\n const declaration = INFRA_PROVIDER_CANONICAL_DECLARATIONS[provider];\n if (declaration.kind !== kind) continue;\n alternatives.push({\n source: declaration.source,\n ...(declaration.provider === undefined ? {} : { provider: declaration.provider }),\n });\n }\n return alternatives;\n}\n\n/**\n * Every declaration in one environment that the platform cannot serve. Empty means every declared\n * kind resolves to a provider in `servableProviders`.\n *\n * Pure. `servableProviders` comes from `collectServableInfraProviders()` in\n * `@wildo-ai/platform-infra-providers`; see the file header for why it is an input.\n */\nexport function findUnservableBackingServiceDeclarations(input: {\n envName: string;\n backingServices: BackingServicesEnvConfig | undefined;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.backingServices) return findings;\n\n for (const kind of Object.values(BackingServiceKind)) {\n const entry = input.backingServices[kind];\n if (!entry) continue;\n const finding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared: entry,\n servableProviders: input.servableProviders,\n });\n if (finding) findings.push(finding);\n }\n return findings;\n}\n\n/**\n * One kind's declaration against a servable set: `undefined` when it resolves to a provider in the set,\n * otherwise the finding. The single place the resolve-then-check rule lives, so the offline checks above and\n * apps-manager's registration check below cannot disagree about what a declaration names.\n */\nfunction classifyBackingServiceDeclaration(input: {\n envName: string;\n kind: BackingServiceKind;\n declared: BackingServiceProviderSelection;\n servableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration | undefined {\n const declared: BackingServiceProviderSelection = {\n source: input.declared.source,\n ...(input.declared.provider === undefined ? {} : { provider: input.declared.provider }),\n };\n const resolvedProvider = resolveInfraProvider(input.kind, declared.source, declared.provider);\n if (resolvedProvider !== undefined && input.servableProviders.has(resolvedProvider)) return undefined;\n return {\n envName: input.envName,\n kind: input.kind,\n declared,\n reason: resolvedProvider === undefined\n ? BackingServiceUnservableReason.NO_PROVIDER\n : BackingServiceUnservableReason.NO_SERVING_MODULE,\n ...(resolvedProvider === undefined ? {} : { resolvedProvider }),\n servableAlternatives: servableBackingServiceDeclarations(input.kind, input.servableProviders),\n };\n}\n\n/**\n * The declarations an application REGISTERS with that THIS platform cannot serve — apps-manager's half of\n * the servability check (#1692; the offline half is {@link findUnservableBackingServiceDeclarations}, #1693).\n *\n * Two sets, because they answer different questions:\n *\n * - `catalogueServableProviders` — what the provider-module catalogue can serve at all\n * (`collectServableInfraProviders()`). Every DECLARED kind is checked against it: a declaration the\n * catalogue refuses is refused here too, even if an older CLI let it through.\n * - `platformServableProviders` — the subset this platform holds what it needs for (an admin client for a\n * provider apps-manager mints on, nothing for one it does not). Checked only for `mintedKinds`, the kinds\n * apps-manager mints a credential on for THIS application: an environment's declaration also names stores\n * only the platform uses, and refusing an application over an admin client it would never use would be a\n * refusal with nothing behind it.\n *\n * A catalogue finding keeps its catalogue reason; a provider the catalogue serves and this platform does not\n * is {@link BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM}. Alternatives are always what THIS platform\n * can serve, because that is what the author can actually switch to here.\n *\n * Pure; apps-manager supplies both sets. An absent `declaredProviders` yields nothing — the previous\n * behaviour for every kind (see `ApplicationBackingServiceProviderDeclarations`).\n */\nexport function findBackingServiceDeclarationsThePlatformCannotServe(input: {\n envName: string;\n declaredProviders: Partial<Record<BackingServiceKind, BackingServiceProviderSelection>> | undefined;\n mintedKinds: ReadonlySet<BackingServiceKind>;\n catalogueServableProviders: ReadonlySet<InfraProvider>;\n platformServableProviders: ReadonlySet<InfraProvider>;\n}): UnservableBackingServiceDeclaration[] {\n const findings: UnservableBackingServiceDeclaration[] = [];\n if (!input.declaredProviders) return findings;\n const platformServable = new Set(\n [...input.platformServableProviders].filter((provider) => input.catalogueServableProviders.has(provider)),\n );\n\n for (const kind of Object.values(BackingServiceKind)) {\n const declared = input.declaredProviders[kind];\n if (!declared) continue;\n const catalogueFinding = classifyBackingServiceDeclaration({\n envName: input.envName,\n kind,\n declared,\n servableProviders: input.catalogueServableProviders,\n });\n if (catalogueFinding) {\n findings.push({ ...catalogueFinding, servableAlternatives: servableBackingServiceDeclarations(kind, platformServable) });\n continue;\n }\n if (!input.mintedKinds.has(kind)) continue;\n const platformFinding = classifyBackingServiceDeclaration({ envName: input.envName, kind, declared, servableProviders: platformServable });\n if (platformFinding) findings.push({ ...platformFinding, reason: BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM });\n }\n return findings;\n}\n\nfunction describeUnservableReason(finding: UnservableBackingServiceDeclaration): string {\n switch (finding.reason) {\n case BackingServiceUnservableReason.NO_PROVIDER:\n return 'names no infrastructure provider';\n case BackingServiceUnservableReason.NO_SERVING_MODULE:\n return `names provider '${finding.resolvedProvider}', which no provider module can serve yet`;\n case BackingServiceUnservableReason.NOT_HELD_BY_PLATFORM:\n return `names provider '${finding.resolvedProvider}', for which this platform holds no administrative credentials, `\n + 'so apps-manager cannot mint on it (which admin clients a platform holds is platform configuration)';\n }\n}\n\nfunction renderSelection(selection: BackingServiceProviderSelection): string {\n return selection.provider === undefined\n ? `{ source: '${selection.source}' }`\n : `{ source: '${selection.source}', provider: '${selection.provider}' }`;\n}\n\n/**\n * One line per finding: the environment, the kind, what was declared, why it cannot be served, and\n * the declarations that ARE servable for that kind. Shared by every caller so the wording is one.\n */\nexport function describeUnservableBackingServiceDeclaration(finding: UnservableBackingServiceDeclaration): string {\n const why = describeUnservableReason(finding);\n const instead = finding.servableAlternatives.length === 0\n ? 'nothing can serve this kind today, so do not declare it'\n : `servable declarations for '${finding.kind}': ${finding.servableAlternatives.map(renderSelection).join(' | ')}`;\n return `environment '${finding.envName}': backingServices.${finding.kind} ${renderSelection(finding.declared)} ${why}; ${instead}.`;\n}\n\n/** Thrown when a declaration the platform cannot serve reaches a lockfile projection. */\nexport class UnservableBackingServiceDeclarationError extends Error {\n readonly findings: ReadonlyArray<UnservableBackingServiceDeclaration>;\n\n constructor(findings: ReadonlyArray<UnservableBackingServiceDeclaration>) {\n super(\n 'These backing-service declarations cannot be served, so the platform would hand the application '\n + 'a credential for a server it never connects to:\\n'\n + findings.map((finding) => ` - ${describeUnservableBackingServiceDeclaration(finding)}`).join('\\n'),\n );\n this.name = 'UnservableBackingServiceDeclarationError';\n this.findings = findings;\n }\n}\n\n/** Refuse, naming every unservable declaration across every environment at once. */\nexport function assertBackingServiceDeclarationsServable(input: {\n envs: ReadonlyArray<{ envName: string; backingServices: BackingServicesEnvConfig | undefined }>;\n servableProviders: ReadonlySet<InfraProvider>;\n}): void {\n const findings = input.envs.flatMap((env) => findUnservableBackingServiceDeclarations({\n envName: env.envName,\n backingServices: env.backingServices,\n servableProviders: input.servableProviders,\n }));\n if (findings.length > 0) throw new UnservableBackingServiceDeclarationError(findings);\n}\n"]}
|