@caelo-cms/provisioning 0.3.15 → 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 +32 -10
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,20 +546,42 @@ 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
|
-
//
|
|
553
|
-
//
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
//
|
|
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):
|
|
552
|
+
//
|
|
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.
|
|
557
565
|
for (const principal of iapAllowlist) {
|
|
558
|
-
|
|
559
|
-
|
|
566
|
+
const slug = principal.replace(/[^a-z0-9]/gi, "-").slice(0, 40);
|
|
567
|
+
|
|
568
|
+
new gcp.iap.WebCloudRunServiceIamMember(
|
|
569
|
+
`${namePrefix}-admin-iap-${slug}`,
|
|
560
570
|
{
|
|
571
|
+
project,
|
|
561
572
|
location: region,
|
|
573
|
+
cloudRunServiceName: adminSvc.name,
|
|
574
|
+
role: "roles/iap.httpsResourceAccessor",
|
|
575
|
+
member: principal,
|
|
576
|
+
},
|
|
577
|
+
opts,
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
new gcp.cloudrunv2.ServiceIamMember(
|
|
581
|
+
`${namePrefix}-admin-invoker-${slug}`,
|
|
582
|
+
{
|
|
562
583
|
project,
|
|
584
|
+
location: region,
|
|
563
585
|
name: adminSvc.name,
|
|
564
586
|
role: "roles/run.invoker",
|
|
565
587
|
member: principal,
|