Skip to content

Move cloud-based credential filtering into DefaultCredentialsProvider#690

Open
hectorcast-db wants to merge 2 commits intomainfrom
move-cloud-filtering-to-default-credentials
Open

Move cloud-based credential filtering into DefaultCredentialsProvider#690
hectorcast-db wants to merge 2 commits intomainfrom
move-cloud-filtering-to-default-credentials

Conversation

@hectorcast-db
Copy link
Contributor

Summary

Port of databricks/databricks-sdk-go#1505 to the Java SDK.

  • Removes per-provider isAzure()/isGcp() checks from individual credential providers (AzureCliCredentialsProvider, AzureServicePrincipalCredentialsProvider, AzureGithubOidcCredentialsProvider, GoogleCredentialsCredentialsProvider, GoogleIdCredentialsProvider)
  • Centralizes cloud filtering in DefaultCredentialsProvider via a static CLOUD_REQUIREMENTS map: Azure strategies are skipped on GCP/AWS hosts and GCP strategies are skipped on Azure/AWS hosts in auto-detect mode
  • When authType is explicitly set, cloud filtering is bypassed entirely so users can request any strategy regardless of detected host cloud (e.g. azure-cli on a GCP host)
  • Adds DefaultCredentialsProviderTest with unit tests verifying skip-on-mismatch and bypass-on-explicit-authType behaviour

Test plan

  • DefaultCredentialsProviderTest#testCloudFiltering_SkipsOnCloudMismatch — azure-cli is skipped on a GCP host in auto-detect mode
  • DefaultCredentialsProviderTest#testCloudFiltering_BypassesOnExplicitAuthType — azure-cli is called on a GCP host when authType is explicitly set
  • AzureCliCredentialsProviderTest, AzureGithubOidcCredentialsProviderTest, AzureServicePrincipalCredentialsProviderTest — all pass
  • Run mvn test — 62 tests, 0 failures

🤖 Generated with Claude Code

Azure strategies (azure-cli, azure-client-secret, github-oidc-azure) are
now skipped on GCP/AWS hosts in auto-detect mode. GCP strategies
(google-credentials, google-id) are skipped on Azure/AWS hosts.

When authType is explicitly set, cloud filtering is bypassed so the named
strategy is always attempted regardless of host cloud.

Individual credential providers no longer perform their own isAzure()/isGcp()
checks — that responsibility now lives centrally in DefaultCredentialsProvider
via a CLOUD_REQUIREMENTS map, mirroring the approach taken in
databricks/databricks-sdk-go#1505.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

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: 690
  • Commit SHA: 15ce41ca571208ba2e6628a392d2507dcc7fbbb6

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db requested a review from tanmay-db March 5, 2026 08:28
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