Skip to content

Commit

Permalink
Apply PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmartinezramirez committed Apr 4, 2024
1 parent 1b2204b commit 534b642
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ The following table lists all valid connection properties:
| PROXYPORT | Depends | The port number of the proxy server. <br/> <br/> If USEPROXY is set to `true`, you must set this parameter. <br/> <br/> This parameter was introduced in v2.0.4. |
| PROXYUSER | No | The username for authenticating to the proxy server. <br/> <br/> This parameter was introduced in v2.0.4. |
| PROXYPASSWORD | Depends | The password for authenticating to the proxy server. <br/> <br/> If USEPROXY is `true` and PROXYUSER is set, you must set this parameter. <br/> <br/> 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. <br/> The host target value should fully match with the non proxy host list to be bypass of the proxy server. <br/> <br/> 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. <br/> The host target value should fully match with any item from the proxy host list to bypass the proxy server. <br/> <br/> 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. <br/> If no value provided 1MB will be used as a default value (that is 1048576 bytes). <br/> 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. |
Expand Down
8 changes: 3 additions & 5 deletions Snowflake.Data.Tests/IntegrationTests/SFConnectionIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;";
Expand All @@ -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);
}
}
Expand All @@ -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<SnowflakeDbException>(() => conn.Open());

// Assert
s_logger.Debug("Failed opening connection ", exception);
Assert.AreEqual(270001, exception.ErrorCode);
AssertIsConnectionFailure(exception);
}
Expand Down
2 changes: 1 addition & 1 deletion Snowflake.Data.Tests/SFBaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public SFBaseTestAsync()

protected TestConfig testConfig { get; }

protected string ResolveHostToUseFromTestConfig()
protected string ResolveHost()
{
return testConfig.host ?? $"{testConfig.account}.snowflakecomputing.com";
}
Expand Down

0 comments on commit 534b642

Please sign in to comment.