object-storage-client 0.2.1__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.1 → object_storage_client-0.2.3}/.github/workflows/ci.yaml +4 -37
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.github/workflows/tests.yaml +1 -25
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/Cargo.lock +32 -24
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/Cargo.toml +2 -3
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/PKG-INFO +1 -2
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/docs/CONFIGURATION.md +6 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/docs/DEVELOPMENT.md +0 -22
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/pyproject.toml +1 -1
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/s3.rs +159 -11
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_plain_client.py +42 -13
- object_storage_client-0.2.1/THIRD_PARTY_LICENSES.html +0 -6374
- object_storage_client-0.2.1/about.hbs +0 -41
- object_storage_client-0.2.1/about.toml +0 -26
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.cargo/config.toml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.docker/garage.toml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.gitattributes +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.github/dependabot.yml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.github/workflows/perf.yaml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.gitignore +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/.python-version +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/LICENSE +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/README.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/benches/alloc-counter/Cargo.toml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/benches/alloc-counter/src/lib.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/benches/common/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/benches/throughput.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/compose.yml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/deny.toml +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/docs/BEHAVIOR.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/docs/ENCRYPTION.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/docs/TESTING.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/docs/UPGRADING.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/proptest-regressions/encryption/context.txt +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/python/object_storage_client/__init__.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/python/object_storage_client/__init__.pyi +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/python/object_storage_client/_stream.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/python/object_storage_client/py.typed +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/scripts/esdk_oracle.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/scripts/hostile-env.sh +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/scripts/perf_smoke.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/aws_profile.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/azure.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/body.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/connector.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/gcs.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/http.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/local.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/backend/stub.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/args.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/enc.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/keyring.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/output/tests.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/output.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/tests.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/transfer/tests.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/transfer.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/tree/tests.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli/tree.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/cli.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/client/local_delete.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/client.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/codec.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/context.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/envelope.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/fixtures.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/frame.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/fuzzing.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/header.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/keys/keyring/tests.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/keys/keyring.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/keys/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/keys/raw_aes.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/suite.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/encryption/tamper_tests.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/fsmode.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/hex.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/lib.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/main.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/python/client.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/python/encryption.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/python/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/python/stream.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/registry.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/sign.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/text.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/src/upload.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional/aws_profile.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional/cli.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional/client.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional/encryption.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional/golden.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional/suite.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/functional.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/azure_storage_ops.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/common/azurite.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/common/gcs.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/common/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/common/provider.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/encryption.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/file_roundtrip.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/gcs_storage_ops.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/reencrypt.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/s3_storage_ops.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration/storage_ops.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/integration.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/perf_guards.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/conftest.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_abort_at_exit.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_encrypted_client.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_encryption_runtime.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_free_threading.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_gil_contention.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_list_stream.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_profile.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_roundtrip.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_shared_client.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_stream_leak.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_stream_sticky.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_stub_conformance.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_subinterpreter.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/python/test_worker_threads.py +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/support/mock.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/support/mod.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/unit/sign.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/unit.rs +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/README.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/ctx_long.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/ctx_min.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/ctx_utf8.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/manifest.json +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p0_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p0_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p1_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p1_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p200000_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p200000_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p4095_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p4095_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p4096_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p4096_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p4097_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p4097_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p65535_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p65535_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p65536_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p65536_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p65537_f4096.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/esdk/p65537_f65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/README.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/context.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/keyring +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/manifest.json +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/old_key.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_0.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_1.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_200000.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/golden/v1/size_65536.bin +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/keyrings/README.md +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/keyrings/one.keyring +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/keyrings/other.keyring +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/tests/vectors/keyrings/two.keyring +0 -0
- {object_storage_client-0.2.1 → object_storage_client-0.2.3}/uv.lock +0 -0
|
@@ -61,38 +61,9 @@ jobs:
|
|
|
61
61
|
run: cargo clippy --locked --all-targets --all-features -- -D warnings -W clippy::pedantic
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
# The wheels ship the committed THIRD_PARTY_LICENSES.html: build them only if
|
|
65
|
-
# it is what the locked dependencies need, and no license is unaccepted.
|
|
66
|
-
licenses:
|
|
67
|
-
name: Third-party licenses
|
|
68
|
-
runs-on: ubuntu-latest
|
|
69
|
-
|
|
70
|
-
steps:
|
|
71
|
-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
72
|
-
with:
|
|
73
|
-
persist-credentials: false
|
|
74
|
-
|
|
75
|
-
- name: Install Rust
|
|
76
|
-
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
|
|
77
|
-
with:
|
|
78
|
-
toolchain: stable
|
|
79
|
-
|
|
80
|
-
- uses: taiki-e/install-action@86f7a0ffb25f40114606501a311ebcfaf882ea32 # v2.88.0
|
|
81
|
-
with:
|
|
82
|
-
tool: cargo-about@0.9.3
|
|
83
|
-
|
|
84
|
-
- name: Regenerate the notices
|
|
85
|
-
run: >
|
|
86
|
-
cargo about generate --locked --fail --no-default-features
|
|
87
|
-
--features python,encryption about.hbs
|
|
88
|
-
--output-file THIRD_PARTY_LICENSES.html
|
|
89
|
-
|
|
90
|
-
- name: The committed notices are current
|
|
91
|
-
run: git diff --exit-code -- THIRD_PARTY_LICENSES.html
|
|
92
|
-
|
|
93
64
|
build-wheels:
|
|
94
65
|
name: Build wheels (${{ matrix.os }}${{ matrix.target && format(' / {0}', matrix.target) || '' }} / py${{ matrix.python }})
|
|
95
|
-
needs: [ test, rustfmt
|
|
66
|
+
needs: [ test, rustfmt ]
|
|
96
67
|
runs-on: ${{ matrix.runner || matrix.os }}
|
|
97
68
|
|
|
98
69
|
strategy:
|
|
@@ -145,7 +116,7 @@ jobs:
|
|
|
145
116
|
--out dist
|
|
146
117
|
|
|
147
118
|
# PEP 639: the license files are under *.dist-info/licenses/.
|
|
148
|
-
- name: The wheel carries the license
|
|
119
|
+
- name: The wheel carries the license
|
|
149
120
|
shell: bash
|
|
150
121
|
run: |
|
|
151
122
|
py=$(command -v python3 || command -v python)
|
|
@@ -154,12 +125,8 @@ jobs:
|
|
|
154
125
|
for path in sys.argv[1:]:
|
|
155
126
|
with zipfile.ZipFile(path) as wheel:
|
|
156
127
|
names = wheel.namelist()
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
sys.exit(f"{path}: no {name} in dist-info/licenses")
|
|
160
|
-
notices = next(n for n in names if n.endswith("/licenses/THIRD_PARTY_LICENSES.html"))
|
|
161
|
-
if b"Apache Arrow Object Store" not in wheel.read(notices):
|
|
162
|
-
sys.exit(f"{path}: the notices lack object_store's NOTICE")
|
|
128
|
+
if not any(n.endswith(".dist-info/licenses/LICENSE") for n in names):
|
|
129
|
+
sys.exit(f"{path}: no LICENSE in dist-info/licenses")
|
|
163
130
|
PY
|
|
164
131
|
|
|
165
132
|
- name: Upload wheel artifacts
|
|
@@ -171,30 +171,6 @@ jobs:
|
|
|
171
171
|
command: check advisories bans sources
|
|
172
172
|
arguments: --all-features
|
|
173
173
|
|
|
174
|
-
# Fails on a dependency license that about.toml does not accept, and when
|
|
175
|
-
# the committed notices (shipped in the wheels) differ from the locked
|
|
176
|
-
# dependencies. Regenerate as docs/DEVELOPMENT.md explains.
|
|
177
|
-
licenses:
|
|
178
|
-
name: third-party licenses
|
|
179
|
-
runs-on: ubuntu-latest
|
|
180
|
-
steps:
|
|
181
|
-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
182
|
-
with:
|
|
183
|
-
persist-credentials: false
|
|
184
|
-
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
|
|
185
|
-
with:
|
|
186
|
-
toolchain: stable
|
|
187
|
-
- uses: taiki-e/install-action@86f7a0ffb25f40114606501a311ebcfaf882ea32 # v2.88.0
|
|
188
|
-
with:
|
|
189
|
-
tool: cargo-about@0.9.3
|
|
190
|
-
- name: Generate the notices
|
|
191
|
-
run: >
|
|
192
|
-
cargo about generate --locked --fail --no-default-features
|
|
193
|
-
--features python,encryption about.hbs
|
|
194
|
-
--output-file "$RUNNER_TEMP/THIRD_PARTY_LICENSES.html"
|
|
195
|
-
- name: The committed notices are current
|
|
196
|
-
run: diff -u THIRD_PARTY_LICENSES.html "$RUNNER_TEMP/THIRD_PARTY_LICENSES.html"
|
|
197
|
-
|
|
198
174
|
# Merges a Dependabot PR only after every other job above has succeeded.
|
|
199
175
|
#
|
|
200
176
|
# `pull_request` (not `pull_request_target`): the PR's code runs with a
|
|
@@ -203,7 +179,7 @@ jobs:
|
|
|
203
179
|
# never gets a write token here, so this job cannot act on one.
|
|
204
180
|
dependabot-merge:
|
|
205
181
|
name: Approve and merge (Dependabot)
|
|
206
|
-
needs: [tests, msrv, integration, lint, features, python, esdk-interop, deny
|
|
182
|
+
needs: [tests, msrv, integration, lint, features, python, esdk-interop, deny]
|
|
207
183
|
# The PR author, not only `github.actor` (whoever triggered the latest event).
|
|
208
184
|
if: >-
|
|
209
185
|
github.event_name == 'pull_request'
|
|
@@ -195,9 +195,9 @@ dependencies = [
|
|
|
195
195
|
|
|
196
196
|
[[package]]
|
|
197
197
|
name = "aws-lc-rs"
|
|
198
|
-
version = "1.
|
|
198
|
+
version = "1.19.0"
|
|
199
199
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
200
|
-
checksum = "
|
|
200
|
+
checksum = "048006790404103c488e6c5616b3e7e702a71292aadda08e8f7698a9e0d2eb53"
|
|
201
201
|
dependencies = [
|
|
202
202
|
"aws-lc-sys",
|
|
203
203
|
"zeroize",
|
|
@@ -205,9 +205,9 @@ dependencies = [
|
|
|
205
205
|
|
|
206
206
|
[[package]]
|
|
207
207
|
name = "aws-lc-sys"
|
|
208
|
-
version = "0.
|
|
208
|
+
version = "0.47.0"
|
|
209
209
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
210
|
-
checksum = "
|
|
210
|
+
checksum = "8bfbe32ac36b3c428696ce315464181bc4029d689fd58e3f2a4e58c252242f52"
|
|
211
211
|
dependencies = [
|
|
212
212
|
"cc",
|
|
213
213
|
"cmake",
|
|
@@ -479,9 +479,9 @@ dependencies = [
|
|
|
479
479
|
|
|
480
480
|
[[package]]
|
|
481
481
|
name = "aws-smithy-schema"
|
|
482
|
-
version = "1.1.
|
|
482
|
+
version = "1.1.2"
|
|
483
483
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
484
|
-
checksum = "
|
|
484
|
+
checksum = "9543fc722ed4865ab29fb66bd7ed0bef7b029d265ba8c587144511e30006d431"
|
|
485
485
|
dependencies = [
|
|
486
486
|
"aws-smithy-runtime-api",
|
|
487
487
|
"aws-smithy-types",
|
|
@@ -974,9 +974,9 @@ dependencies = [
|
|
|
974
974
|
|
|
975
975
|
[[package]]
|
|
976
976
|
name = "ctutils"
|
|
977
|
-
version = "0.4.
|
|
977
|
+
version = "0.4.7"
|
|
978
978
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
979
|
-
checksum = "
|
|
979
|
+
checksum = "a2376ffd6f96d8a9db59875b4b6b0237d6900b5baf64279714e05493ce64828a"
|
|
980
980
|
dependencies = [
|
|
981
981
|
"cmov",
|
|
982
982
|
]
|
|
@@ -2024,7 +2024,7 @@ dependencies = [
|
|
|
2024
2024
|
|
|
2025
2025
|
[[package]]
|
|
2026
2026
|
name = "object-storage-client"
|
|
2027
|
-
version = "0.2.
|
|
2027
|
+
version = "0.2.3"
|
|
2028
2028
|
dependencies = [
|
|
2029
2029
|
"alloc-counter",
|
|
2030
2030
|
"async-trait",
|
|
@@ -2042,7 +2042,6 @@ dependencies = [
|
|
|
2042
2042
|
"futures",
|
|
2043
2043
|
"http",
|
|
2044
2044
|
"http-body",
|
|
2045
|
-
"http-body-util",
|
|
2046
2045
|
"object_store",
|
|
2047
2046
|
"percent-encoding",
|
|
2048
2047
|
"proptest",
|
|
@@ -2118,9 +2117,9 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
|
2118
2117
|
|
|
2119
2118
|
[[package]]
|
|
2120
2119
|
name = "openssl-probe"
|
|
2121
|
-
version = "0.2.
|
|
2120
|
+
version = "0.2.2"
|
|
2122
2121
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2123
|
-
checksum = "
|
|
2122
|
+
checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1"
|
|
2124
2123
|
|
|
2125
2124
|
[[package]]
|
|
2126
2125
|
name = "outref"
|
|
@@ -2643,9 +2642,9 @@ dependencies = [
|
|
|
2643
2642
|
|
|
2644
2643
|
[[package]]
|
|
2645
2644
|
name = "rustix"
|
|
2646
|
-
version = "1.1.
|
|
2645
|
+
version = "1.1.6"
|
|
2647
2646
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2648
|
-
checksum = "
|
|
2647
|
+
checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
|
|
2649
2648
|
dependencies = [
|
|
2650
2649
|
"bitflags 2.13.2",
|
|
2651
2650
|
"errno",
|
|
@@ -2991,9 +2990,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
|
2991
2990
|
|
|
2992
2991
|
[[package]]
|
|
2993
2992
|
name = "smallvec"
|
|
2994
|
-
version = "1.16.
|
|
2993
|
+
version = "1.16.4"
|
|
2995
2994
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2996
|
-
checksum = "
|
|
2995
|
+
checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
|
|
2997
2996
|
|
|
2998
2997
|
[[package]]
|
|
2999
2998
|
name = "socket2"
|
|
@@ -3305,9 +3304,9 @@ dependencies = [
|
|
|
3305
3304
|
|
|
3306
3305
|
[[package]]
|
|
3307
3306
|
name = "tonic"
|
|
3308
|
-
version = "0.14.
|
|
3307
|
+
version = "0.14.9"
|
|
3309
3308
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3310
|
-
checksum = "
|
|
3309
|
+
checksum = "e2cdfc673aabd30fe8fee92e65837b644c37c5d47f0f97ae6d5e0f1237d15e1b"
|
|
3311
3310
|
dependencies = [
|
|
3312
3311
|
"async-trait",
|
|
3313
3312
|
"axum",
|
|
@@ -3335,9 +3334,9 @@ dependencies = [
|
|
|
3335
3334
|
|
|
3336
3335
|
[[package]]
|
|
3337
3336
|
name = "tonic-prost"
|
|
3338
|
-
version = "0.14.
|
|
3337
|
+
version = "0.14.9"
|
|
3339
3338
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3340
|
-
checksum = "
|
|
3339
|
+
checksum = "eba464054e2226f182a34489b8b079bf4c6e3e7ab5fd7fc30e024f24aa92a484"
|
|
3341
3340
|
dependencies = [
|
|
3342
3341
|
"bytes",
|
|
3343
3342
|
"prost",
|
|
@@ -3475,9 +3474,12 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
|
|
|
3475
3474
|
|
|
3476
3475
|
[[package]]
|
|
3477
3476
|
name = "utf8_iter"
|
|
3478
|
-
version = "1.0
|
|
3477
|
+
version = "1.1.0"
|
|
3479
3478
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3480
|
-
checksum = "
|
|
3479
|
+
checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
|
|
3480
|
+
dependencies = [
|
|
3481
|
+
"utf_types",
|
|
3482
|
+
]
|
|
3481
3483
|
|
|
3482
3484
|
[[package]]
|
|
3483
3485
|
name = "utf8parse"
|
|
@@ -3485,6 +3487,12 @@ version = "0.2.2"
|
|
|
3485
3487
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3486
3488
|
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|
3487
3489
|
|
|
3490
|
+
[[package]]
|
|
3491
|
+
name = "utf_types"
|
|
3492
|
+
version = "1.0.0"
|
|
3493
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3494
|
+
checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
|
|
3495
|
+
|
|
3488
3496
|
[[package]]
|
|
3489
3497
|
name = "uuid"
|
|
3490
3498
|
version = "1.29.0"
|
|
@@ -3828,9 +3836,9 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
|
|
|
3828
3836
|
|
|
3829
3837
|
[[package]]
|
|
3830
3838
|
name = "xattr"
|
|
3831
|
-
version = "1.
|
|
3839
|
+
version = "1.7.0"
|
|
3832
3840
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3833
|
-
checksum = "
|
|
3841
|
+
checksum = "963d6fab92d5504b971dc8bd90ca743c2575e590bc8071ea5bc571598667ae08"
|
|
3834
3842
|
dependencies = [
|
|
3835
3843
|
"libc",
|
|
3836
3844
|
"rustix",
|
|
@@ -9,7 +9,7 @@ license = "GPL-3.0-only"
|
|
|
9
9
|
name = "object-storage-client"
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
repository = "https://github.com/bixority/object-storage-client"
|
|
12
|
-
version = "0.2.
|
|
12
|
+
version = "0.2.3"
|
|
13
13
|
|
|
14
14
|
[lib]
|
|
15
15
|
crate-type = ["cdylib", "rlib"]
|
|
@@ -20,7 +20,7 @@ name = "object_storage_client"
|
|
|
20
20
|
async-trait = "0.1"
|
|
21
21
|
aws-config = { version = "1.13", default-features = false, features = ["rt-tokio", "default-https-client", "sso", "credentials-process"] }
|
|
22
22
|
aws-credential-types = "1.3"
|
|
23
|
-
aws-lc-rs = { version = "1.
|
|
23
|
+
aws-lc-rs = { version = "1.19", default-features = false, features = ["aws-lc-sys", "prebuilt-nasm"] }
|
|
24
24
|
aws-runtime = "1.10"
|
|
25
25
|
aws-sigv4 = { version = "1.6", default-features = false, features = ["sign-http", "http1"] }
|
|
26
26
|
aws-types = "1.7"
|
|
@@ -30,7 +30,6 @@ clap = { version = "4.6", features = ["derive", "env"], optional = true }
|
|
|
30
30
|
futures = "0.3"
|
|
31
31
|
http = "1.5"
|
|
32
32
|
http-body = "1"
|
|
33
|
-
http-body-util = "0.1"
|
|
34
33
|
object_store = { version = "0.14", features = ["aws", "gcp", "azure", "http"] }
|
|
35
34
|
percent-encoding = "2.3"
|
|
36
35
|
reqwest = { version = "0.13", features = ["rustls"], default-features = false }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: object-storage-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -8,7 +8,6 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3.14
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.15
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
License-File: THIRD_PARTY_LICENSES.html
|
|
12
11
|
Summary: Unified object storage client API
|
|
13
12
|
Keywords: object-store,s3,gcs,azure,python
|
|
14
13
|
Author-email: Olegs Korsaks <bixority@proton.me>
|
|
@@ -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.
|
|
@@ -51,28 +51,6 @@ names (`AWS_CONFIG_FILE`, `AWS_SHARED_CREDENTIALS_FILE`), but the AWS SDK still
|
|
|
51
51
|
reads the process environment (SSO and STS endpoint variables, FIPS settings)
|
|
52
52
|
and `HOME` (the SSO token cache).
|
|
53
53
|
|
|
54
|
-
## Third-party licenses
|
|
55
|
-
|
|
56
|
-
The wheels statically link their dependency crates, so they ship
|
|
57
|
-
`THIRD_PARTY_LICENSES.html` next to `LICENSE` (`license-files` in
|
|
58
|
-
`pyproject.toml`; PEP 639 puts both under `*.dist-info/licenses/`). It lists
|
|
59
|
-
the license texts of the crates in the wheel (normal dependencies with
|
|
60
|
-
`--no-default-features --features python,encryption`) and the NOTICE of
|
|
61
|
-
`object_store`, which Apache-2.0 section 4(d) requires. `about.toml` names the
|
|
62
|
-
licenses that are accepted (a dependency under another one fails the `licenses`
|
|
63
|
-
jobs of `tests.yaml` and `ci.yaml`) and `about.hbs` is the template. After a
|
|
64
|
-
dependency change, regenerate and commit the file:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
cargo install --locked cargo-about --version 0.9.3
|
|
68
|
-
cargo about generate --locked --fail --no-default-features \
|
|
69
|
-
--features python,encryption about.hbs --output-file THIRD_PARTY_LICENSES.html
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The NOTICE text in `about.hbs` is static; keep it equal to the `NOTICE.txt` of
|
|
73
|
-
the locked `object_store`. The crate published to the registry is source only
|
|
74
|
-
and needs no notices file.
|
|
75
|
-
|
|
76
54
|
## Checks
|
|
77
55
|
|
|
78
56
|
CI runs these on every pull request, alongside the tests:
|
|
@@ -10,7 +10,7 @@ authors = [
|
|
|
10
10
|
{ name = "Olegs Korsaks", email = "bixority@proton.me" }
|
|
11
11
|
]
|
|
12
12
|
license = "GPL-3.0-only"
|
|
13
|
-
license-files = [ "LICENSE"
|
|
13
|
+
license-files = [ "LICENSE" ]
|
|
14
14
|
readme = "README.md"
|
|
15
15
|
requires-python = ">=3.13.9,<3.16.0"
|
|
16
16
|
classifiers = [
|
|
@@ -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")];
|