Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1651983 authenticated proxy on azure #1888

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parent-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<avro.version>1.8.1</avro.version>
<awaitility.version>4.2.0</awaitility.version>
<awssdk.version>1.12.655</awssdk.version>
<azure.storage.version>5.0.0</azure.storage.version>
<azure.storage.version>8.6.6</azure.storage.version>
<bouncycastle.version>1.74</bouncycastle.version>
<bouncycastle.bcfips.version>1.0.2.4</bouncycastle.bcfips.version>
<bouncycastle.bcpkixfips.version>1.0.5</bouncycastle.bcpkixfips.version>
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/net/snowflake/client/core/HttpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,19 @@ public static void setProxyForAzure(HttpClientSettingsKey key, OperationContext
if (key != null && key.usesProxy()) {
Proxy azProxy =
new Proxy(Proxy.Type.HTTP, new InetSocketAddress(key.getProxyHost(), key.getProxyPort()));
logger.debug(
"Setting Azure proxy. Host: {}, port: {}", key.getProxyHost(), key.getProxyPort());
opContext.setProxy(azProxy);
boolean setProxyUser =
!Strings.isNullOrEmpty(key.getProxyUser())
&& !Strings.isNullOrEmpty(key.getProxyPassword());
logger.debug(
"Setting Azure proxy {} user. Host: {}, port: {}",
setProxyUser ? "with" : "without",
key.getProxyHost(),
key.getProxyPort());
if (setProxyUser) {
opContext.setProxyUsername(key.getProxyUser());
opContext.setProxyPassword(key.getProxyPassword());
}
} else {
logger.debug("Omitting Azure proxy setup");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ public void testSetProxyForAzure() {
false);
HttpUtil.setProxyForAzure(testKey, op);
Proxy proxy = op.getProxy();
assertEquals("testuser", op.getProxyUsername());
assertEquals("pw", op.getProxyPassword());
assertEquals(Proxy.Type.HTTP, proxy.type());
assertEquals(new InetSocketAddress("snowflakecomputing.com", 443), proxy.address());
}
Expand Down
Loading