Skip to content

Commit 39220f3

Browse files
committed
Fix spotless + fix next_changelog
1 parent d1c2389 commit 39220f3

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### New Features and Improvements
66

7+
* Add support for discovery URL for browser based authentication flow.
8+
79
### Bug Fixes
810

911
* Fixed `selectSparkVersion()` method to use contains() instead of equals() for spark version matching.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ private OAuthClient(Builder b) throws IOException {
118118
this.hc = b.hc;
119119

120120
DatabricksConfig config =
121-
new DatabricksConfig().setHost(b.host).setAccountId(b.accountId).setDiscoveryUrl(b.discoveryUrl).resolve();
121+
new DatabricksConfig()
122+
.setHost(b.host)
123+
.setAccountId(b.accountId)
124+
.setDiscoveryUrl(b.discoveryUrl)
125+
.resolve();
122126
OpenIDConnectEndpoints oidc = config.getOidcEndpoints();
123127
if (oidc == null) {
124128
throw new DatabricksException(b.host + " does not support OAuth");

databricks-sdk-java/src/test/java/com/databricks/sdk/core/DatabricksConfigTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ public void testDiscoveryEndpoint() throws IOException {
170170
public void testDiscoveryEndpointFetchFallback() throws IOException {
171171
String discoveryUrlSuffix = "/test.discovery.url";
172172
String OIDCResponse =
173-
"{\n"
174-
+ " \"authorization_endpoint\": \"https://test.auth.endpoint/oidc/v1/authorize\",\n"
175-
+ " \"token_endpoint\": \"https://test.auth.endpoint/oidc/v1/token\"\n"
176-
+ "}";
173+
"{\n"
174+
+ " \"authorization_endpoint\": \"https://test.auth.endpoint/oidc/v1/authorize\",\n"
175+
+ " \"token_endpoint\": \"https://test.auth.endpoint/oidc/v1/token\"\n"
176+
+ "}";
177177

178178
try (FixtureServer server =
179-
new FixtureServer()
180-
.with("GET", discoveryUrlSuffix, "", 400)
181-
.with("GET", "/oidc/.well-known/oauth-authorization-server", OIDCResponse, 200)) {
179+
new FixtureServer()
180+
.with("GET", discoveryUrlSuffix, "", 400)
181+
.with("GET", "/oidc/.well-known/oauth-authorization-server", OIDCResponse, 200)) {
182182

183183
String discoveryUrl = server.getUrl() + discoveryUrlSuffix;
184184

0 commit comments

Comments
 (0)