Skip to content

GCP access token cannot be refreshed #2253

Open

Description

@adutra

Is your feature request related to a problem? Please describe.

Currently the configured GCP access token is memoized and never refreshed:

default Supplier<GoogleCredentials> gcpCredentialsSupplier() {
return Suppliers.memoize(
() -> {
if (gcpAccessToken().isEmpty()) {
try {
return GoogleCredentials.getApplicationDefault();
} catch (IOException e) {
throw new RuntimeException("Failed to get GCP credentials", e);
}
} else {
AccessToken accessToken =
new AccessToken(
gcpAccessToken().get(),
new Date(
Instant.now()
.plus(gcpAccessTokenLifespan().orElse(DEFAULT_TOKEN_LIFESPAN))
.toEpochMilli()));
return GoogleCredentials.create(accessToken);
}
});
}

Describe the solution you'd like

We need a way to refresh GCP credentials.

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. added
    enhancement
    on Aug 4, 2025
  2. snazy commented on Aug 6, 2025

    @snazy
    Member

    Looks like this is actually a bug, providing the gcp.token configuration works for only 1h (gcp.lifespan).

  3. added
    bug
    and removed
    enhancement
    on Aug 6, 2025
  4. sakshamratra0106 commented on Dec 5, 2025

    @sakshamratra0106
    Contributor

    ==> Seems GCS STS doesnt give downscoped token of more than 1 hour by default. Moreover their are no policies or permission that we can tweak to get the TTL extended. There are several use cases which it can affect, any job running more than an hour. Do we know how can we handle this ?

    ==> Below Property act as a dummy till we can enable something from GCS side to honour this property value
    polaris.features."STORAGE_CREDENTIAL_DURATION_SECONDS" | 3600 | The duration of time that vended storage credentials are valid for. Support for longer (or shorter) durations is dependent on the storage provider. GCS current does not respect this value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions