object-storage-client 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/Cargo.lock +1 -1
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/Cargo.toml +1 -1
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/PKG-INFO +1 -1
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/docs/CONFIGURATION.md +6 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/s3.rs +159 -11
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.cargo/config.toml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.docker/garage.toml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.gitattributes +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.github/dependabot.yml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.github/workflows/ci.yaml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.github/workflows/perf.yaml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.github/workflows/tests.yaml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.gitignore +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/.python-version +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/LICENSE +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/README.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/benches/alloc-counter/Cargo.toml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/benches/alloc-counter/src/lib.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/benches/common/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/benches/throughput.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/compose.yml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/deny.toml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/docs/BEHAVIOR.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/docs/DEVELOPMENT.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/docs/ENCRYPTION.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/docs/TESTING.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/docs/UPGRADING.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/proptest-regressions/encryption/context.txt +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/pyproject.toml +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/__init__.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/__init__.pyi +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/_stream.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/py.typed +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/scripts/esdk_oracle.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/scripts/hostile-env.sh +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/scripts/perf_smoke.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/aws_profile.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/azure.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/body.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/connector.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/gcs.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/http.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/local.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/backend/stub.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/args.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/enc.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/keyring.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/output/tests.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/output.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/tests.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/transfer/tests.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/transfer.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/tree/tests.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli/tree.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/cli.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/client/local_delete.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/client.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/codec.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/context.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/envelope.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/fixtures.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/frame.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/fuzzing.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/header.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/keys/keyring/tests.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/keys/keyring.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/keys/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/keys/raw_aes.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/suite.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/tamper_tests.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/fsmode.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/hex.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/lib.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/main.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/python/client.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/python/encryption.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/python/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/python/stream.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/registry.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/sign.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/text.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/upload.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional/aws_profile.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional/cli.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional/client.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional/encryption.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional/golden.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional/suite.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/functional.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/azure_storage_ops.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/common/azurite.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/common/gcs.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/common/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/common/provider.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/encryption.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/file_roundtrip.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/gcs_storage_ops.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/reencrypt.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/s3_storage_ops.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/storage_ops.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/perf_guards.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/conftest.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_abort_at_exit.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_encrypted_client.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_encryption_runtime.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_free_threading.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_gil_contention.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_list_stream.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_plain_client.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_profile.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_roundtrip.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_shared_client.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_stream_leak.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_stream_sticky.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_stub_conformance.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_subinterpreter.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_worker_threads.py +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/support/mock.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/support/mod.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/unit/sign.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/unit.rs +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/README.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/ctx_long.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/ctx_min.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/ctx_utf8.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/manifest.json +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p0_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p0_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p1_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p1_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p200000_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p200000_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4095_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4095_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4096_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4096_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4097_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4097_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65535_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65535_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65536_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65536_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65537_f4096.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65537_f65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/README.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/context.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/keyring +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/manifest.json +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/old_key.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_0.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_1.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_200000.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_65536.bin +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/README.md +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/one.keyring +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/other.keyring +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/two.keyring +0 -0
- {object_storage_client-0.2.2 → object_storage_client-0.2.3}/uv.lock +0 -0
|
@@ -36,6 +36,12 @@ and `AWS_PROFILE` is never read (see [AWS profiles and SSO](#aws-profiles-and-ss
|
|
|
36
36
|
`AWS_ENDPOINT` and `AWS_ENDPOINT_URL` that is set and not empty, then, with a
|
|
37
37
|
profile, the profile's S3 `endpoint_url`. Without any, requests go to AWS,
|
|
38
38
|
and bucket calls to `https://s3.<region>.amazonaws.com`, always over https.
|
|
39
|
+
- Addressing: `S3_ADDRESSING_STYLE=path` (the default) puts the bucket in the
|
|
40
|
+
path, `S3_ADDRESSING_STYLE=virtual` puts it in the host. The value is
|
|
41
|
+
case-insensitive, and any other value is an error. When it is unset,
|
|
42
|
+
`AWS_VIRTUAL_HOSTED_STYLE_REQUEST` decides. Object and bucket requests use
|
|
43
|
+
the same style. With a custom endpoint, `virtual` sends requests to the
|
|
44
|
+
endpoint as is, so the endpoint must already be scoped to the bucket.
|
|
39
45
|
- An `http://` endpoint enables plain HTTP by itself. Plain HTTP exposes every
|
|
40
46
|
request header to the network, including `x-amz-security-token`, so use it
|
|
41
47
|
only for a local or otherwise trusted store.
|
|
@@ -20,6 +20,31 @@ use std::sync::Arc;
|
|
|
20
20
|
use std::time::Duration;
|
|
21
21
|
use url::Url;
|
|
22
22
|
|
|
23
|
+
/// How requests address the bucket. `S3_ADDRESSING_STYLE` sets it; when that is
|
|
24
|
+
/// unset, `AWS_VIRTUAL_HOSTED_STYLE_REQUEST` decides, and path is the default.
|
|
25
|
+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
26
|
+
enum AddressingStyle {
|
|
27
|
+
/// `https://<endpoint>/<bucket>/<key>`: the bucket is in the path.
|
|
28
|
+
Path,
|
|
29
|
+
/// `https://<bucket>.<endpoint>/<key>`: the bucket is in the host.
|
|
30
|
+
Virtual,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
impl AddressingStyle {
|
|
34
|
+
/// Parses `path` or `virtual`, ignoring case.
|
|
35
|
+
fn parse(value: &str) -> Option<Self> {
|
|
36
|
+
match value.to_ascii_lowercase().as_str() {
|
|
37
|
+
"path" => Some(Self::Path),
|
|
38
|
+
"virtual" => Some(Self::Virtual),
|
|
39
|
+
_ => None,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const fn is_virtual(self) -> bool {
|
|
44
|
+
matches!(self, Self::Virtual)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
23
48
|
/// S3 backend. Retains the concrete [`AmazonS3`] store so credentials can be
|
|
24
49
|
/// read for header-bound signing and `CreateBucket`, alongside the type-erased
|
|
25
50
|
/// store used for generic object operations.
|
|
@@ -35,8 +60,8 @@ pub struct S3Backend {
|
|
|
35
60
|
region: String,
|
|
36
61
|
/// The configured custom endpoint; `None` means AWS.
|
|
37
62
|
endpoint: Option<String>,
|
|
38
|
-
///
|
|
39
|
-
|
|
63
|
+
/// How the bucket is addressed, for object and bucket requests alike.
|
|
64
|
+
addressing: AddressingStyle,
|
|
40
65
|
}
|
|
41
66
|
|
|
42
67
|
impl S3Backend {
|
|
@@ -76,6 +101,7 @@ impl S3Backend {
|
|
|
76
101
|
let get_var = |k: &str| vars.get(k);
|
|
77
102
|
let s3_allow_http = get_var("S3_ALLOW_HTTP").unwrap_or_else(|| "false".into());
|
|
78
103
|
let bucket = host.ok_or_else(|| Error::InvalidInput("Missing bucket in S3 URL".into()))?;
|
|
104
|
+
let addressing_override = Self::addressing_override(vars)?;
|
|
79
105
|
// One boolean decides both this check and whether the profile signs. An
|
|
80
106
|
// explicit profile is the only credential source.
|
|
81
107
|
let uses_profile = profile.is_some();
|
|
@@ -123,10 +149,23 @@ impl S3Backend {
|
|
|
123
149
|
if let Some(ep) = endpoint.as_deref() {
|
|
124
150
|
builder = builder.with_config(AmazonS3ConfigKey::S3Endpoint, ep);
|
|
125
151
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
152
|
+
// The store reads the same setting for object calls, so writing the
|
|
153
|
+
// resolved style back keeps bucket and object requests in agreement.
|
|
154
|
+
let addressing = addressing_override.unwrap_or_else(|| {
|
|
155
|
+
let virtual_hosted = builder
|
|
156
|
+
.get_config_value(&AmazonS3ConfigKey::VirtualHostedStyleRequest)
|
|
157
|
+
.and_then(|v| parse_bool(&v))
|
|
158
|
+
.unwrap_or(false);
|
|
159
|
+
if virtual_hosted {
|
|
160
|
+
AddressingStyle::Virtual
|
|
161
|
+
} else {
|
|
162
|
+
AddressingStyle::Path
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
builder = builder.with_config(
|
|
166
|
+
AmazonS3ConfigKey::VirtualHostedStyleRequest,
|
|
167
|
+
addressing.is_virtual().to_string(),
|
|
168
|
+
);
|
|
130
169
|
|
|
131
170
|
if let Some(access_key_id) = get_var("S3_ACCESS_KEY_ID") {
|
|
132
171
|
builder = builder.with_token("").with_access_key_id(access_key_id);
|
|
@@ -167,7 +206,21 @@ impl S3Backend {
|
|
|
167
206
|
bucket: bucket.to_string(),
|
|
168
207
|
region,
|
|
169
208
|
endpoint,
|
|
170
|
-
|
|
209
|
+
addressing,
|
|
210
|
+
})
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/// The addressing style `S3_ADDRESSING_STYLE` names, if it is set. Empty is
|
|
214
|
+
/// unset. Any other value is an error, so a typo cannot silently fall back
|
|
215
|
+
/// to the default.
|
|
216
|
+
fn addressing_override(vars: &Vars) -> Result<Option<AddressingStyle>> {
|
|
217
|
+
let Some(value) = vars.get("S3_ADDRESSING_STYLE").filter(|v| !v.is_empty()) else {
|
|
218
|
+
return Ok(None);
|
|
219
|
+
};
|
|
220
|
+
AddressingStyle::parse(&value).map(Some).ok_or_else(|| {
|
|
221
|
+
Error::InvalidInput(format!(
|
|
222
|
+
"S3_ADDRESSING_STYLE must be \"path\" or \"virtual\", not \"{value}\""
|
|
223
|
+
))
|
|
171
224
|
})
|
|
172
225
|
}
|
|
173
226
|
|
|
@@ -259,13 +312,15 @@ impl S3Backend {
|
|
|
259
312
|
async fn bucket_request(&self, method: Method, body: Bytes) -> Result<HttpRequest> {
|
|
260
313
|
let (endpoint, region) = self.endpoint_and_region();
|
|
261
314
|
let endpoint = endpoint.trim_end_matches('/');
|
|
262
|
-
let uri = match (self.
|
|
315
|
+
let uri = match (self.addressing, &self.endpoint) {
|
|
263
316
|
// The store uses a custom endpoint as is in this mode.
|
|
264
|
-
(
|
|
265
|
-
(
|
|
317
|
+
(AddressingStyle::Virtual, Some(_)) => format!("{endpoint}/"),
|
|
318
|
+
(AddressingStyle::Virtual, None) => {
|
|
319
|
+
format!("https://{}.s3.{region}.amazonaws.com/", self.bucket)
|
|
320
|
+
}
|
|
266
321
|
// Path-style addressing keeps the request endpoint-agnostic, which
|
|
267
322
|
// is what MinIO / SeaweedFS expect and AWS also accepts.
|
|
268
|
-
(
|
|
323
|
+
(AddressingStyle::Path, _) => format!("{endpoint}/{}", self.bucket),
|
|
269
324
|
};
|
|
270
325
|
let mut request: HttpRequest = http::Request::builder()
|
|
271
326
|
.method(method)
|
|
@@ -919,6 +974,99 @@ mod tests {
|
|
|
919
974
|
assert_eq!(request.uri(), "https://bkt.s3.eu-west-1.amazonaws.com/");
|
|
920
975
|
}
|
|
921
976
|
|
|
977
|
+
/// The bucket-level URI a store with `pairs` sends to, against a custom
|
|
978
|
+
/// endpoint.
|
|
979
|
+
async fn bucket_uri(pairs: &[(&str, &str)]) -> String {
|
|
980
|
+
let mut all = vec![("S3_ENDPOINT", "http://127.0.0.1:1")];
|
|
981
|
+
all.extend_from_slice(pairs);
|
|
982
|
+
let request = keyed(&all)
|
|
983
|
+
.bucket_request(Method::PUT, Bytes::new())
|
|
984
|
+
.await
|
|
985
|
+
.expect("request");
|
|
986
|
+
request.uri().to_string()
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
#[tokio::test]
|
|
990
|
+
async fn addressing_style_defaults_to_path() {
|
|
991
|
+
assert_eq!(bucket_uri(&[]).await, "http://127.0.0.1:1/bkt");
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
#[tokio::test]
|
|
995
|
+
async fn s3_addressing_style_selects_the_style_case_insensitively() {
|
|
996
|
+
assert_eq!(
|
|
997
|
+
bucket_uri(&[("S3_ADDRESSING_STYLE", "virtual")]).await,
|
|
998
|
+
"http://127.0.0.1:1/"
|
|
999
|
+
);
|
|
1000
|
+
assert_eq!(
|
|
1001
|
+
bucket_uri(&[("S3_ADDRESSING_STYLE", "PATH")]).await,
|
|
1002
|
+
"http://127.0.0.1:1/bkt"
|
|
1003
|
+
);
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
#[tokio::test]
|
|
1007
|
+
async fn s3_addressing_style_overrides_virtual_hosted_style_request() {
|
|
1008
|
+
assert_eq!(
|
|
1009
|
+
bucket_uri(&[
|
|
1010
|
+
("S3_ADDRESSING_STYLE", "path"),
|
|
1011
|
+
("AWS_VIRTUAL_HOSTED_STYLE_REQUEST", "true"),
|
|
1012
|
+
])
|
|
1013
|
+
.await,
|
|
1014
|
+
"http://127.0.0.1:1/bkt"
|
|
1015
|
+
);
|
|
1016
|
+
assert_eq!(
|
|
1017
|
+
bucket_uri(&[
|
|
1018
|
+
("S3_ADDRESSING_STYLE", "virtual"),
|
|
1019
|
+
("AWS_VIRTUAL_HOSTED_STYLE_REQUEST", "false"),
|
|
1020
|
+
])
|
|
1021
|
+
.await,
|
|
1022
|
+
"http://127.0.0.1:1/"
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
#[tokio::test]
|
|
1027
|
+
async fn empty_s3_addressing_style_is_unset() {
|
|
1028
|
+
assert_eq!(
|
|
1029
|
+
bucket_uri(&[
|
|
1030
|
+
("S3_ADDRESSING_STYLE", ""),
|
|
1031
|
+
("AWS_VIRTUAL_HOSTED_STYLE_REQUEST", "true")
|
|
1032
|
+
])
|
|
1033
|
+
.await,
|
|
1034
|
+
"http://127.0.0.1:1/"
|
|
1035
|
+
);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
#[tokio::test]
|
|
1039
|
+
async fn object_requests_follow_s3_addressing_style() {
|
|
1040
|
+
let path = signed(&keyed(&[("S3_ENDPOINT", "http://127.0.0.1:1")])).await;
|
|
1041
|
+
assert_eq!(path.path(), "/bkt/o");
|
|
1042
|
+
|
|
1043
|
+
let virtual_hosted = signed(&keyed(&[
|
|
1044
|
+
("S3_ENDPOINT", "http://127.0.0.1:1"),
|
|
1045
|
+
("S3_ADDRESSING_STYLE", "virtual"),
|
|
1046
|
+
]))
|
|
1047
|
+
.await;
|
|
1048
|
+
// A custom endpoint is used as is in this mode: the bucket is not in the
|
|
1049
|
+
// path, and the endpoint is expected to be scoped to it.
|
|
1050
|
+
assert_eq!(virtual_hosted.host_str(), Some("127.0.0.1"));
|
|
1051
|
+
assert_eq!(virtual_hosted.path(), "/o");
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
#[test]
|
|
1055
|
+
fn unknown_s3_addressing_style_is_rejected() {
|
|
1056
|
+
let all = [
|
|
1057
|
+
("S3_ACCESS_KEY_ID", "k"),
|
|
1058
|
+
("S3_SECRET_ACCESS_KEY", "s"),
|
|
1059
|
+
("S3_ADDRESSING_STYLE", "hostname"),
|
|
1060
|
+
];
|
|
1061
|
+
let err = S3Backend::new(Some("bkt"), &Vars::from_pairs(&all), None)
|
|
1062
|
+
.err()
|
|
1063
|
+
.expect("rejected");
|
|
1064
|
+
assert!(
|
|
1065
|
+
matches!(&err, Error::InvalidInput(msg) if msg.contains("S3_ADDRESSING_STYLE")),
|
|
1066
|
+
"{err:?}"
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
922
1070
|
/// Whether a store with `pairs` and a custom endpoint runs unsigned.
|
|
923
1071
|
fn unsigned(pairs: &[(&str, &str)]) -> bool {
|
|
924
1072
|
let mut all = vec![("S3_ENDPOINT", "http://127.0.0.1:1")];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/benches/alloc-counter/Cargo.toml
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/benches/alloc-counter/src/lib.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/_stream.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/python/object_storage_client/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/src/encryption/keys/keyring/tests.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/azure_storage_ops.rs
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/common/azurite.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/common/provider.rs
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/file_roundtrip.rs
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/gcs_storage_ops.rs
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/s3_storage_ops.rs
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/integration/storage_ops.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_abort_at_exit.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_encrypted_client.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_encryption_runtime.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_free_threading.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_gil_contention.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_list_stream.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_plain_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_shared_client.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_stream_leak.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_stream_sticky.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_stub_conformance.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_subinterpreter.py
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/python/test_worker_threads.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/manifest.json
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p0_f65536.bin
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p1_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p200000_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p200000_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4095_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4095_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4096_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4096_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4097_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p4097_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65535_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65535_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65536_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65536_f65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65537_f4096.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/esdk/p65537_f65536.bin
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/context.bin
RENAMED
|
File without changes
|
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/manifest.json
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/old_key.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_0.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_1.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_200000.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_65536.bin
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/README.md
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/one.keyring
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/other.keyring
RENAMED
|
File without changes
|
{object_storage_client-0.2.2 → object_storage_client-0.2.3}/tests/vectors/keyrings/two.keyring
RENAMED
|
File without changes
|
|
File without changes
|