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


##########
csharp/test/Drivers/Snowflake/ClientTests.cs:
##########
@@ -228,22 +228,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 privateKeyFile = 
testConfiguration.Authentication.SnowflakeJwt.PrivateKeyFile;
+                string privateKey = 
testConfiguration.Authentication.SnowflakeJwt.PrivateKey;
+
+                if (privateKeyFile != null)
                 {
-                    builder[SnowflakeParameters.PKCS8_VALUE] = privateKey;
-                    if(!string.IsNullOrEmpty(testConfiguration.Pkcs8Passcode))
-                    {
-                        builder[SnowflakeParameters.PKCS8_PASS] = 
testConfiguration.Pkcs8Passcode;
-                    }
+                    privateKey = File.ReadAllText(privateKeyFile);
+                }
+                builder[SnowflakeParameters.AUTH_TYPE] = 
SnowflakeAuthentication.AuthJwt;

Review Comment:
   Directly use the parameter value



##########
csharp/test/Drivers/Snowflake/ClientTests.cs:
##########
@@ -228,22 +228,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 privateKeyFile = 
testConfiguration.Authentication.SnowflakeJwt.PrivateKeyFile;
+                string privateKey = 
testConfiguration.Authentication.SnowflakeJwt.PrivateKey;
+
+                if (privateKeyFile != null)
                 {
-                    builder[SnowflakeParameters.PKCS8_VALUE] = privateKey;
-                    if(!string.IsNullOrEmpty(testConfiguration.Pkcs8Passcode))
-                    {
-                        builder[SnowflakeParameters.PKCS8_PASS] = 
testConfiguration.Pkcs8Passcode;
-                    }
+                    privateKey = File.ReadAllText(privateKeyFile);
+                }
+                builder[SnowflakeParameters.AUTH_TYPE] = 
SnowflakeAuthentication.AuthJwt;

Review Comment:
   Done



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