Files
windmill/backend/migrations/20260820073246_gcp_trigger_application_default_credentials.up.sql
T
8e508ea01a feat: support application default credentials for gcp pub/sub triggers (#10778)
* feat: support application default credentials for gcp pub/sub triggers

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: address review findings on gcp application default credentials

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: address review nits on gcp application default credentials

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: key the gcp credential-mode permission off the loaded mode

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: gate enabling an ADC gcp trigger on workspace admin

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: lock the gcp trigger row while authorizing a mode change

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: skip admin-only gcp listing when the caller cannot use those credentials

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: update ee-repo-ref to 54bf630681000c8ed87a7067e357118e015123b1

This commit updates the EE repository reference after PR #738 was merged in windmill-ee-private.

Previous ee-repo-ref: 91d0e228a0ad226625278b400c64f96a61404a10

New ee-repo-ref: 54bf630681000c8ed87a7067e357118e015123b1

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2026-08-21 10:41:14 +02:00

26 lines
1.6 KiB
SQL

-- Add up migration script here
ALTER TABLE gcp_trigger ALTER COLUMN gcp_resource_path DROP NOT NULL;
ALTER TABLE gcp_trigger ADD COLUMN project_id VARCHAR(255);
-- Subscriptions are now stored fully qualified (projects/<project>/subscriptions/<id>) so that one
-- Pub/Sub subscription has exactly one representation. A Pub/Sub id may itself be 255 characters,
-- so the qualified form needs more room than the bare one did.
ALTER TABLE gcp_trigger ALTER COLUMN subscription_id TYPE VARCHAR(400);
ALTER TABLE gcp_trigger DROP CONSTRAINT gcp_trigger_subscription_id_check;
ALTER TABLE gcp_trigger ADD CONSTRAINT gcp_trigger_subscription_id_check
CHECK (char_length(subscription_id::text) >= 3 AND char_length(subscription_id::text) <= 400);
-- A NULL gcp_resource_path means application default credentials, and NULLs compare as distinct,
-- so the plain column index would stop guarding those rows. project_id is deliberately absent:
-- with the subscription stored fully qualified it is not part of a subscription's identity, and
-- including it would split rows that denote the same subscription.
--
-- Rows written before this migration hold a bare id, which cannot be backfilled here: the project
-- they resolve against lives inside the credentials, not in this table. So a legacy `my-sub` and a
-- new `projects/p/subscriptions/my-sub` still read as different subscriptions until the older
-- trigger is saved again, which rewrites it in the qualified form.
DROP INDEX unique_subscription_per_gcp_resource;
CREATE UNIQUE INDEX unique_subscription_per_gcp_resource
ON gcp_trigger (subscription_id, COALESCE(gcp_resource_path, ''), workspace_id);