Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: operation_name must be set for DEFAULT meta-requests #439

Merged
merged 10 commits into from
Jun 19, 2024

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Jun 17, 2024

Issue:

For some operations, S3 can return an error response, despite having sent status-code 200 OK (see knowledge center)

To defend against this, aws-c-s3 checked all 200 OK responses to see if they were actually XML errors, except responses related to AWS_S3_META_REQUEST_TYPE_GET_OBJECT. We knew that operations with "streaming body" responses never did "200 Error", and what if someone did "GetObject" on an XML error message they'd uploaded to S3, LoL 😂 haha 😂 that would never happen 😂.

We heard from a customer that was using AWS_S3_META_REQUEST_TYPE_DEFAULT (instead of AWS_S3_META_REQUEST_TYPE_GET_OBJECT) to send a "GetObject" request. The object was logs, and the logs began with an XML error message. Since aws-c-s3 didn't realize this was a "GetObject" request, it scanned the body of the response and mistook it for a "200 error".

Description of changes:

Users MUST set operation_name for AWS_S3_META_REQUEST_TYPE_DEFAULT. Previously, this was an optional field, but now it is required. This lets us ensure that "GetObject" operations are never checked for "200 Error", even if they were sent via AWS_S3_META_REQUEST_TYPE_DEFAULT.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

source/s3.c Outdated Show resolved Hide resolved
@graebm graebm merged commit b93e534 into main Jun 19, 2024
30 checks passed
@graebm graebm deleted the operation-name-required branch June 19, 2024 23:17
graebm added a commit to awslabs/aws-crt-python that referenced this pull request Jul 3, 2024
…574)

**Issue:**
see: awslabs/aws-c-s3#439

**Description of changes:**

- `S3Client.make_request()` now requires `operation_name` to be set when `type` is `S3RequestType.DEFAULT`. (see [S3 API](https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html) for canonical list of names)
- latest submodules:
    ```
    aws-c-cal          v0.6.15 -> v0.7.1
    aws-c-common       v0.9.21 -> v0.9.23
    aws-c-s3           v0.5.10 -> v0.6.0
    aws-lc             v1.29.0 -> v1.31.0
    s2n                v1.4.16 -> v1.4.17
    ```
graebm added a commit to awslabs/aws-crt-java that referenced this pull request Jul 3, 2024
…802)

**Issue:**
see: awslabs/aws-c-s3#439

**Description of changes:**
- When making requests with the `S3Client` of type `MetaRequestType.DEFAULT`, the user MUST specify the operation name
- Latest submodules:
    ```
    aws-c-cal          v0.6.15 -> v0.7.1
    aws-c-common       v0.9.21 -> v0.9.23
    aws-c-s3           v0.5.10 -> v0.6.0
    s2n                v1.4.16 -> v1.4.17
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants