@caelo-cms/provisioning 0.3.16 → 0.3.17
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/package.json +2 -2
- package/stacks/gcp-firebase/index.ts +30 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caelo-cms/provisioning",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"description": "Pulumi-driven provisioning for Caelo CMS — `bunx @caelo-cms/provisioning --provider <self-hosted|gcp|aws|azure>` brings up a TLS-served install with Postgres + storage + secrets manager + the admin + the API gateway.",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prepublishOnly": "tsc -b --force && tsc --project stacks/gcp/tsconfig.json && tsc --project stacks/gcp-firebase/tsconfig.json"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@caelo-cms/shared": "^0.3.
|
|
41
|
+
"@caelo-cms/shared": "^0.3.17",
|
|
42
42
|
"@clack/prompts": "1.3.0",
|
|
43
43
|
"@pulumi/aws": "^7",
|
|
44
44
|
"@pulumi/awsx": "^3",
|
|
@@ -546,21 +546,27 @@ const adminDomainMapping = provisionAdminDomain
|
|
|
546
546
|
// shipped. If your provider build is older than v8.x, run
|
|
547
547
|
// `gcloud beta run services update <admin-service> --iap` as a
|
|
548
548
|
// post-up step. The stack provisions the IAM bindings either way.
|
|
549
|
-
// v0.3.
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
// IAP-web-cloud-run resource, then forwards the request to the
|
|
553
|
-
// Cloud Run service (which auto-trusts IAP-forwarded traffic via
|
|
554
|
-
// the native IAP integration on the cloudrunv2.Service spec).
|
|
549
|
+
// v0.3.17 — Native IAP on Cloud Run requires TWO bindings per
|
|
550
|
+
// allowlisted user (testing showed iap-only isn't enough — Cloud
|
|
551
|
+
// Run still rejects with 403 Forbidden after IAP forwards):
|
|
555
552
|
//
|
|
556
|
-
//
|
|
557
|
-
//
|
|
558
|
-
//
|
|
559
|
-
//
|
|
560
|
-
//
|
|
553
|
+
// 1. `roles/iap.httpsResourceAccessor` on the IAP WEB layer —
|
|
554
|
+
// lets the user pass IAP authentication.
|
|
555
|
+
// Resource: `gcp.iap.WebCloudRunServiceIamMember`
|
|
556
|
+
// (matches `gcloud beta iap web add-iam-policy-binding`).
|
|
557
|
+
//
|
|
558
|
+
// 2. `roles/run.invoker` on the Cloud Run service v2 IAM —
|
|
559
|
+
// lets Cloud Run accept the IAP-forwarded request. Without
|
|
560
|
+
// this, Cloud Run's own auth gate rejects with "Your client
|
|
561
|
+
// does not have permission".
|
|
562
|
+
//
|
|
563
|
+
// Both are needed for IAP-protected Cloud Run to actually serve
|
|
564
|
+
// requests to the operator.
|
|
561
565
|
for (const principal of iapAllowlist) {
|
|
566
|
+
const slug = principal.replace(/[^a-z0-9]/gi, "-").slice(0, 40);
|
|
567
|
+
|
|
562
568
|
new gcp.iap.WebCloudRunServiceIamMember(
|
|
563
|
-
`${namePrefix}-admin-iap-${
|
|
569
|
+
`${namePrefix}-admin-iap-${slug}`,
|
|
564
570
|
{
|
|
565
571
|
project,
|
|
566
572
|
location: region,
|
|
@@ -570,6 +576,18 @@ for (const principal of iapAllowlist) {
|
|
|
570
576
|
},
|
|
571
577
|
opts,
|
|
572
578
|
);
|
|
579
|
+
|
|
580
|
+
new gcp.cloudrunv2.ServiceIamMember(
|
|
581
|
+
`${namePrefix}-admin-invoker-${slug}`,
|
|
582
|
+
{
|
|
583
|
+
project,
|
|
584
|
+
location: region,
|
|
585
|
+
name: adminSvc.name,
|
|
586
|
+
role: "roles/run.invoker",
|
|
587
|
+
member: principal,
|
|
588
|
+
},
|
|
589
|
+
opts,
|
|
590
|
+
);
|
|
573
591
|
}
|
|
574
592
|
|
|
575
593
|
// =========================================================================
|