Skip to content

Make GCP SA token refresh non-blocking with warning on failure#716

Closed
hectorcast-db wants to merge 7 commits intomainfrom
hectorcast-db/stack/port-7-gcp-sa-nonblocking
Closed

Make GCP SA token refresh non-blocking with warning on failure#716
hectorcast-db wants to merge 7 commits intomainfrom
hectorcast-db/stack/port-7-gcp-sa-nonblocking

Conversation

@hectorcast-db
Copy link
Contributor

🥞 Stacked PR

Use this link to review incremental changes.


Summary

Port of Go SDK #1544. The GCP SA access token
(X-Databricks-GCP-SA-Access-Token) refresh is now non-blocking in both
GoogleIdCredentialsProvider and GoogleCredentialsCredentialsProvider.
On failure, a warning is logged and the header is skipped instead of
throwing an exception. The token is also now always attempted regardless
of client type (not just for ACCOUNT clients).

Co-authored-by: Isaac

Why

What changed

Interface changes

Behavioral changes

Internal changes

How is this tested?

Port of Go SDK #1512. Adds a `cloud` field (String, `@JsonProperty("cloud")`)
to the HostMetadata class, with getter and updated constructor. Includes
deserialization and constructor tests.

Co-authored-by: Isaac
Port of Go SDK #1517. Previously getWorkspaceClient() mutated the
AccountClient's own config when setting workspaceId for unified hosts,
causing stale state on subsequent calls. Now clones the config instead.

Co-authored-by: Isaac
Port of Go SDK #1518. Verifies that getWorkspaceClient() on a unified
(SPOG) host clones the config rather than mutating the AccountClient's
config, so multiple calls produce independent WorkspaceClients.

Co-authored-by: Isaac
Port of Go SDK #1542. Calls resolveHostMetadata() during config
resolve() to populate accountId, workspaceId, and discoveryUrl from
the host's well-known endpoint. Failures are logged at debug level
and do not block initialization. Also fixes clone() to skip static
fields (needed for the new Logger field).

Co-authored-by: Isaac
Port of Go SDK #1543. When resolveHostMetadata() runs on an account
host and tokenAudience is not already set, automatically sets it to
the accountId. This enables OIDC token exchange to work correctly
for account-level operations without explicit TOKEN_AUDIENCE config.

Co-authored-by: Isaac
Port of Go SDK #1547. Removes HostType.UNIFIED and all runtime checks
of experimentalIsUnifiedHost. Host type is now determined solely from
URL pattern (accounts.* = ACCOUNTS, else WORKSPACE). Host metadata
resolution from /.well-known/databricks-config (added in PR 4) handles
populating accountId, workspaceId, and discoveryUrl automatically.

Key changes:
- getHostType(): no longer returns UNIFIED
- isAccountClient(): no longer throws for unified hosts
- getClientType(): simplified, no UNIFIED case
- fetchDefaultOidcEndpoints(): removed unified OIDC branch
- DatabricksCliCredentialsProvider: removed --experimental-is-unified-host
- AccountClient.getWorkspaceClient(): uses DNS zone matching (like Go SDK)
  to decide whether to reuse host or build deployment URL

Co-authored-by: Isaac
Port of Go SDK #1544. The GCP SA access token
(X-Databricks-GCP-SA-Access-Token) refresh is now non-blocking in both
GoogleIdCredentialsProvider and GoogleCredentialsCredentialsProvider.
On failure, a warning is logged and the header is skipped instead of
throwing an exception. The token is also now always attempted regardless
of client type (not just for ACCOUNT clients).

Co-authored-by: Isaac
@github-actions
Copy link

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 716
  • Commit SHA: c75844a15e3d1570ff1e09012bc31491fd359de5

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db deleted the hectorcast-db/stack/port-7-gcp-sa-nonblocking branch March 19, 2026 10:09
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