@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caelo-cms/provisioning",
3
- "version": "0.3.15",
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.15",
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.13 — For IAP-protected Cloud Run, the correct IAM role
550
- // for allowlisted-user access is `roles/run.invoker`, NOT
551
- // `roles/iap.httpsResourceAccessor` (Cloud Run IAM rejects that
552
- // role on both v1 and v2 APIs with "Role is not supported for
553
- // this resource"). IAP authenticates the user via Google; after
554
- // auth passes, IAP forwards the request to Cloud Run, which
555
- // checks `run.invoker` on the authenticated identity. So
556
- // granting `run.invoker` to the user email IS the IAP allowlist.
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
- new gcp.cloudrunv2.ServiceIamMember(
559
- `${namePrefix}-admin-iap-${principal.replace(/[^a-z0-9]/gi, "-").slice(0, 40)}`,
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,