Skip to content

Add OIDC endpoint helper tests#679

Open
hectorcast-db wants to merge 3 commits intomainfrom
hectorcast-db/stack/config-auto-complete-2
Open

Add OIDC endpoint helper tests#679
hectorcast-db wants to merge 3 commits intomainfrom
hectorcast-db/stack/config-auto-complete-2

Conversation

@hectorcast-db
Copy link
Contributor

@hectorcast-db hectorcast-db commented Feb 25, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Summary

Adds tests covering OIDC endpoint resolution directly from a discovery URL, exercising the existing discoveryUrl config field and the getDatabricksOidcEndpoints() short-circuit path.

Why

The OIDC discovery URL returned by /.well-known/databricks-config points to a standard OAuth 2.0 authorization server metadata document (authorization_endpoint, token_endpoint). The Java SDK already has discoveryUrl (DATABRICKS_DISCOVERY_URL) and getDatabricksOidcEndpoints() fetching directly from it when set — this is the Java equivalent of the Python SDK's get_endpoints_from_url() addition. This PR adds the missing test coverage for those paths.

What changed

Interface changes

None. The discoveryUrl config field (DATABRICKS_DISCOVERY_URL) and the getDatabricksOidcEndpoints() short-circuit were already present in the Java SDK.

Behavioral changes

None. No existing code paths are modified.

Internal changes

  • testDiscoveryUrlFromEnv — verifies DATABRICKS_DISCOVERY_URL env var is loaded into discoveryUrl.
  • testDatabricksOidcEndpointsUsesDiscoveryUrl — verifies getDatabricksOidcEndpoints() short-circuits to fetch directly from discoveryUrl when set.

How is this tested?

Unit tests in DatabricksConfigTest using FixtureServer.

NO_CHANGELOG=true

Adds `HostMetadata` and a package-private `getHostMetadata()` on
`DatabricksConfig` for parsing the `/.well-known/databricks-config`
discovery endpoint.

The method returns raw metadata with no substitution (e.g.
`{account_id}` placeholders are left as-is), keeping it a pure
discovery primitive. Callers decide how to interpret the result.
Adds tests covering:
- DATABRICKS_DISCOVERY_URL env var is loaded into Config
- getDatabricksOidcEndpoints() short-circuits to discoveryUrl when set

The underlying implementation (discoveryUrl config field and
getDatabricksOidcEndpoints() short-circuit) was already present in the
Java SDK. Mirrors the Python SDK's get_endpoints_from_url() addition.
@hectorcast-db hectorcast-db changed the title Add tests for discoveryUrl OIDC endpoint resolution Add OIDC endpoint helper tests Feb 25, 2026
@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: 679
  • Commit SHA: 37e2032fd767f99b0c52b6ea57f60dea92e516e1

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db marked this pull request as ready for review February 25, 2026 12:11
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