From 534b6423c50b1a36c6e17b6ca672637f3fcf5f92 Mon Sep 17 00:00:00 2001 From: Juan Martinez Ramirez Date: Thu, 4 Apr 2024 07:12:28 -0600 Subject: [PATCH] Apply PR suggestions --- README.md | 2 +- Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs | 8 +++----- Snowflake.Data.Tests/SFBaseTest.cs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0fc3e3325..7c7e65356 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ The following table lists all valid connection properties: | PROXYPORT | Depends | The port number of the proxy server.

If USEPROXY is set to `true`, you must set this parameter.

This parameter was introduced in v2.0.4. | | PROXYUSER | No | The username for authenticating to the proxy server.

This parameter was introduced in v2.0.4. | | PROXYPASSWORD | Depends | The password for authenticating to the proxy server.

If USEPROXY is `true` and PROXYUSER is set, you must set this parameter.

This parameter was introduced in v2.0.4. | -| NONPROXYHOSTS | No | The list of hosts that the driver should connect to directly, bypassing the proxy server. Separate the hostnames with a pipe symbol (\|). You can also use an asterisk (`*`) as a wildcard.
The host target value should fully match with the non proxy host list to be bypass of the proxy server.

This parameter was introduced in v2.0.4. | +| NONPROXYHOSTS | No | The list of hosts that the driver should connect to directly, bypassing the proxy server. Separate the hostnames with a pipe symbol (\|). You can also use an asterisk (`*`) as a wildcard.
The host target value should fully match with any item from the proxy host list to bypass the proxy server.

This parameter was introduced in v2.0.4. | | FILE_TRANSFER_MEMORY_THRESHOLD | No | The maximum number of bytes to store in memory used in order to provide a file encryption. If encrypting/decrypting file size exceeds provided value a temporary file will be created and the work will be continued in the temporary file instead of memory.
If no value provided 1MB will be used as a default value (that is 1048576 bytes).
It is possible to configure any integer value bigger than zero representing maximal number of bytes to reside in memory. | | CLIENT_CONFIG_FILE | No | The location of the client configuration json file. In this file you can configure easy logging feature. | | ALLOWUNDERSCORESINHOST | No | Specifies whether to allow underscores in account names. This impacts PrivateLink customers whose account names contain underscores. In this situation, you must override the default value by setting allowUnderscoresInHost to true. | diff --git a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs index ebdd8cc9b..ca7325f08 100644 --- a/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs @@ -1554,7 +1554,7 @@ public void TestNonProxyHostShouldBypassProxyServer(string regexHost, string pro using (var conn = new SnowflakeDbConnection()) { // Arrange - var host = ResolveHostToUseFromTestConfig(ConnectionString); + var host = this.ResolveHost(); var nonProxyHosts = string.Format(regexHost, $"{host}"); conn.ConnectionString = $"{ConnectionString}USEPROXY=true;PROXYHOST={proxyHost};NONPROXYHOSTS={nonProxyHosts};PROXYPORT=3128;"; @@ -1563,7 +1563,7 @@ public void TestNonProxyHostShouldBypassProxyServer(string regexHost, string pro conn.Open(); // Assert - // If the connection is open, it indicates that the server proxy was bypassed. + // The connection would fail to open if the web proxy would be used because the proxy is configured to a non-existent host. Assert.AreEqual(ConnectionState.Open, conn.State); } } @@ -1585,12 +1585,10 @@ public void TestNonProxyHostShouldNotBypassProxyServer(string regexHost, string $"{ConnectionString}connection_timeout=5;USEPROXY=true;PROXYHOST={proxyHost};NONPROXYHOSTS={nonProxyHosts};PROXYPORT=3128;"; // Act/Assert - // If the nonproxyhosts property fails to bypass the server, the proxy will be use but it will return a exception - // because is not configure in the testing environment so the exception is used to verify that was not bypass. + // The connection would fail to open if the web proxy would be used because the proxy is configured to a non-existent host. var exception = Assert.Throws(() => conn.Open()); // Assert - s_logger.Debug("Failed opening connection ", exception); Assert.AreEqual(270001, exception.ErrorCode); AssertIsConnectionFailure(exception); } diff --git a/Snowflake.Data.Tests/SFBaseTest.cs b/Snowflake.Data.Tests/SFBaseTest.cs index dad45acfc..39bc140f5 100755 --- a/Snowflake.Data.Tests/SFBaseTest.cs +++ b/Snowflake.Data.Tests/SFBaseTest.cs @@ -147,7 +147,7 @@ public SFBaseTestAsync() protected TestConfig testConfig { get; } - protected string ResolveHostToUseFromTestConfig() + protected string ResolveHost() { return testConfig.host ?? $"{testConfig.account}.snowflakecomputing.com"; }