aws / aws/amazon-s3-encryption-client-java
S3 Encryption client does throw an error for ranges greater than EOF
- Ngôn ngữ chính
- Java
- Star
- 34
- Fork
- 21
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Problem:
I created a 64KB (65536 bytes) with S3Encryption client, and then did
```
S3Client s3Client = S3Client.builder().region(Region.EU_WEST_1).build();
S3Client s3ECClient = S3EncryptionClient.builder()
.kmsKeyId("xxx")
.wrappedClient(s3Client)
.wrappedAsyncClient(S3AsyncClient.builder().region(Region.EU_WEST_1).build())
.enableLegacyUnauthenticatedModes(true)
.build();
ResponseInputStream inputStream = s3ECClient.getObject(GetObjectRequest.builder()
.bucket("xxxx")
.key("xxxx")
.range("bytes=65536-65635").build());
```
So end of range `65635` is greater than EOF at `65536`. And no error was thrown.
Creating a file with a regular S3 client and then doing
```
ResponseInputStream inputStream = s3Client.getObject(GetObjectRequest.builder()
.bucket("xxx")
.key("xxxx")
.range("bytes=65536-65635").build());
```
throws `software.amazon.awssdk.services.s3.model.S3Exception: The requested range is not satisfiable (Service: S3, Status Code: 416, Request ID:` which is what we expect to be thrown in S3A.
### Solution:
S3 Encryption client should also throw a 416 range not satisfiable error.
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện yêu cầu range thông qua S3EncryptionClient.getObject bằng cách sử dụng một object 64KB và bytes=65536-65635, sau đó so sánh với hành vi của S3Client được mô tả trong issue. Theo dõi cách encryption client xử lý phản hồi range; hoàn thành khi encrypted client báo lỗi 416 range-not-satisfiable cho một range vượt quá EOF.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, java
- Lĩnh vực
- backend, security
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100