@caelo-cms/provisioning 0.11.14 → 0.11.15
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/__tests__/stack-under-mocks.d.ts +2 -0
- package/dist/__tests__/stack-under-mocks.d.ts.map +1 -0
- package/dist/__tests__/stack-under-mocks.js +59 -0
- package/dist/__tests__/stack-under-mocks.js.map +1 -0
- package/dist/deployed-release.d.ts.map +1 -1
- package/dist/deployed-release.js +4 -2
- package/dist/deployed-release.js.map +1 -1
- package/dist/gateway-bootstrap.d.ts +68 -0
- package/dist/gateway-bootstrap.d.ts.map +1 -0
- package/dist/gateway-bootstrap.js +145 -0
- package/dist/gateway-bootstrap.js.map +1 -0
- package/dist/stack-gateways.d.ts +31 -0
- package/dist/stack-gateways.d.ts.map +1 -0
- package/dist/stack-gateways.js +40 -0
- package/dist/stack-gateways.js.map +1 -0
- package/dist/state-command.d.ts.map +1 -1
- package/dist/state-command.js +3 -0
- package/dist/state-command.js.map +1 -1
- package/dist/wizards/gcp-pulumi.d.ts +7 -1
- package/dist/wizards/gcp-pulumi.d.ts.map +1 -1
- package/dist/wizards/gcp-pulumi.js +2 -0
- package/dist/wizards/gcp-pulumi.js.map +1 -1
- package/dist/wizards/gcp.d.ts.map +1 -1
- package/dist/wizards/gcp.js +120 -13
- package/dist/wizards/gcp.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/stack-under-mocks.ts +69 -0
- package/src/deployed-release.test.ts +16 -0
- package/src/deployed-release.ts +4 -2
- package/src/gateway-bootstrap.test.ts +381 -0
- package/src/gateway-bootstrap.ts +195 -0
- package/src/gcp-url-map.test.ts +1 -1
- package/src/remote-mcp-stack-config.test.ts +2 -1
- package/src/stack-cloud-run-names.test.ts +49 -0
- package/src/stack-gateways.ts +39 -0
- package/src/state-command.ts +3 -0
- package/src/wizards/gcp-pulumi.ts +9 -0
- package/src/wizards/gcp.ts +146 -14
- package/stacks/gcp/Pulumi.yaml +4 -0
- package/stacks/gcp/index.ts +83 -62
- package/stacks/gcp-firebase/index.ts +61 -42
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
SERVICE_VPC_EGRESS,
|
|
78
78
|
secretFileVolumesTemplate,
|
|
79
79
|
} from "../../dist/stack-contract.js";
|
|
80
|
+
import { DEPLOY_GATEWAYS_CONFIG, parseDeployGateways } from "../../dist/stack-gateways.js";
|
|
80
81
|
|
|
81
82
|
const cfg = new pulumi.Config();
|
|
82
83
|
const domain = cfg.require("domain");
|
|
@@ -829,24 +830,38 @@ const envContractInputs = {
|
|
|
829
830
|
},
|
|
830
831
|
} as const;
|
|
831
832
|
|
|
832
|
-
//
|
|
833
|
-
//
|
|
834
|
-
//
|
|
835
|
-
//
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
833
|
+
// #1328 — the data gateway, a service of its own (`caelo-<env>-data-gateway`);
|
|
834
|
+
// before, the gateway was also the remote-MCP broker. Its fixed name goes into
|
|
835
|
+
// the admin's env (the Firebase publisher wires the /api/** rewrite to it).
|
|
836
|
+
//
|
|
837
|
+
// The first `up` of a fresh install withholds it (stack-gateways.ts): it
|
|
838
|
+
// refuses to start until the migrations, which run after that `up`, have
|
|
839
|
+
// isolated its database login. The admin names it by its fixed name, not by
|
|
840
|
+
// this resource, so the admin does not wait for it and keeps its env when it
|
|
841
|
+
// is declared.
|
|
842
|
+
const deployGateways = parseDeployGateways(cfg.get(DEPLOY_GATEWAYS_CONFIG));
|
|
843
|
+
const dataGatewayName = fixedCloudRunServiceName("gcp-firebase", env, "gateway");
|
|
844
|
+
if (!dataGatewayName) throw new Error("the gcp-firebase data gateway has no fixed service name");
|
|
845
|
+
const gatewaySvc = deployGateways
|
|
846
|
+
? cloudRunService({
|
|
847
|
+
serviceName: "gateway",
|
|
848
|
+
// Its own logical name: `${namePrefix}-gateway` belongs to the
|
|
849
|
+
// MCP-Auth-Proxy (E13 a, below), and two resources with one URN fail
|
|
850
|
+
// every `pulumi up` (a fresh install could not converge, 2026-11-04).
|
|
851
|
+
resourceName: `${namePrefix}-data-gateway`,
|
|
852
|
+
minInstances: gatewayMinInstances,
|
|
853
|
+
maxInstances: gatewayMaxInstances,
|
|
854
|
+
memory: "512Mi",
|
|
855
|
+
// Firebase Hosting cuts a rewritten request at 60 s anyway.
|
|
856
|
+
timeout: "300s",
|
|
857
|
+
// All traffic: the Firebase rewrite arrives from Google's edge, and it is
|
|
858
|
+
// invokable by allUsers anyway (data-gateway-public-invoker below): every
|
|
859
|
+
// /api request passes its rate limits, captcha and honeypot. Staging has a
|
|
860
|
+
// gateway of its own since #1330 (staging-gateway-setup.ts).
|
|
861
|
+
ingress: "INGRESS_TRAFFIC_ALL",
|
|
862
|
+
contractEnv: [...gatewayEnvContract(envContractInputs), ...poolBudget.env.gateway],
|
|
863
|
+
})
|
|
864
|
+
: null;
|
|
850
865
|
|
|
851
866
|
// #1328 — the MCP-Auth-Proxy: remote MCP's sign-in broker and its stream to
|
|
852
867
|
// the IAP-protected admin, with no database, no VPC route and an account
|
|
@@ -893,7 +908,7 @@ const adminSvc = cloudRunService({
|
|
|
893
908
|
firebaseStagingSiteId: pulumi
|
|
894
909
|
.output(firebaseSiteId)
|
|
895
910
|
.apply((id) => firebaseStagingSiteId(env, id)),
|
|
896
|
-
gatewayService:
|
|
911
|
+
gatewayService: dataGatewayName,
|
|
897
912
|
}),
|
|
898
913
|
...remoteMcpEnv.admin,
|
|
899
914
|
...poolBudget.env.admin,
|
|
@@ -930,17 +945,19 @@ const adminSvc = cloudRunService({
|
|
|
930
945
|
// in-app rate-limit middleware + form CAPTCHA + per-endpoint
|
|
931
946
|
// authentication remain the real security boundary, exactly as
|
|
932
947
|
// designed.
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
948
|
+
if (gatewaySvc) {
|
|
949
|
+
new gcp.cloudrunv2.ServiceIamMember(
|
|
950
|
+
`${namePrefix}-data-gateway-public-invoker`,
|
|
951
|
+
{
|
|
952
|
+
project,
|
|
953
|
+
location: region,
|
|
954
|
+
name: gatewaySvc.name,
|
|
955
|
+
role: "roles/run.invoker",
|
|
956
|
+
member: "allUsers",
|
|
957
|
+
},
|
|
958
|
+
opts,
|
|
959
|
+
);
|
|
960
|
+
}
|
|
944
961
|
|
|
945
962
|
// #1328 — the MCP-Auth-Proxy: MCP clients sign in and call it without a
|
|
946
963
|
// Google identity of their own. The binding the service had as the gateway,
|
|
@@ -975,17 +992,19 @@ new gcp.cloudrunv2.ServiceIamMember(
|
|
|
975
992
|
// service for the runSa to act as itself. The gateway needs the
|
|
976
993
|
// explicit cross-service grant because the admin's runSa is a
|
|
977
994
|
// DIFFERENT-resource caller from the gateway's perspective.
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
995
|
+
if (gatewaySvc) {
|
|
996
|
+
new gcp.cloudrunv2.ServiceIamMember(
|
|
997
|
+
`${namePrefix}-data-gateway-viewer-for-admin-sa`,
|
|
998
|
+
{
|
|
999
|
+
project,
|
|
1000
|
+
location: region,
|
|
1001
|
+
name: gatewaySvc.name,
|
|
1002
|
+
role: "roles/run.viewer",
|
|
1003
|
+
member: pulumi.interpolate`serviceAccount:${runSa.email}`,
|
|
1004
|
+
},
|
|
1005
|
+
opts,
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
989
1008
|
|
|
990
1009
|
// =========================================================================
|
|
991
1010
|
// Admin custom domain — Cloud Run domain mapping
|
|
@@ -1318,7 +1337,7 @@ export const edgeLogSinkUrlOut = out.edgeLogSinkUrl;
|
|
|
1318
1337
|
export const providerOut = out.provider;
|
|
1319
1338
|
export const environmentOut = out.environment;
|
|
1320
1339
|
export const adminCloudRunUrlOut = adminSvc.uri;
|
|
1321
|
-
export const gatewayCloudRunUrlOut = gatewaySvc
|
|
1340
|
+
export const gatewayCloudRunUrlOut = gatewaySvc?.uri;
|
|
1322
1341
|
export const mcpAuthProxyCloudRunUrlOut = mcpAuthProxySvc.uri;
|
|
1323
1342
|
export const adminDomainOut = adminDomain;
|
|
1324
1343
|
export const firebaseSiteIdOut = firebaseSiteId;
|