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

Small fixes for S3 on Outposts #470

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

jamesbornholt
Copy link
Member

@jamesbornholt jamesbornholt commented Aug 22, 2023

Description of change

This fixes two issues that were preventing Mountpoint from working against Outposts buckets:

  1. Outposts doesn't include the bucket name in ListObjectsV2 responses. We weren't actually using that output anyway, so I just removed it.
  2. For GetObject requests, we were sending a HTTP header like Accept: application/xml,*/*. While technically valid HTTP, it's weird to accept */* as well as something else, and it was confusing Outposts' request signing. So I switched to overwriting the existing header, which is what the comment suggested the code was intended to do anyway.

I also took this chance to make a little cleanup to parsing ListObjectsV2 responses: the parse functions shouldn't be defined on the generic ListObjectsResult structs, which are shared by all clients.

This change doesn't make Mountpoint completely work on Outposts. The outstanding issue is that Outposts don't support S3 additional checksums, but we turn those on by default. We'll need a way to turn those off for Outposts buckets. But read-only usage should work.

Does this change impact existing behavior?

Yes, removing the bucket name is a breaking change to the client crate, and we now send a different Accept header on GetObject requests. There shouldn't be any customer-visible effects.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 22, 2023 19:39 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 22, 2023 19:39 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 22, 2023 19:39 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 22, 2023 19:39 — with GitHub Actions Inactive
fn add_header(
/// Add a header to this message. The header is added if necessary and any existing values for
/// this header are removed.
fn set_header(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there any use of adding a new header with different value rather than overwriting it, earlier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's why I changed it. Multiple headers with the same name is a pretty niche HTTP thing that we don't need.

@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 23, 2023 22:07 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 23, 2023 22:07 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 23, 2023 22:07 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 23, 2023 22:07 — with GitHub Actions Inactive
@ale-rinaldi
Copy link

I can confirm that this also fixes the GetObject operation on the Seeweb provider; it previously failed with an invalid signature error. Thank you

This fixes two issues that were preventing Mountpoint from working
against Outposts buckets:
1. Outposts doesn't include the bucket name in ListObjectsV2 responses.
   We weren't actually using that output anyway, so I just removed it.
2. For GetObject requests, we were sending a HTTP header like
   `Accept: application/xml,*/*`. While technically valid HTTP, it's
   weird to accept */* as well as something else, and it was confusing
   Outposts' request signing. So I switched to overwriting the existing
   header, which is what the comment suggested the code was intended to
   do anyway.

I also took this chance to make a little cleanup to parsing
ListObjectsV2 responses: the `parse` functions shouldn't be defined on
the generic `ListObjectsResult` structs, which are shared by all
clients.

Signed-off-by: James Bornholt <[email protected]>
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 25, 2023 17:08 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 25, 2023 17:08 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 25, 2023 17:08 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt temporarily deployed to PR integration tests August 25, 2023 17:08 — with GitHub Actions Inactive
@jamesbornholt jamesbornholt marked this pull request as ready for review August 25, 2023 17:51
Copy link
Contributor

@monthonk monthonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@monthonk monthonk added this pull request to the merge queue Aug 30, 2023
Merged via the queue into awslabs:main with commit 73a27c1 Aug 30, 2023
github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2024
Update the CRT libraries to the latest releases. In particular, include:
* Support full object checksum and crc64nvme.
([awslabs/aws-c-s3#468](awslabs/aws-c-s3#468))

<details>
  <summary>Full CRT changelog:</summary>
  
```
Submodule mountpoint-s3-crt-sys/crt/aws-c-common be8ed873..fadfef49:
  > Support relative paths when prebuilding dependencies with CMake (#1174)
  > Switch CI to use roles (#1173)
Submodule mountpoint-s3-crt-sys/crt/aws-c-s3 45894ed3..337155f6:
  > Support full object checksum (#468)
  > [meta request]: assign shutdown_callback inside critical region (#470)
  > Switch CI to use roles (#463)
```
</details>

### Does this change impact existing behavior?

No.

### Does this change need a changelog entry?

No.

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).

Signed-off-by: Alessandro Passaro <[email protected]>
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.

4 participants