aws / aws/amazon-s3-encryption-client-java
S3 Encryption client does throw an error for ranges greater than EOF
- Langage dominant
- Java
- Étoiles
- 34
- Forks
- 21
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### 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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduire la requête de plage via S3EncryptionClient.getObject avec un objet de 64KB et bytes=65536-65635, puis la comparer au comportement de S3Client décrit dans l’issue. Suivre la manière dont le client de chiffrement traite la réponse de plage ; le travail est terminé lorsque le client chiffré signale une erreur 416 de plage non satisfaisable pour une plage au-delà de EOF.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- aws, java
- Domaine
- backend, security
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100