@@ -242,7 +242,7 @@ public TokenSource getTokenSource() {
242242 return (TokenSource ) headerFactory ;
243243 }
244244 return new ErrorTokenSource (
245- String .format ("OAuth Token not supported for current auth type %s" , authType ));
245+ String .format ("OAuth Token not supported for current auth type %s" , authType ));
246246 }
247247
248248 public CredentialsProvider getCredentialsProvider () {
@@ -434,13 +434,17 @@ public DatabricksConfig setAzureUseMsi(boolean azureUseMsi) {
434434 return this ;
435435 }
436436
437- /** @deprecated Use {@link #getAzureUseMsi()} instead. */
437+ /**
438+ * @deprecated Use {@link #getAzureUseMsi()} instead.
439+ */
438440 @ Deprecated ()
439441 public boolean getAzureUseMSI () {
440442 return azureUseMsi ;
441443 }
442444
443- /** @deprecated Use {@link #getAzureUseMsi()} instead. */
445+ /**
446+ * @deprecated Use {@link #getAzureUseMsi()} instead.
447+ */
444448 @ Deprecated
445449 public DatabricksConfig setAzureUseMSI (boolean azureUseMsi ) {
446450 this .azureUseMsi = azureUseMsi ;
@@ -657,10 +661,10 @@ public OpenIDConnectEndpoints getOidcEndpoints() throws IOException {
657661 }
658662 } catch (Exception e ) {
659663 LOG .warn (
660- "Failed to fetch OIDC Endpoints using discovery URL: {}. Error: {}. \n Defaulting to fetch OIDC using default endpoint." ,
661- discoveryUrl ,
662- e .getMessage (),
663- e );
664+ "Failed to fetch OIDC Endpoints using discovery URL: {}. Error: {}. \n Defaulting to fetch OIDC using default endpoint." ,
665+ discoveryUrl ,
666+ e .getMessage (),
667+ e );
664668 }
665669 return fetchDefaultOidcEndpoints ();
666670 }
@@ -691,22 +695,22 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
691695 return null ;
692696 }
693697 return new OpenIDConnectEndpoints (
694- realAuthUrl .replaceAll ("/authorize" , "/token" ), realAuthUrl );
698+ realAuthUrl .replaceAll ("/authorize" , "/token" ), realAuthUrl );
695699 }
696700 if (isAccountClient () && getAccountId () != null ) {
697701 String prefix = getHost () + "/oidc/accounts/" + getAccountId ();
698702 return new OpenIDConnectEndpoints (prefix + "/v1/token" , prefix + "/v1/authorize" );
699703 }
700704
701705 ApiClient apiClient =
702- new ApiClient .Builder ()
703- .withHttpClient (getHttpClient ())
704- .withGetHostFunc (v -> getHost ())
705- .build ();
706+ new ApiClient .Builder ()
707+ .withHttpClient (getHttpClient ())
708+ .withGetHostFunc (v -> getHost ())
709+ .build ();
706710 try {
707711 return apiClient .execute (
708- new Request ("GET" , "/oidc/.well-known/oauth-authorization-server" ),
709- OpenIDConnectEndpoints .class );
712+ new Request ("GET" , "/oidc/.well-known/oauth-authorization-server" ),
713+ OpenIDConnectEndpoints .class );
710714 } catch (IOException e ) {
711715 throw new DatabricksException ("IO error: " + e .getMessage (), e );
712716 }
@@ -773,18 +777,18 @@ public DatabricksConfig clone() {
773777
774778 public DatabricksConfig newWithWorkspaceHost (String host ) {
775779 Set <String > fieldsToSkip =
776- new HashSet <>(
777- Arrays .asList (
778- // The config for WorkspaceClient has a different host and Azure Workspace resource
779- // ID, and also omits
780- // the account ID.
781- "host" ,
782- "accountId" ,
783- "azureWorkspaceResourceId" ,
784- // For cloud-native OAuth, we need to reauthenticate as the audience has changed, so
785- // don't cache the
786- // header factory.
787- "headerFactory" ));
780+ new HashSet <>(
781+ Arrays .asList (
782+ // The config for WorkspaceClient has a different host and Azure Workspace resource
783+ // ID, and also omits
784+ // the account ID.
785+ "host" ,
786+ "accountId" ,
787+ "azureWorkspaceResourceId" ,
788+ // For cloud-native OAuth, we need to reauthenticate as the audience has changed, so
789+ // don't cache the
790+ // header factory.
791+ "headerFactory" ));
788792 return clone (fieldsToSkip ).setHost (host );
789793 }
790794
0 commit comments