Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fixed non-JSON error responses (e.g. plain-text "Invalid Token" with HTTP 403) producing `Unknown` instead of the correct typed exception (`PermissionDenied`, `Unauthenticated`, etc.). The error message no longer contains Jackson deserialization internals.
* Added `X-Databricks-Org-Id` header to deprecated workspace SCIM APIs (Groups, ServicePrincipals, Users) for SPOG host compatibility.
* Fixed Databricks CLI authentication to detect when the cached token's scopes don't match the SDK's configured scopes. Previously, a scope mismatch was silently ignored, causing requests to use wrong permissions. The SDK now raises an error with instructions to re-authenticate.
* Fixed `NullPointerException` in `UserAgent.env()` when the `PATH` environment variable is not set ([#550](https://github.com/databricks/databricks-sdk-java/issues/550)).

### Security Vulnerabilities

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,9 @@ private static String agentProvider() {

private static Environment env() {
if (env == null) {
env =
new Environment(
System.getenv(),
System.getenv("PATH").split(File.pathSeparator),
System.getProperty("os.name"));
String pathEnv = System.getenv("PATH");
String[] pathEntries = pathEnv != null ? pathEnv.split(File.pathSeparator) : new String[0];
env = new Environment(System.getenv(), pathEntries, System.getProperty("os.name"));
}
return env;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,16 @@ public void testAgentProviderEmptyValue() {
Assertions.assertFalse(UserAgent.asString().contains("agent/"));
}

@Test
public void testEnvWithNullPath() {
UserAgent.env =
new Environment(new HashMap<>(), new ArrayList<>(), System.getProperty("os.name"));
UserAgent.cicdProvider = null;
UserAgent.agentProvider = null;
String userAgent = UserAgent.asString();
Assertions.assertTrue(userAgent.contains("databricks-sdk-java/"));
}

@Test
public void testAgentProviderCached() {
// Set up with cursor agent
Expand Down
Loading