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


##########
go/adbc/driver/snowflake/driver_test.go:
##########
@@ -672,3 +673,89 @@ func (suite *SnowflakeTests) TestUseHighPrecision() {
        suite.Equal(1234567.89, rec.Column(1).(*array.Float64).Value(0))
        suite.Equal(9876543210.99, rec.Column(1).(*array.Float64).Value(1))
 }
+
+func TestJwtAuthenticationUnencryptedValue(t *testing.T) {
+       // test doesn't participate in SnowflakeTests because
+       // JWT auth has a different behavior
+       uri, ok := os.LookupEnv("SNOWFLAKE_URI")
+       if !ok {
+               t.Skip("Cannot find the `SNOWFLAKE_URI` value")
+       }
+
+       keyValue, ok := os.LookupEnv("SNOWFLAKE_TEST_PKCS8_VALUE")
+       if !ok {
+               t.Skip("Cannot find the `SNOWFLAKE_TEST_PKCS8_VALUE` value")
+       }
+
+       ConnectWithJwt(uri, keyValue, "")
+}
+
+func TestJwtAuthenticationEncryptedValue(t *testing.T) {
+       // test doesn't participate in SnowflakeTests because
+       // JWT auth has a different behavior
+       uri, ok := os.LookupEnv("SNOWFLAKE_URI")
+       if !ok {
+               t.Skip("Cannot find the `SNOWFLAKE_URI` value")
+       }
+
+       keyValue, ok := os.LookupEnv("SNOWFLAKE_TEST_PKCS8_EN_VALUE")
+       if !ok {
+               t.Skip("Cannot find the `SNOWFLAKE_TEST_PKCS8_EN_VALUE` value")
+       }
+
+       passcode, ok := os.LookupEnv("SNOWFLAKE_TEST_PKCS8_PASS")
+       if !ok {
+               t.Skip("Cannot find the `SNOWFLAKE_TEST_PKCS8_PASS` value")
+       }
+
+       ConnectWithJwt(uri, keyValue, passcode)
+}
+
+func ConnectWithJwt(uri, keyValue, passcode string) {
+
+       // Windows funkiness
+       if runtime.GOOS == "windows" {
+               keyValue = strings.ReplaceAll(keyValue, "\\r", "\r")
+               keyValue = strings.ReplaceAll(keyValue, "\\n", "\n")
+       }

Review Comment:
   when you put the values in the environment variables with the line breaks, 
lovely Windows returns them as `\\r` and `\\n` instead of `\r` and `\n' because 
it's fun like that.



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