Skip to content

Commit dcb6b5e

Browse files
authored
Merge branch 'main' into registry/fix-sonar-issues
2 parents 6072615 + 8c636ee commit dcb6b5e

File tree

61 files changed

+989
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+989
-70
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.26"
2+
".": "0.2.27"
33
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [0.2.27](https://github.com/salesforce/multicloudj/compare/multicloudj-v0.2.26...multicloudj-v0.2.27) (2026-03-04)
4+
5+
6+
### Blob Store
7+
8+
* extend retry strategy to GCP ([#298](https://github.com/salesforce/multicloudj/issues/298)) ([a22c4b0](https://github.com/salesforce/multicloudj/commit/a22c4b063c7fc84978891a1d89c4d670fb1123d5))
9+
* override proxy configs ([#318](https://github.com/salesforce/multicloudj/issues/318)) ([d148a85](https://github.com/salesforce/multicloudj/commit/d148a85922ce15356d40d7d537f57dfd5e87bf3c))
10+
11+
12+
### IAM
13+
14+
* fix bugs in AWS IAM ([#311](https://github.com/salesforce/multicloudj/issues/311)) ([e741a87](https://github.com/salesforce/multicloudj/commit/e741a87378b1ff059633b5ad548a4004a5d7a781))
15+
316
## [0.2.26](https://github.com/salesforce/multicloudj/compare/multicloudj-v0.2.25...multicloudj-v0.2.26) (2026-02-25)
417

518

blob/blob-ali/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.salesforce.multicloudj</groupId>
1111
<artifactId>blob</artifactId>
12-
<version>0.2.27-SNAPSHOT</version>
12+
<version>0.2.28-SNAPSHOT</version>
1313
<relativePath>../pom.xml</relativePath>
1414
</parent>
1515

blob/blob-aws/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.salesforce.multicloudj</groupId>
1111
<artifactId>blob</artifactId>
12-
<version>0.2.27-SNAPSHOT</version>
12+
<version>0.2.28-SNAPSHOT</version>
1313
<relativePath>../pom.xml</relativePath>
1414
</parent>
1515

blob/blob-aws/src/main/java/com/salesforce/multicloudj/blob/aws/AwsBlobClient.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,21 @@ private static S3Client buildS3Client(Builder builder) {
9393
if (builder.getEndpoint() != null) {
9494
b.endpointOverride(builder.getEndpoint());
9595
}
96-
if (builder.getProxyEndpoint() != null) {
97-
ProxyConfiguration proxyConfig = ProxyConfiguration.builder()
98-
.endpoint(builder.getProxyEndpoint())
99-
.build();
96+
if (builder.getProxyEndpoint() != null
97+
|| builder.getUseSystemPropertyProxyValues() != null
98+
|| builder.getUseEnvironmentVariableProxyValues() != null) {
99+
ProxyConfiguration.Builder proxyConfigBuilder = ProxyConfiguration.builder();
100+
if (builder.getProxyEndpoint() != null) {
101+
proxyConfigBuilder.endpoint(builder.getProxyEndpoint());
102+
}
103+
if (builder.getUseSystemPropertyProxyValues() != null) {
104+
proxyConfigBuilder.useSystemPropertyValues(builder.getUseSystemPropertyProxyValues());
105+
}
106+
if (builder.getUseEnvironmentVariableProxyValues() != null) {
107+
proxyConfigBuilder.useEnvironmentVariableValues(builder.getUseEnvironmentVariableProxyValues());
108+
}
100109
b.httpClient(ApacheHttpClient.builder()
101-
.proxyConfiguration(proxyConfig)
110+
.proxyConfiguration(proxyConfigBuilder.build())
102111
.build());
103112
}
104113
if (builder.getRetryConfig() != null) {

blob/blob-aws/src/main/java/com/salesforce/multicloudj/blob/aws/AwsBlobStore.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ protected static boolean shouldConfigureHttpClient(Builder builder) {
110110
return builder.getProxyEndpoint() != null
111111
|| builder.getMaxConnections() != null
112112
|| builder.getSocketTimeout() != null
113-
|| builder.getIdleConnectionTimeout() != null;
113+
|| builder.getIdleConnectionTimeout() != null
114+
|| builder.getUseSystemPropertyProxyValues() != null
115+
|| builder.getUseEnvironmentVariableProxyValues() != null;
114116
}
115117

116118
@Override
@@ -627,10 +629,20 @@ private static S3Client buildS3Client(Builder builder) {
627629
*/
628630
private static SdkHttpClient generateHttpClient(Builder builder) {
629631
ApacheHttpClient.Builder httpClientBuilder = ApacheHttpClient.builder();
630-
if (builder.getProxyEndpoint() != null) {
631-
httpClientBuilder.proxyConfiguration(ProxyConfiguration.builder()
632-
.endpoint(builder.getProxyEndpoint())
633-
.build());
632+
if (builder.getProxyEndpoint() != null
633+
|| builder.getUseSystemPropertyProxyValues() != null
634+
|| builder.getUseEnvironmentVariableProxyValues() != null) {
635+
ProxyConfiguration.Builder proxyConfigBuilder = ProxyConfiguration.builder();
636+
if (builder.getProxyEndpoint() != null) {
637+
proxyConfigBuilder.endpoint(builder.getProxyEndpoint());
638+
}
639+
if (builder.getUseSystemPropertyProxyValues() != null) {
640+
proxyConfigBuilder.useSystemPropertyValues(builder.getUseSystemPropertyProxyValues());
641+
}
642+
if (builder.getUseEnvironmentVariableProxyValues() != null) {
643+
proxyConfigBuilder.useEnvironmentVariableValues(builder.getUseEnvironmentVariableProxyValues());
644+
}
645+
httpClientBuilder.proxyConfiguration(proxyConfigBuilder.build());
634646
}
635647
if(builder.getMaxConnections() != null) {
636648
httpClientBuilder.maxConnections(builder.getMaxConnections());

blob/blob-aws/src/main/java/com/salesforce/multicloudj/blob/aws/async/AwsAsyncBlobStore.java

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,18 +509,28 @@ private static void applyCommonConfig(S3AsyncClientBuilder builder, Builder conf
509509

510510
// Configure HTTP client if any settings are specified
511511
if (config.getProxyEndpoint() != null || config.getMaxConnections() != null ||
512-
config.getSocketTimeout() != null || config.getIdleConnectionTimeout() != null) {
512+
config.getSocketTimeout() != null || config.getIdleConnectionTimeout() != null ||
513+
config.getUseSystemPropertyProxyValues() != null || config.getUseEnvironmentVariableProxyValues() != null) {
513514

514515
NettyNioAsyncHttpClient.Builder httpClientBuilder = NettyNioAsyncHttpClient.builder();
515516

516517
// Configure proxy if specified
517-
if (config.getProxyEndpoint() != null) {
518-
ProxyConfiguration proxyConfig = ProxyConfiguration.builder()
519-
.scheme(config.getProxyEndpoint().getScheme())
520-
.host(config.getProxyEndpoint().getHost())
521-
.port(config.getProxyEndpoint().getPort())
522-
.build();
523-
httpClientBuilder.proxyConfiguration(proxyConfig);
518+
if (config.getProxyEndpoint() != null
519+
|| config.getUseSystemPropertyProxyValues() != null
520+
|| config.getUseEnvironmentVariableProxyValues() != null) {
521+
ProxyConfiguration.Builder proxyConfigBuilder = ProxyConfiguration.builder();
522+
if (config.getProxyEndpoint() != null) {
523+
proxyConfigBuilder.scheme(config.getProxyEndpoint().getScheme())
524+
.host(config.getProxyEndpoint().getHost())
525+
.port(config.getProxyEndpoint().getPort());
526+
}
527+
if (config.getUseSystemPropertyProxyValues() != null) {
528+
proxyConfigBuilder.useSystemPropertyValues(config.getUseSystemPropertyProxyValues());
529+
}
530+
if (config.getUseEnvironmentVariableProxyValues() != null) {
531+
proxyConfigBuilder.useEnvironmentVariableValues(config.getUseEnvironmentVariableProxyValues());
532+
}
533+
httpClientBuilder.proxyConfiguration(proxyConfigBuilder.build());
524534
}
525535

526536
// Configure max connections if specified

blob/blob-aws/src/test/java/com/salesforce/multicloudj/blob/aws/AwsBlobClientTest.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,53 @@ void testBuildS3ClientWithRetryConfigWithTotalTimeout() {
233233
assertEquals("aws", client.getProviderId());
234234
}
235235

236+
@Test
237+
void testBuildS3ClientWithUseSystemPropertyProxyValues() {
238+
var client = new AwsBlobClient.Builder()
239+
.withRegion("us-east-2")
240+
.withUseSystemPropertyProxyValues(false)
241+
.build();
242+
243+
assertNotNull(client);
244+
assertEquals("aws", client.getProviderId());
245+
}
246+
247+
@Test
248+
void testBuildS3ClientWithUseEnvironmentVariableProxyValues() {
249+
var client = new AwsBlobClient.Builder()
250+
.withRegion("us-east-2")
251+
.withUseEnvironmentVariableProxyValues(false)
252+
.build();
253+
254+
assertNotNull(client);
255+
assertEquals("aws", client.getProviderId());
256+
}
257+
258+
@Test
259+
void testBuildS3ClientWithBothProxyOverrideFlags() {
260+
var client = new AwsBlobClient.Builder()
261+
.withRegion("us-east-2")
262+
.withUseSystemPropertyProxyValues(false)
263+
.withUseEnvironmentVariableProxyValues(false)
264+
.build();
265+
266+
assertNotNull(client);
267+
assertEquals("aws", client.getProviderId());
268+
}
269+
270+
@Test
271+
void testBuildS3ClientWithProxyEndpointAndOverrideFlags() {
272+
var client = new AwsBlobClient.Builder()
273+
.withRegion("us-east-2")
274+
.withProxyEndpoint(URI.create("https://proxy.endpoint.com:443"))
275+
.withUseSystemPropertyProxyValues(true)
276+
.withUseEnvironmentVariableProxyValues(false)
277+
.build();
278+
279+
assertNotNull(client);
280+
assertEquals("aws", client.getProviderId());
281+
}
282+
236283
@Test
237284
void testCreateBucket() {
238285
String bucketName = "test-bucket";

blob/blob-aws/src/test/java/com/salesforce/multicloudj/blob/aws/AwsBlobStoreTest.java

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@ void testShouldConfigureHttpClient() {
229229
.withIdleConnectionTimeout(Duration.ofSeconds(10));
230230
assertTrue(AwsBlobStore.shouldConfigureHttpClient((AwsBlobStore.Builder)builderWithIdleConnectionTimeout));
231231

232+
var builderWithUseSystemPropertyProxyValues = new AwsBlobStore.Builder()
233+
.withTransformerSupplier(transformerSupplier)
234+
.withBucket("bucket-1").withRegion("us-east-2")
235+
.withUseSystemPropertyProxyValues(false);
236+
assertTrue(AwsBlobStore.shouldConfigureHttpClient((AwsBlobStore.Builder)builderWithUseSystemPropertyProxyValues));
237+
238+
var builderWithUseEnvVarProxyValues = new AwsBlobStore.Builder()
239+
.withTransformerSupplier(transformerSupplier)
240+
.withBucket("bucket-1").withRegion("us-east-2")
241+
.withUseEnvironmentVariableProxyValues(false);
242+
assertTrue(AwsBlobStore.shouldConfigureHttpClient((AwsBlobStore.Builder)builderWithUseEnvVarProxyValues));
243+
232244
var builderWithNoOverrides = new AwsBlobStore.Builder()
233245
.withTransformerSupplier(transformerSupplier)
234246
.withBucket("bucket-1").withRegion("us-east-2");
@@ -1243,6 +1255,61 @@ void testBuildS3ClientWithoutRetryConfig() {
12431255
assertEquals("bucket-1", store.getBucket());
12441256
}
12451257

1258+
@Test
1259+
void testBuildS3ClientWithUseSystemPropertyProxyValues() {
1260+
var store = new AwsBlobStore.Builder()
1261+
.withTransformerSupplier(transformerSupplier)
1262+
.withBucket("bucket-1")
1263+
.withRegion("us-east-2")
1264+
.withUseSystemPropertyProxyValues(false)
1265+
.build();
1266+
1267+
assertNotNull(store);
1268+
assertEquals("bucket-1", store.getBucket());
1269+
}
1270+
1271+
@Test
1272+
void testBuildS3ClientWithUseEnvironmentVariableProxyValues() {
1273+
var store = new AwsBlobStore.Builder()
1274+
.withTransformerSupplier(transformerSupplier)
1275+
.withBucket("bucket-1")
1276+
.withRegion("us-east-2")
1277+
.withUseEnvironmentVariableProxyValues(false)
1278+
.build();
1279+
1280+
assertNotNull(store);
1281+
assertEquals("bucket-1", store.getBucket());
1282+
}
1283+
1284+
@Test
1285+
void testBuildS3ClientWithBothProxyOverrideFlags() {
1286+
var store = new AwsBlobStore.Builder()
1287+
.withTransformerSupplier(transformerSupplier)
1288+
.withBucket("bucket-1")
1289+
.withRegion("us-east-2")
1290+
.withUseSystemPropertyProxyValues(false)
1291+
.withUseEnvironmentVariableProxyValues(false)
1292+
.build();
1293+
1294+
assertNotNull(store);
1295+
assertEquals("bucket-1", store.getBucket());
1296+
}
1297+
1298+
@Test
1299+
void testBuildS3ClientWithProxyEndpointAndOverrideFlags() {
1300+
var store = new AwsBlobStore.Builder()
1301+
.withTransformerSupplier(transformerSupplier)
1302+
.withBucket("bucket-1")
1303+
.withRegion("us-east-2")
1304+
.withProxyEndpoint(URI.create("https://proxy.endpoint.com:443"))
1305+
.withUseSystemPropertyProxyValues(true)
1306+
.withUseEnvironmentVariableProxyValues(false)
1307+
.build();
1308+
1309+
assertNotNull(store);
1310+
assertEquals("bucket-1", store.getBucket());
1311+
}
1312+
12461313
@Test
12471314
void testGetObjectLock_Success() {
12481315
// Given

blob/blob-aws/src/test/java/com/salesforce/multicloudj/blob/aws/async/AwsAsyncBlobStoreTest.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,61 @@ void testBuildS3AsyncClientWithoutRetryConfig() {
14771477
assertEquals(BUCKET, store.getBucket());
14781478
}
14791479

1480+
@Test
1481+
void testBuildS3AsyncClientWithUseSystemPropertyProxyValues() {
1482+
var store = new AwsAsyncBlobStore.Builder()
1483+
.withBucket(BUCKET)
1484+
.withRegion(REGION)
1485+
.withUseSystemPropertyProxyValues(false)
1486+
.build();
1487+
1488+
assertNotNull(store);
1489+
assertInstanceOf(AwsAsyncBlobStore.class, store);
1490+
assertEquals(BUCKET, store.getBucket());
1491+
}
1492+
1493+
@Test
1494+
void testBuildS3AsyncClientWithUseEnvironmentVariableProxyValues() {
1495+
var store = new AwsAsyncBlobStore.Builder()
1496+
.withBucket(BUCKET)
1497+
.withRegion(REGION)
1498+
.withUseEnvironmentVariableProxyValues(false)
1499+
.build();
1500+
1501+
assertNotNull(store);
1502+
assertInstanceOf(AwsAsyncBlobStore.class, store);
1503+
assertEquals(BUCKET, store.getBucket());
1504+
}
1505+
1506+
@Test
1507+
void testBuildS3AsyncClientWithBothProxyOverrideFlags() {
1508+
var store = new AwsAsyncBlobStore.Builder()
1509+
.withBucket(BUCKET)
1510+
.withRegion(REGION)
1511+
.withUseSystemPropertyProxyValues(false)
1512+
.withUseEnvironmentVariableProxyValues(false)
1513+
.build();
1514+
1515+
assertNotNull(store);
1516+
assertInstanceOf(AwsAsyncBlobStore.class, store);
1517+
assertEquals(BUCKET, store.getBucket());
1518+
}
1519+
1520+
@Test
1521+
void testBuildS3AsyncClientWithProxyEndpointAndOverrideFlags() {
1522+
var store = new AwsAsyncBlobStore.Builder()
1523+
.withBucket(BUCKET)
1524+
.withRegion(REGION)
1525+
.withProxyEndpoint(URI.create("https://proxy.example.com:443"))
1526+
.withUseSystemPropertyProxyValues(true)
1527+
.withUseEnvironmentVariableProxyValues(false)
1528+
.build();
1529+
1530+
assertNotNull(store);
1531+
assertInstanceOf(AwsAsyncBlobStore.class, store);
1532+
assertEquals(BUCKET, store.getBucket());
1533+
}
1534+
14801535
@Test
14811536
void testBuildS3CrtAsyncClientWithRetryConfig() {
14821537
// Test CRT client with retry config

0 commit comments

Comments
 (0)