CurtHagenlocher commented on code in PR #2762: URL: https://github.com/apache/arrow-adbc/pull/2762#discussion_r2071988348
########## csharp/src/Drivers/Databricks/Auth/OAuthDelegatingHandler.cs: ########## @@ -0,0 +1,41 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using System; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Apache.Arrow.Adbc.Drivers.Databricks.Auth; + +internal class OAuthDelegatingHandler : DelegatingHandler Review Comment: Please put into the `Apache.Arrow.Adbc.Drivers.Databricks.Auth` namespace. ########## csharp/src/Drivers/Apache/Spark/SparkHttpConnection.cs: ########## @@ -51,10 +51,15 @@ protected override void ValidateAuthentication() Properties.TryGetValue(AdbcOptions.Password, out string? password); Properties.TryGetValue(SparkParameters.AuthType, out string? authType); Properties.TryGetValue(SparkParameters.AccessToken, out string? access_token); + Properties.TryGetValue(SparkParameters.AuthFlow, out string? authFlow); Review Comment: Instead of a number like "1", is there a descriptive name this could be given e.g. "client_credentials"? Would it make sense to name this "grant_type" instead of "auth_flow"? Is it plausible that OAuth will someday be standardized enough to be implemented by the generic Spark connector or does it make more sense to move these properties to `DatabricksParameters`? Please add these to the Markdown documentation for either the Spark properties or the Databricks properties, as appropriate. Please include the added values in ########## csharp/test/Drivers/Databricks/DatabricksTestConfiguration.cs: ########## @@ -22,6 +22,10 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.Databricks { public class DatabricksTestConfiguration : SparkTestConfiguration { + Review Comment: nit: remove blank line ########## csharp/src/Drivers/Apache/Spark/SparkHttpConnection.cs: ########## @@ -85,10 +90,28 @@ protected override void ValidateAuthentication() break; case SparkAuthType.OAuth: - if (string.IsNullOrWhiteSpace(access_token)) + if (authFlow == "1") Review Comment: Whether "1" or "client_credentials" or some other kind of value, consider either lifting to a constant or creating an `enum` for this purpose. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
