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

S3EncryptionClient builder requires region input even when endpointOverride is provided

未关闭
#486 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
34
派生
21
PR 合并指标
30 天内没有已合并 PR

描述

### 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
```

贡献指南

打开贡献指南

调研方向

从 S3EncryptionClient.builder() 开始,跟踪 endpointOverride 和 region 验证的处理方式。将当前行为与较早的 endpointConfiguration 示例进行比较;完成的标准是:仅指定 endpoint 的 builder 无需提供 region 即可被接受,并且兼容 S3 的用户不再需要提供可能不正确的默认 region。

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, java
领域
cloud, security
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。