use of com.amazonaws.ClientConfiguration in project pipeline-aws-plugin by jenkinsci.
the class ProxyTest method shouldSetNonProxyHosts.
@Test
public void shouldSetNonProxyHosts() throws Exception {
EnvVars vars = new EnvVars();
vars.put(ProxyConfiguration.NO_PROXY, "127.0.0.1,localhost");
vars.put(ProxyConfiguration.HTTPS_PROXY, "http://127.0.0.1:8888/");
ClientConfiguration config = new ClientConfiguration();
config.setProtocol(Protocol.HTTPS);
ProxyConfiguration.configure(vars, config);
Assert.assertEquals("127.0.0.1|localhost", config.getNonProxyHosts());
}
use of com.amazonaws.ClientConfiguration in project pipeline-aws-plugin by jenkinsci.
the class ProxyTest method shouldParseProxyWithoutPort.
@Test
public void shouldParseProxyWithoutPort() throws Exception {
EnvVars vars = new EnvVars();
vars.put(ProxyConfiguration.HTTPS_PROXY, "http://127.0.0.1/");
ClientConfiguration config = new ClientConfiguration();
config.setProtocol(Protocol.HTTPS);
ProxyConfiguration.configure(vars, config);
Assert.assertNull(config.getProxyUsername());
Assert.assertNull(config.getProxyPassword());
Assert.assertEquals("127.0.0.1", config.getProxyHost());
Assert.assertEquals(443, config.getProxyPort());
}
use of com.amazonaws.ClientConfiguration in project pipeline-aws-plugin by jenkinsci.
the class ProxyTest method shouldSetNonProxyHostsLowerCase.
@Test
public void shouldSetNonProxyHostsLowerCase() throws Exception {
EnvVars vars = new EnvVars();
vars.put(ProxyConfiguration.NO_PROXY_LC, "127.0.0.1,localhost");
vars.put(ProxyConfiguration.HTTPS_PROXY, "http://127.0.0.1:8888/");
ClientConfiguration config = new ClientConfiguration();
config.setProtocol(Protocol.HTTPS);
ProxyConfiguration.configure(vars, config);
Assert.assertEquals("127.0.0.1|localhost", config.getNonProxyHosts());
}
use of com.amazonaws.ClientConfiguration in project pipeline-aws-plugin by jenkinsci.
the class AWSClientFactory method getClientConfiguration.
private static ClientConfiguration getClientConfiguration(EnvVars vars) {
ClientConfiguration clientConfiguration = new ClientConfiguration();
// the default max retry is 3. Increasing this to be more resilient to upstream errors
clientConfiguration.setRetryPolicy(new RetryPolicy(null, null, 10, false));
ProxyConfiguration.configure(vars, clientConfiguration);
return clientConfiguration;
}
use of com.amazonaws.ClientConfiguration in project iaf by ibissource.
the class AmazonS3FileSystem method getProxyConfig.
// public String getDestinationBucketName() {
// return destinationBucketName;
// }
//
// public void setDestinationBucketName(String destinationBucketName) {
// this.destinationBucketName = destinationBucketName;
// }
// public String getBucketRegion() {
// return bucketRegion;
// }
//
// public void setBucketRegion(String bucketRegion) {
// this.bucketRegion = bucketRegion;
// }
// public String getStorageClass() {
// return storageClass;
// }
//
// public void setStorageClass(String storageClass) {
// this.storageClass = storageClass;
// }
// public String getTier() {
// return tier;
// }
//
// public void setTier(String tier) {
// this.tier = tier;
// }
// public int getExpirationInDays() {
// return expirationInDays;
// }
//
// public void setExpirationInDays(int experationInDays) {
// this.expirationInDays = experationInDays;
// }
// public boolean isStorageClassEnabled() {
// return storageClassEnabled;
// }
//
// public void setStorageClassEnabled(boolean storageClassEnabled) {
// this.storageClassEnabled = storageClassEnabled;
// }
// public boolean isBucketCreationEnabled() {
// return bucketCreationEnabled;
// }
// public void setBucketCreationEnabled(boolean bucketCreationEnabled) {
// this.bucketCreationEnabled = bucketCreationEnabled;
// }
//
// public boolean isBucketExistsThrowException() {
// return bucketExistsThrowException;
// }
public ClientConfiguration getProxyConfig() {
ClientConfiguration proxyConfig = null;
if (this.getProxyHost() != null && this.getProxyPort() != null) {
proxyConfig = new ClientConfiguration();
proxyConfig.setProtocol(Protocol.HTTPS);
proxyConfig.setProxyHost(this.getProxyHost());
proxyConfig.setProxyPort(this.getProxyPort());
}
return proxyConfig;
}
Aggregations