-
Notifications
You must be signed in to change notification settings - Fork 25
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
Use same logic as Go SDK for DatabricksConfig.isAzure() #174
Conversation
@@ -463,7 +463,9 @@ public boolean isAzure() { | |||
if (host == null) { | |||
return false; | |||
} | |||
return host.contains(".azuredatabricks."); | |||
return host.contains(".azuredatabricks.net") |
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.
Curious -- why do we need to limit it to .net
?
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.
I'm just matching the Go SDK logic here. I don't think we use any other TLDs for public cloud.
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.
I see
* Adjust token expiry window to 40 seconds because of Azure ([#170](#170)). * Use same logic as Go SDK for DatabricksConfig.isAzure() ([#174](#174)). API Changes: * Added `attributes`, `count`, `excludedAttributes`, `filter`, `sortBy`, `sortOrder`, and `startIndex` fields for `com.databricks.sdk.service.iam.GetAccountUserRequest` and `com.databricks.sdk.service.iam.GetUserRequest`. * Added `schemas` field for `com.databricks.sdk.service.iam.Group`, `com.databricks.sdk.service.iam.ListGroupsResponse`, `com.databricks.sdk.service.iam.ListServicePrincipalResponse`, `com.databricks.sdk.service.iam.ListUsersResponse`, `com.databricks.sdk.service.iam.ServicePrincipal`, and `com.databricks.sdk.service.iam.User`. * Added `com.databricks.sdk.service.iam.GetSortOrder`, `com.databricks.sdk.service.iam.GroupSchema`, `com.databricks.sdk.service.iam.ListResponseSchema`, `com.databricks.sdk.service.iam.ServicePrincipalSchema`, and `com.databricks.sdk.service.iam.UserSchema` class. * Added `webhookNotifications` field for `com.databricks.sdk.service.jobs.SubmitTask`. * Added `workspaceClient.apps()` service and related classes. * Added `accountClient.networkPolicy()` service and related classes. OpenAPI SHA: 5903bb39137fd76ac384b2044e425f9c56840e00, Date: 2023-10-23 Dependency updates: * Bump org.junit:junit-bom from 5.9.3 to 5.10.0 ([#124](#124)). * Bump org.slf4j:slf4j-api from 2.0.7 to 2.0.9 ([#146](#146)). * Bump org.slf4j:slf4j-reload4j from 2.0.7 to 2.0.9 ([#147](#147)). * Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0 ([#156](#156)).
* Adjust token expiry window to 40 seconds because of Azure ([#170](#170)). * Use same logic as Go SDK for DatabricksConfig.isAzure() ([#174](#174)). API Changes: * Added `attributes`, `count`, `excludedAttributes`, `filter`, `sortBy`, `sortOrder`, and `startIndex` fields for `com.databricks.sdk.service.iam.GetAccountUserRequest` and `com.databricks.sdk.service.iam.GetUserRequest`. * Added `schemas` field for `com.databricks.sdk.service.iam.Group`, `com.databricks.sdk.service.iam.ListGroupsResponse`, `com.databricks.sdk.service.iam.ListServicePrincipalResponse`, `com.databricks.sdk.service.iam.ListUsersResponse`, `com.databricks.sdk.service.iam.ServicePrincipal`, and `com.databricks.sdk.service.iam.User`. * Added `com.databricks.sdk.service.iam.GetSortOrder`, `com.databricks.sdk.service.iam.GroupSchema`, `com.databricks.sdk.service.iam.ListResponseSchema`, `com.databricks.sdk.service.iam.ServicePrincipalSchema`, and `com.databricks.sdk.service.iam.UserSchema` class. * Added `webhookNotifications` field for `com.databricks.sdk.service.jobs.SubmitTask`. * Added `workspaceClient.apps()` service and related classes. * Added `accountClient.networkPolicy()` service and related classes. OpenAPI SHA: 5903bb39137fd76ac384b2044e425f9c56840e00, Date: 2023-10-23 Dependency updates: * Bump org.junit:junit-bom from 5.9.3 to 5.10.0 ([#124](#124)). * Bump org.slf4j:slf4j-api from 2.0.7 to 2.0.9 ([#146](#146)). * Bump org.slf4j:slf4j-reload4j from 2.0.7 to 2.0.9 ([#147](#147)). * Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0 ([#156](#156)).
Changes
The current isAzure() logic only checks if ".azuredatabricks." is contained in the hostname, which fails for workspaces in other Azure environments. This PR copies the logic directly from the Go SDK: https://github.com/databricks/databricks-sdk-go/blob/main/config/config.go#L142
Tests