davidhcoe commented on code in PR #1323:
URL: https://github.com/apache/arrow-adbc/pull/1323#discussion_r1411204055


##########
csharp/test/Drivers/Snowflake/ClientTests.cs:
##########
@@ -228,42 +230,37 @@ private Adbc.Client.AdbcConnection 
GetSnowflakeAdbcConnectionUsingConnectionStri
             builder[SnowflakeParameters.HOST] = testConfiguration.Host;
             builder[SnowflakeParameters.DATABASE] = testConfiguration.Database;
             builder[SnowflakeParameters.USERNAME] = testConfiguration.User;
-            if 
(!string.IsNullOrEmpty(testConfiguration.AuthenticationTokenPath))
+            if (authType == SnowflakeAuthentication.AuthJwt)
             {
-                builder[SnowflakeParameters.AUTH_TYPE] = 
testConfiguration.AuthenticationType;
-                string privateKey = 
File.ReadAllText(testConfiguration.AuthenticationTokenPath);
-                if (testConfiguration.AuthenticationType.Equals("auth_jwt", 
StringComparison.OrdinalIgnoreCase))
+                string privateKey = 
testConfiguration.Authentication.SnowflakeJwt.PrivateKey;
+                builder[SnowflakeParameters.AUTH_TYPE] = 
SnowflakeAuthentication.AuthJwt;
+                builder[SnowflakeParameters.PKCS8_VALUE] = privateKey;
+                builder[SnowflakeParameters.USERNAME] = 
testConfiguration.Authentication.SnowflakeJwt.User;
+                if 
(!string.IsNullOrEmpty(testConfiguration.Authentication.SnowflakeJwt.PrivateKeyPassPhrase))
                 {
-                    builder[SnowflakeParameters.PKCS8_VALUE] = privateKey;
-                    if(!string.IsNullOrEmpty(testConfiguration.Pkcs8Passcode))
-                    {
-                        builder[SnowflakeParameters.PKCS8_PASS] = 
testConfiguration.Pkcs8Passcode;
-                    }
+                    builder[SnowflakeParameters.PKCS8_PASS] = 
testConfiguration.Authentication.SnowflakeJwt.PrivateKeyPassPhrase;
+                }
+            }
+            else if (authType == SnowflakeAuthentication.AuthOAuth)
+            {
+                builder[SnowflakeParameters.AUTH_TYPE] = 
SnowflakeAuthentication.AuthOAuth;
+                builder[SnowflakeParameters.AUTH_TOKEN] = 
testConfiguration.Authentication.OAuth.Token;
+                if (testConfiguration.Authentication.OAuth.User != null)
+                {
+                    builder[SnowflakeParameters.USERNAME] = 
testConfiguration.Authentication.OAuth.User;
                 }
             }
-            else
+            else if (string.IsNullOrEmpty(authType) || authType == 
SnowflakeAuthentication.AuthSnowflake)
             {
-                builder[SnowflakeParameters.PASSWORD] = 
testConfiguration.Password;
+                // if no auth type is specified, use the snowflake auth
+                builder[SnowflakeParameters.USERNAME] = 
testConfiguration.Authentication.Default.User;

Review Comment:
   this needs to specify the auth type



-- 
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]

Reply via email to