-
Notifications
You must be signed in to change notification settings - Fork 36
Add method to fetch Host Metadata #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hectorcast-db
merged 2 commits into
main
from
hectorcast-db/stack/config-auto-complete-1
Feb 27, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/HostMetadata.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package com.databricks.sdk.core.oauth; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| /** | ||
| * [Experimental] Parsed response from the /.well-known/databricks-config discovery endpoint. | ||
| * | ||
| * <p><b>Note:</b> This API is experimental and may change or be removed in future releases without | ||
| * notice. | ||
| */ | ||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public class HostMetadata { | ||
| @JsonProperty("oidc_endpoint") | ||
| private String oidcEndpoint; | ||
|
|
||
| @JsonProperty("account_id") | ||
| private String accountId; | ||
|
|
||
| @JsonProperty("workspace_id") | ||
| private String workspaceId; | ||
|
|
||
| public HostMetadata() {} | ||
|
|
||
| public HostMetadata(String oidcEndpoint, String accountId, String workspaceId) { | ||
| this.oidcEndpoint = oidcEndpoint; | ||
| this.accountId = accountId; | ||
| this.workspaceId = workspaceId; | ||
| } | ||
|
|
||
| public String getOidcEndpoint() { | ||
| return oidcEndpoint; | ||
| } | ||
|
|
||
| public String getAccountId() { | ||
| return accountId; | ||
| } | ||
|
|
||
| public String getWorkspaceId() { | ||
| return workspaceId; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on checking only for 200 vs making it flexible with other status codes 2xx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the server is returning a valid response, 200 is enough here:
────────────────────────────────────────
Code: 200
Name: OK
Meaning: Request succeeded, body contains the resource
Why it doesn't apply: This is the only valid response — a GET
for a config document should return the document.
────────────────────────────────────────
Code: 201
Name: Created
Meaning: A new resource was created
Why it doesn't apply: Only for POST/PUT that creates a
resource. A read-only GET cannot create anything.
────────────────────────────────────────
Code: 202
Name: Accepted
Meaning: Request accepted for async processing
Why it doesn't apply: Implies the response body is not yet
available — we'd have nothing to parse.
────────────────────────────────────────
Code: 203
Name: Non-Authoritative Information
Meaning: Response from a proxy/cache, not the origin server
Why it doesn't apply: The body might be valid, but this
signals
the data may be stale or transformed. Not something we'd
expect from a well-known endpoint.
────────────────────────────────────────
Code: 204
Name: No Content
Meaning: Success but no body
Why it doesn't apply: The body would be empty —
ObjectMapper.readValue would throw, and a config endpoint
with no config is meaningless.
────────────────────────────────────────
Code: 205
Name: Reset Content
Meaning: Success, client should reset its view
Why it doesn't apply: Intended for form resets in browsers;
has
no semantic meaning for an API client.
────────────────────────────────────────
Code: 206
Name: Partial Content
Meaning: Response is a byte-range chunk
Why it doesn't apply: Only for range requests (Range: header).
────────────────────────────────────────
Code: 207
Name: Multi-Status
Meaning: Multiple status codes in a single body (WebDAV)
Why it doesn't apply: WebDAV-specific. Not part of HTTP for a
REST endpoint.
────────────────────────────────────────
Code: 208
Name: Already Reported
Meaning: Resource already listed earlier (WebDAV)
Why it doesn't apply: WebDAV-specific, same as above.
────────────────────────────────────────
Code: 226
Name: IM Used
Meaning: Response is a delta encoding
Why it doesn't apply: Requires the client to send A-IM: header