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

S3 Encryption client does throw an error for ranges greater than EOF

Abierto
#200 2 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Java
Estrellas
34
Forks
21
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproducir la solicitud de rango mediante S3EncryptionClient.getObject usando un objeto de 64KB y bytes=65536-65635, y compararla después con el comportamiento de S3Client descrito en el issue. Seguir cómo el cliente de cifrado gestiona la respuesta de rango; se considera terminado cuando el cliente cifrado informa de un error 416 de rango no satisfecho para un rango más allá de EOF.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
aws, java
Área
backend, security
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.