Skip to content

Commit 8459936

Browse files
Merge remote-tracking branch 'origin/main' into pr-788-tmp
# Conflicts: # NEXT_CHANGELOG.md
2 parents 212ef2f + aa6bdc5 commit 8459936

148 files changed

Lines changed: 771 additions & 241 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codegen/_openapi_sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4d4aa9d257a7e72a77521e7a9e249f526ab77f16
1+
c68a27fa9c9d838e839c584be8018eb3b68377d5

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/CreateOperat
233233
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/CreateVersionRequest.java linguist-generated=true
234234
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/DeleteDeploymentRequest.java linguist-generated=true
235235
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/Deployment.java linguist-generated=true
236+
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/DeploymentMode.java linguist-generated=true
236237
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/DeploymentResourceType.java linguist-generated=true
237238
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/DeploymentStatus.java linguist-generated=true
238239
databricks-sdk-java/src/main/java/com/databricks/sdk/service/bundle/GetDeploymentRequest.java linguist-generated=true
@@ -3141,6 +3142,8 @@ databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/ClusterA
31413142
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/ClusterAutoRestartMessageMaintenanceWindowWeekDayBasedSchedule.java linguist-generated=true
31423143
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/ClusterAutoRestartMessageMaintenanceWindowWeekDayFrequency.java linguist-generated=true
31433144
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/ClusterAutoRestartMessageMaintenanceWindowWindowStartTime.java linguist-generated=true
3145+
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/CollaborationPlatformConnectivityMessage.java linguist-generated=true
3146+
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/CollaborationPlatformConnectivityMessageConnectivity.java linguist-generated=true
31443147
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/GetPublicAccountSettingRequest.java linguist-generated=true
31453148
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/GetPublicAccountUserPreferenceRequest.java linguist-generated=true
31463149
databricks-sdk-java/src/main/java/com/databricks/sdk/service/settingsv2/GetPublicWorkspaceSettingRequest.java linguist-generated=true

.release_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"timestamp": "2026-05-28 09:21:55+0000"
2+
"timestamp": "2026-06-04 09:25:09+0000"
33
}

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Version changelog
22

3+
## Release v0.116.0 (2026-06-04)
4+
5+
### Bug Fixes
6+
7+
- Make the client ID optional in `DatabricksOAuthTokenSource`. Previously `getToken()` threw a
8+
`NullPointerException` ("ClientID cannot be null") when no client ID was set, which prevented
9+
token exchange for users authenticated through a web browser OAuth flow whose IdP JWT does not
10+
contain a client ID. When the client ID is null or empty, the `client_id` parameter is now
11+
omitted from the token exchange request to perform account-wide token federation.
12+
13+
14+
## Release v0.115.0 (2026-06-02)
15+
16+
### API Changes
17+
* Add `deploymentMode` field for `com.databricks.sdk.service.bundle.Deployment`.
18+
* Add `deploymentMode` field for `com.databricks.sdk.service.bundle.Version`.
19+
* Add `collaborationPlatformConnectivity` and `effectiveCollaborationPlatformConnectivity` fields for `com.databricks.sdk.service.settingsv2.Setting`.
20+
21+
22+
## Release v0.114.0 (2026-06-01)
23+
24+
### Internal Changes
25+
* Switch workspace addressing header on workspace-scoped API calls from `X-Databricks-Org-Id` to `X-Databricks-Workspace-Id`. The value continues to come from the `DATABRICKS_WORKSPACE_ID` environment variable / `DatabricksConfig.setWorkspaceId()` setter, and now accepts either a classic numeric workspace ID or another workspace identifier format (server disambiguates). Mirrors [databricks/databricks-sdk-go#1688](https://github.com/databricks/databricks-sdk-go/pull/1688).
26+
27+
### API Changes
28+
* Add `updateTokenManagement()` method for `workspaceClient.tokenManagement()` service.
29+
* Add `deploymentId` and `versionId` fields for `com.databricks.sdk.service.jobs.JobDeployment`.
30+
* Add `deploymentId` and `versionId` fields for `com.databricks.sdk.service.pipelines.PipelineDeployment`.
31+
* Add `autoscopeEnabled` field for `com.databricks.sdk.service.settings.CreateOboTokenRequest`.
32+
* Add `autoscopeEnabled` field for `com.databricks.sdk.service.settings.CreateTokenRequest`.
33+
* Add `autoscopeState`, `backfillScopes`, `inferredScopes` and `scopes` fields for `com.databricks.sdk.service.settings.PublicTokenInfo`.
34+
* Add `autoscopeState`, `backfillScopes`, `inferredScopes` and `scopes` fields for `com.databricks.sdk.service.settings.TokenInfo`.
35+
* Add `resourceType` field for `com.databricks.sdk.service.bundle.Operation`.
36+
37+
338
## Release v0.113.0 (2026-05-28)
439

540
### API Changes

NEXT_CHANGELOG.md

100755100644
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
# NEXT CHANGELOG
22

3-
## Release v0.114.0
3+
## Release v0.117.0
44

55
### New Features and Improvements
6+
* Detect the `AI_AGENT` environment variable (Vercel `@vercel/detect-agent` convention) as a secondary fallback for the AI agent reported in the user agent, consulted only when the agents.md `AGENT` variable is unset or empty. An unrecognized `AGENT` or `AI_AGENT` value is now passed through as-is (sanitized to the user agent allowlist and capped at 64 characters) instead of being reported as `unknown`. Mirrors [databricks/databricks-sdk-go#1683](https://github.com/databricks/databricks-sdk-go/pull/1683).
7+
8+
* Added `Paginator.newTokenPagination(...)` and `Paginator.newOffsetPagination(...)` factory methods in `com.databricks.sdk.support`, which make the pagination strategy explicit. The `Paginator` constructor is now deprecated in favor of these; it keeps its previous (offset/limit) behavior.
69

710
### Breaking Changes
811

912
### Bug Fixes
10-
* Cannonicalize Bearer tokenType in Authorization headers
13+
* Canonicalize Bearer tokenType in Authorization headers
14+
15+
* Fixed `Paginator` silently dropping results when a token-paginated response returned an empty page with a non-empty `next_page_token`. List methods (e.g. `tables().list()`) now keep paging until the page token is absent instead of stopping at the first empty page.
1116

1217
### Security Vulnerabilities
1318

1419
### Documentation
1520

1621
### Internal Changes
17-
* Switch workspace addressing header on workspace-scoped API calls from `X-Databricks-Org-Id` to `X-Databricks-Workspace-Id`. The value continues to come from the `DATABRICKS_WORKSPACE_ID` environment variable / `DatabricksConfig.setWorkspaceId()` setter, and now accepts either a classic numeric workspace ID or another workspace identifier format (server disambiguates). Mirrors [databricks/databricks-sdk-go#1688](https://github.com/databricks/databricks-sdk-go/pull/1688).
1822

1923
### API Changes
20-
* Add `updateTokenManagement()` method for `workspaceClient.tokenManagement()` service.
21-
* Add `deploymentId` and `versionId` fields for `com.databricks.sdk.service.jobs.JobDeployment`.
22-
* Add `deploymentId` and `versionId` fields for `com.databricks.sdk.service.pipelines.PipelineDeployment`.
23-
* Add `autoscopeEnabled` field for `com.databricks.sdk.service.settings.CreateOboTokenRequest`.
24-
* Add `autoscopeEnabled` field for `com.databricks.sdk.service.settings.CreateTokenRequest`.
25-
* Add `autoscopeState`, `backfillScopes`, `inferredScopes` and `scopes` fields for `com.databricks.sdk.service.settings.PublicTokenInfo`.
26-
* Add `autoscopeState`, `backfillScopes`, `inferredScopes` and `scopes` fields for `com.databricks.sdk.service.settings.TokenInfo`.
27-
* Add `resourceType` field for `com.databricks.sdk.service.bundle.Operation`.
2824
* Add `getCanonicalTokenType()` method for `com.databricks.sdk.core.oauth.Token`

databricks-sdk-java/lockfile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"artifactId": "databricks-sdk-java",
33
"groupId": "com.databricks",
4-
"version": "0.113.0",
4+
"version": "0.116.0",
55
"lockFileVersion": 1,
66
"dependencies": [
77
{

databricks-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.databricks</groupId>
77
<artifactId>databricks-sdk-parent</artifactId>
8-
<version>0.113.0</version>
8+
<version>0.116.0</version>
99
</parent>
1010
<artifactId>databricks-sdk-java</artifactId>
1111
<name>Databricks SDK for Java</name>

databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public String getValue() {
3636
// TODO: check if reading from
3737
// /META-INF/maven/com.databricks/databrics-sdk-java/pom.properties
3838
// or getClass().getPackage().getImplementationVersion() is enough.
39-
private static final String version = "0.113.0";
39+
private static final String version = "0.116.0";
4040

4141
public static void withProduct(String product, String productVersion) {
4242
UserAgent.product = product;
@@ -249,12 +249,21 @@ private static class KnownAgent {
249249
}
250250
}
251251

252-
// The agents.md standard env var. When set to a value we don't specifically
253-
// recognize, detection falls back to "unknown".
252+
// The agents.md standard env var. Consulted first when no explicit matcher
253+
// fires.
254254
private static final String AGENT_ENV_VAR = "AGENT";
255255

256+
// The Vercel @vercel/detect-agent convention env var. Consulted only as a
257+
// secondary fallback when AGENT is unset or empty.
258+
private static final String AI_AGENT_ENV_VAR = "AI_AGENT";
259+
260+
// Maximum length of a passed-through fallback agent value. Longer values are
261+
// truncated to keep the user agent header bounded.
262+
private static final int MAX_AGENT_FALLBACK_LEN = 64;
263+
256264
// Canonical list of known AI coding agents.
257-
// Keep this list in sync with databricks-sdk-go and databricks-sdk-py.
265+
// Keep this list, and the AGENT/AI_AGENT fallback handling in
266+
// agentEnvFallback, in sync with databricks-sdk-go and databricks-sdk-py.
258267
// Agents are listed alphabetically by product name.
259268
private static List<KnownAgent> listKnownAgents() {
260269
return Arrays.asList(
@@ -294,9 +303,8 @@ private static List<KnownAgent> listKnownAgents() {
294303
// stacked when one agent invokes another as a subagent (e.g. Claude Code
295304
// spawning a Cursor CLI subprocess), so the child process inherits env
296305
// vars from multiple layers.
297-
// - Zero agents matched: if the agents.md standard AGENT env var is set to
298-
// a known product name, return that product name. If it is set to any
299-
// other non-empty value, return "unknown". Otherwise return "".
306+
// - Zero agents matched: fall back to the generic AGENT / AI_AGENT env
307+
// vars (see agentEnvFallback).
300308
//
301309
// Because explicit matchers win over AGENT, e.g. AGENT=cursor + CLAUDECODE=1
302310
// yields "claude-code", and AGENT=goose + CLAUDECODE=1 also yields
@@ -317,23 +325,29 @@ private static String lookupAgentProvider(Environment env) {
317325
if (matches.size() > 1) {
318326
return "multiple";
319327
}
320-
return agentEnvFallback(env, agents);
328+
return agentEnvFallback(env);
321329
}
322330

323-
// agentEnvFallback honors the agents.md AGENT=<name> standard.
324-
// Returns the value if it matches a known product name, "unknown" if AGENT
325-
// is set to any other non-empty value, and "" if AGENT is unset or empty.
326-
private static String agentEnvFallback(Environment env, List<KnownAgent> agents) {
331+
// agentEnvFallback honors the agents.md AGENT=<name> standard, with the
332+
// Vercel @vercel/detect-agent AI_AGENT convention as a secondary fallback.
333+
// AGENT takes precedence when both are non-empty.
334+
//
335+
// The raw value is passed through (no coercion to "unknown"), but sanitized
336+
// to satisfy the user agent allowlist and capped at MAX_AGENT_FALLBACK_LEN
337+
// characters. Returns "" when both AGENT and AI_AGENT are unset or empty.
338+
private static String agentEnvFallback(Environment env) {
327339
String v = env.get(AGENT_ENV_VAR);
340+
if (v == null || v.isEmpty()) {
341+
v = env.get(AI_AGENT_ENV_VAR);
342+
}
328343
if (v == null || v.isEmpty()) {
329344
return "";
330345
}
331-
for (KnownAgent a : agents) {
332-
if (a.product.equals(v)) {
333-
return v;
334-
}
346+
v = sanitize(v);
347+
if (v.length() > MAX_AGENT_FALLBACK_LEN) {
348+
v = v.substring(0, MAX_AGENT_FALLBACK_LEN);
335349
}
336-
return "unknown";
350+
return v;
337351
}
338352

339353
// Thread-safe lazy initialization of agent provider detection

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/DatabricksOAuthTokenSource.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public static class Builder {
7979
/**
8080
* Creates a new Builder with required parameters.
8181
*
82-
* @param clientId OAuth client ID.
82+
* @param clientId OAuth client ID. May be null or empty for account-wide token federation (e.g.
83+
* users authenticated through a web browser OAuth flow whose IdP JWT has no client ID); in
84+
* that case the client_id parameter is omitted from the token exchange request.
8385
* @param host Databricks host URL.
8486
* @param endpoints OpenID Connect endpoints configuration.
8587
* @param idTokenSource Source of ID tokens.
@@ -147,20 +149,17 @@ public DatabricksOAuthTokenSource build() {
147149
*
148150
* @return A Token containing the access token and related information.
149151
* @throws DatabricksException when the token exchange fails.
150-
* @throws IllegalArgumentException when the required string parameters are empty.
151-
* @throws NullPointerException when any of the required parameters are null.
152+
* @throws IllegalArgumentException when the host is empty.
153+
* @throws NullPointerException when any of the required parameters (host, endpoints,
154+
* idTokenSource, httpClient) are null. The client ID is optional.
152155
*/
153156
@Override
154157
public Token getToken() {
155-
Objects.requireNonNull(clientId, "ClientID cannot be null");
156158
Objects.requireNonNull(host, "Host cannot be null");
157159
Objects.requireNonNull(endpoints, "Endpoints cannot be null");
158160
Objects.requireNonNull(idTokenSource, "IDTokenSource cannot be null");
159161
Objects.requireNonNull(httpClient, "HttpClient cannot be null");
160162

161-
if (clientId.isEmpty()) {
162-
throw new IllegalArgumentException("ClientID cannot be empty");
163-
}
164163
if (host.isEmpty()) {
165164
throw new IllegalArgumentException("Host cannot be empty");
166165
}
@@ -173,7 +172,12 @@ public Token getToken() {
173172
params.put(SUBJECT_TOKEN_PARAM, idToken.getValue());
174173
params.put(SUBJECT_TOKEN_TYPE_PARAM, SUBJECT_TOKEN_TYPE);
175174
params.put(SCOPE_PARAM, String.join(" ", scopes));
176-
params.put(CLIENT_ID_PARAM, clientId);
175+
// The client ID is optional. Service principals (Workload Identity Federation) send it, but
176+
// users authenticated through a web browser OAuth flow have no client ID in their IdP JWT and
177+
// perform account-wide token federation without one.
178+
if (!Strings.isNullOrEmpty(clientId)) {
179+
params.put(CLIENT_ID_PARAM, clientId);
180+
}
177181

178182
OAuthResponse response;
179183
try {

databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsAPI.java

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)