aws / aws/amazon-s3-encryption-client-java

S3EncryptionClient builder requires region input even when endpointOverride is provided

Offen
#486 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
34
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Problem:

`S3EncryptionClient.builder()` requires `region` as a mandatory input, even when `endpointOverride` is provided. This is a difference in behaviour from earlier version, where it was allowed to create the builder with only `endpointConfiguration` and without `region`.
Due to this, we have to pass a default region value always, resulting in ResourceNotFoundException for S3 Compatible vendors using a bucket in a different region. If no region is provided, and only endpoint is given, it works fine when using `com.amazonaws.aws`.

### Solution:

Allow `region` to be empty when `endpointOverride` is defined.

### Additional information

We are using these SDKs in Scala code
Java Version: Azul Zulu: 11.80.21
Scala Version: 2.12.19

## SDK versions
com.amazonaws.aws: 1.12.768
amazon-s3-encryption-client-java: 3.3.5
software.amazon.awssdk.s3: 2.31.67

### Sample Code
```
Using com.amazonaws.aws
AmazonS3EncryptionClientV2Builder
.standard()
.withEndpointConfiguration(
new EndpointConfiguration(endpoint, region)
)

Using software.amazon.awssdk.s3
S3EncryptionClient
.builder()
.endpointOverride(s3UriEndpoint)
.region(Region.of(s3Region)) --> Fails without passing this
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start at S3EncryptionClient.builder() and trace how endpointOverride and region validation are handled. Compare the current behavior with the older endpointConfiguration example; done means an endpoint-only builder is accepted without requiring a region and compatible-S3 users no longer need to supply a potentially incorrect default region.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, java
Bereich
cloud, security
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.