Skip to content

Feature: Configurable Google Cloud OIDC token lifetime#2050

Open
HuyPhanNguyen wants to merge 4 commits into
mainfrom
huy/2026/fd-535-gcp-oidc-token-lifetime
Open

Feature: Configurable Google Cloud OIDC token lifetime#2050
HuyPhanNguyen wants to merge 4 commits into
mainfrom
huy/2026/fd-535-gcp-oidc-token-lifetime

Conversation

@HuyPhanNguyen

Copy link
Copy Markdown
Contributor

Background

SetupGCloudAuthentication.TryAuthenticateWithOidc hardcoded --service-account-token-lifetime-seconds=3600 when building the gcloud iam workload-identity-pools create-cred-config call for Google Cloud OIDC / Workload Identity Federation auth. Deployment steps that run longer than 60 minutes hit a mid-step credential expiry. Google supports 600–43200 seconds (up to 12 hours). Raised by STOXX (FD-535).

Results

Reads the lifetime from the account-scoped deployment variable {accountVariable}.OpenIdConnect.TokenLifetimeSeconds (emitted by the Octopus Server change), defaults to 3600 when unset, clamps to Google's 600–43200 range (logging a warning when out of range), and threads it into the gcloud argument.

Fixes FD-535

Before

  • create-cred-config was always called with --service-account-token-lifetime-seconds=3600.

After

  • Uses the configured value: variables.GetInt32("{account}.OpenIdConnect.TokenLifetimeSeconds") ?? 3600, clamped to 600–43200, interpolated into the gcloud arg.

Companion to the OctopusDeploy server PR (adds the GoogleCloudOidcAccount type + TokenLifetimeSeconds field that produces this variable). Verified end-to-end against real Google Workload Identity Federation.

Reads Octopus.Action variable {account}.OpenIdConnect.TokenLifetimeSeconds (default 3600, clamped 600-43200) instead of the hardcoded 3600 when building the gcloud create-cred-config call.
@HuyPhanNguyen HuyPhanNguyen force-pushed the huy/2026/fd-535-gcp-oidc-token-lifetime branch from 1151d57 to eb0a55b Compare June 29, 2026 21:35
@HuyPhanNguyen HuyPhanNguyen marked this pull request as ready for review June 30, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant