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

S3 Region #168

Open
Nugine opened this issue Aug 17, 2024 · 5 comments
Open

S3 Region #168

Nugine opened this issue Aug 17, 2024 · 5 comments

Comments

@Nugine
Copy link
Owner

Nugine commented Aug 17, 2024

It's not clear that how to deal with s3 regions in s3s now.

@St4NNi
Copy link
Contributor

St4NNi commented Sep 24, 2024

Hi, we have a use case that would really benefit from being able to access the region from a single s3s endpoint. What is the current status here? Is it possible to extract the S3 region from the headers?

Thanks in advance!

@Nugine
Copy link
Owner Author

Nugine commented Sep 24, 2024

we have a use case that would really benefit from being able to access the region from a single s3s endpoint.

It would be helpful to know more details about the use case. We can discuss design ideas here.

What is the current status here?

s3s has two places that mention the region now. The status is TODO.

// pub(crate) region: Option<Cow<'a, str>>,

ans.push_str(region); // TODO: use a `Region` type

Is it possible to extract the S3 region from the headers?

Yes it is possible. The information is available in S3Request. I guess we just need to add some utils about regions.

@St4NNi
Copy link
Contributor

St4NNi commented Sep 24, 2024

It would be helpful to know more details about the use case. We can discuss design ideas here.

Sure, our data management solution has the idea of realms, a collection of multiple tenants that have agreed on certain rules (like metadata formats, naming conventions, data usage agreement requirements, etc.). Data is made available via s3s. In an ideal world, we would like to separate the realms as much as possible (including, for example, the ability to have only realm-unique bucket names).

We thought about "misusing" S3 regions because they more or less provide the functionality we want, except in our use case regions are not geographically separated, but logically.

I have hoped that this could work without a dedicated subdomain aka. <region>.<hostname> but having a deeper look at the official S3 specs it seems like only some requests (like CreateBucket) allow for regions to be specified directly, others like GetObject expect the region to be part of the hostname.

Official AWS S3 host header configuration

The main problem with subdomains in an environment where the regions might change dynamically is that wildcard TLS certificates only work for a single layer, so while the dns entry *.foo.bar will work for baz.bat.foo.bar a wildcard TLS certificate will only match one level e.g. bat.foo.bar

@Nugine
Copy link
Owner Author

Nugine commented Sep 24, 2024

The main problem with subdomains in an environment where the regions might change dynamically is that wildcard TLS certificates only work for a single layer, so while the dns entry *.foo.bar will work for baz.bat.foo.bar a wildcard TLS certificate will only match one level e.g. baz.bat

So dynamic regions can not be in the hostname.
The realm information can be put in query strings or custom headers. But there may be some compatibility problems.

@St4NNi
Copy link
Contributor

St4NNi commented Sep 24, 2024

This could work if dynamic regions will only use the legacy path-style requests but this is also not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants