Skip to content

Add method to fetch Host Metadata#678

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

Add method to fetch Host Metadata#678
hectorcast-db wants to merge 2 commits intomainfrom
hectorcast-db/stack/config-auto-complete-1

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 HostMetadata and a package-private getHostMetadata() on DatabricksConfig for parsing the /.well-known/databricks-config discovery endpoint.

Why

Databricks hosts expose a standard /.well-known/databricks-config endpoint that returns the OIDC endpoint, account ID, and workspace ID in a single request. The SDK had no primitive to consume it — OIDC endpoint discovery was handled entirely through host-type-specific logic that requires the caller to already know whether the host is a workspace, account console, or unified host.

This PR introduces the foundational building block: a HostMetadata class and a package-private getHostMetadata() on DatabricksConfig that fetches and parses the 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.

What changed

Interface changes

  • HostMetadata — New class in com.databricks.sdk.core.oauth with fields oidcEndpoint, accountId, workspaceId. Deserialized from JSON via Jackson.
  • DatabricksConfig.getHostMetadata() (package-private) — Fetches {host}/.well-known/databricks-config and returns a HostMetadata. Throws DatabricksException on any HTTP error.

Behavioral changes

None. No existing code paths are modified.

Internal changes

Tests in DatabricksConfigTest covering the two response shapes (workspace with static OIDC endpoint, account host with {account_id} template) and the HTTP error path.

How is this tested?

Unit tests in DatabricksConfigTest using FixtureServer. Both workspace and account host response shapes are exercised, plus an HTTP error case.

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.
@hectorcast-db hectorcast-db changed the title Add HostMetadata class and getHostMetadata() Add method to fetch Host Metadata 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: 678
  • Commit SHA: 403558f95de49b680f8e84f72eecf1efa133e21d

Checks will be approved automatically on success.

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