mirror of
https://github.com/rustfs/rustfs.git
synced 2026-11-26 10:22:44 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c269a1233d | |||
| 986fb4269b | |||
| 567b11079c | |||
| eefac8595c | |||
| 961b0c79c8 |
Generated
+29
-38
@@ -255,7 +255,7 @@ version = "1.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
||||
dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -266,7 +266,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"once_cell_polyfill",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2015,7 +2015,7 @@ dependencies = [
|
||||
"maybe-owned",
|
||||
"rustix",
|
||||
"rustix-linux-procfs",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
"winx",
|
||||
]
|
||||
|
||||
@@ -4186,7 +4186,7 @@ dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4507,7 +4507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4701,7 +4701,7 @@ checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a"
|
||||
dependencies = [
|
||||
"io-lifetimes 2.0.4",
|
||||
"rustix",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5892,7 +5892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "20fd6de4ccfcc187e38bc21cfa543cb5a302cb86a8b114eb7f0bf0dc9f8ac00f"
|
||||
dependencies = [
|
||||
"io-lifetimes 3.0.1",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7196,7 +7196,7 @@ version = "0.50.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
||||
dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9149,7 +9149,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"socket2",
|
||||
"tracing",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9483,7 +9483,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"rustix",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -10434,7 +10434,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway"
|
||||
version = "0.67.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"bytes",
|
||||
@@ -10481,7 +10481,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-core"
|
||||
version = "0.64.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
@@ -10502,7 +10502,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-corpus"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -10512,7 +10512,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-corpus-recorder"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http 1.5.0",
|
||||
@@ -10527,7 +10527,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-dialect-rustfs-admin"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"form_urlencoded",
|
||||
@@ -10541,7 +10541,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-http"
|
||||
version = "0.1.4"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"hmac 0.13.0",
|
||||
"http 1.5.0",
|
||||
@@ -10559,7 +10559,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-macros"
|
||||
version = "0.1.4"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -10569,7 +10569,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-sig"
|
||||
version = "0.16.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"hmac 0.13.0",
|
||||
"http 1.5.0",
|
||||
@@ -10584,7 +10584,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-stream"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"bytes",
|
||||
@@ -10595,7 +10595,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-types"
|
||||
version = "0.42.0+aws.2026-10-02"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"crc-fast",
|
||||
@@ -10617,7 +10617,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rustfs-gateway-xml"
|
||||
version = "0.4.0"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
|
||||
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
]
|
||||
@@ -11873,7 +11873,7 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -11955,7 +11955,7 @@ dependencies = [
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"webpki-root-certs",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -12779,7 +12779,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -12930,7 +12930,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"psm",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -13241,7 +13241,7 @@ dependencies = [
|
||||
"getrandom 0.3.4",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -14354,7 +14354,7 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -14509,15 +14509,6 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.59.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
||||
dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
@@ -14690,7 +14681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -14962,7 +14953,7 @@ dependencies = [
|
||||
"sha1 0.11.0",
|
||||
"time",
|
||||
"typed-path",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
"zeroize",
|
||||
"zopfli",
|
||||
"zstd 0.14.4",
|
||||
|
||||
+7
-7
@@ -153,17 +153,17 @@ rustfs-utils = { path = "crates/utils", version = "1.0.5" }
|
||||
rustfs-zip = { path = "./crates/zip", version = "1.0.5" }
|
||||
|
||||
# Pin the gateway and its protocol crates to the same revision.
|
||||
rustfs-gateway-types = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.42.0", default-features = false }
|
||||
rustfs-gateway-stream = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.2.0", default-features = false }
|
||||
rustfs-gateway-types = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.42.0", default-features = false }
|
||||
rustfs-gateway-stream = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.2.0", default-features = false }
|
||||
# The gateway framework itself, consumed for its extension traits by the ring-2
|
||||
# adapter. `default-features = false` keeps the `server` feature, and with it the
|
||||
# server crate, out of the build.
|
||||
rustfs-gateway = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.67.0", default-features = false }
|
||||
rustfs-gateway = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.67.0", default-features = false }
|
||||
# Test-only: builds the `EffectiveHost` a host-resolution test queries with.
|
||||
rustfs-gateway-http = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", default-features = false }
|
||||
rustfs-gateway-core = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.64.0", default-features = false }
|
||||
rustfs-gateway-corpus-recorder = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.1.0", default-features = false }
|
||||
rustfs-gateway-dialect-rustfs-admin = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.13.0", default-features = false }
|
||||
rustfs-gateway-http = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", default-features = false }
|
||||
rustfs-gateway-core = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.64.0", default-features = false }
|
||||
rustfs-gateway-corpus-recorder = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.1.0", default-features = false }
|
||||
rustfs-gateway-dialect-rustfs-admin = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.13.0", default-features = false }
|
||||
|
||||
# Async Runtime and Networking
|
||||
async-channel = "2.5.0"
|
||||
|
||||
@@ -829,6 +829,8 @@ async fn test_bucket_tags_opa_contract() -> TestResult {
|
||||
.send()
|
||||
.await?;
|
||||
opa.expect_bucket_tags("s3:PutObject", source, Some("finance")).await?;
|
||||
// A non-empty x-amz-tagging header is authorized after PutObject.
|
||||
opa.expect_bucket_tags("s3:PutObjectTagging", source, Some("finance")).await?;
|
||||
let version = written.version_id().ok_or("versioned PUT must return a version ID")?;
|
||||
let read = client
|
||||
.get_object()
|
||||
@@ -904,6 +906,8 @@ async fn test_bucket_tags_opa_contract() -> TestResult {
|
||||
opa.expect_versioned_tag_permission(source, "report", version).await?;
|
||||
}
|
||||
opa.expect_bucket_tags("s3:PutObject", destination, Some("finance")).await?;
|
||||
opa.expect_bucket_tags("s3:PutObjectTagging", destination, Some("finance"))
|
||||
.await?;
|
||||
}
|
||||
let tags = admin.get_object_tagging().bucket(destination).key("copied").send().await?;
|
||||
assert_eq!(tags.tag_set().len(), 1);
|
||||
|
||||
@@ -1079,8 +1079,9 @@ fn clamp_ask_disks_to_available(ask_disks: i32, available_disks: usize) -> i32 {
|
||||
ask_disks.min(bounded_usize_to_i32(available_disks))
|
||||
}
|
||||
|
||||
fn parse_version_marker(marker: String) -> Result<VersionMarker> {
|
||||
Ok(VersionMarker::parse(marker)?)
|
||||
fn parse_version_marker(bucket: &str, key_marker: Option<&str>, marker: String) -> Result<VersionMarker> {
|
||||
VersionMarker::parse(&marker)
|
||||
.map_err(|_| StorageError::InvalidVersionID(bucket.to_owned(), key_marker.unwrap_or_default().to_owned(), marker))
|
||||
}
|
||||
|
||||
fn version_marker_for_entries(
|
||||
@@ -1498,11 +1499,9 @@ impl ECStore {
|
||||
}
|
||||
|
||||
let has_version_marker = version_marker.is_some();
|
||||
let version_marker = if let Some(marker) = version_marker {
|
||||
Some(parse_version_marker(marker)?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let version_marker = version_marker
|
||||
.map(|raw| parse_version_marker(bucket, marker.as_deref(), raw))
|
||||
.transpose()?;
|
||||
|
||||
let effective_max_keys = list_versions_scan_limit(max_keys, has_version_marker);
|
||||
let opts = ListPathOptions {
|
||||
@@ -2987,7 +2986,9 @@ impl SetDisks {
|
||||
}
|
||||
|
||||
let has_version_marker = version_marker.is_some();
|
||||
let version_marker = version_marker.map(parse_version_marker).transpose()?;
|
||||
let version_marker = version_marker
|
||||
.map(|raw| parse_version_marker(bucket, marker.as_deref(), raw))
|
||||
.transpose()?;
|
||||
let effective_max_keys = list_versions_scan_limit(max_keys, has_version_marker);
|
||||
let opts = ListPathOptions {
|
||||
bucket: bucket.to_owned(),
|
||||
@@ -5356,6 +5357,87 @@ mod test {
|
||||
assert!(resumed.next_continuation_token.is_none());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn list_object_versions_rejects_invalid_version_id_marker_and_accepts_control_delimiter() {
|
||||
use crate::storage_api_contracts::bucket::BucketOperations as _;
|
||||
use crate::storage_api_contracts::object::ObjectIO as _;
|
||||
|
||||
let bucket = "invalid-version-marker";
|
||||
let (_dirs, store) = crate::bucket::metadata_sys::test_support::isolated_store_over_temp_disks().await;
|
||||
crate::bucket::metadata_sys::init_bucket_metadata_sys(store.clone(), Vec::new()).await;
|
||||
store
|
||||
.make_bucket(bucket, &crate::storage_api_contracts::bucket::MakeBucketOptions::default())
|
||||
.await
|
||||
.expect("create bucket");
|
||||
store
|
||||
.put_object(
|
||||
bucket,
|
||||
"obj-a",
|
||||
&mut crate::object_api::PutObjReader::from_vec(vec![1]),
|
||||
&crate::object_api::ObjectOptions::default(),
|
||||
)
|
||||
.await
|
||||
.expect("seed object");
|
||||
|
||||
let err = store
|
||||
.clone()
|
||||
.inner_list_object_versions(bucket, "", Some("k".to_string()), Some("v".to_string()), Some("\x0f".to_string()), 8)
|
||||
.await
|
||||
.expect_err("non-UUID version-id-marker must be rejected");
|
||||
assert!(
|
||||
matches!(
|
||||
&err,
|
||||
StorageError::InvalidVersionID(err_bucket, err_key, err_version)
|
||||
if err_bucket == bucket && err_key == "k" && err_version == "v"
|
||||
),
|
||||
"expected InvalidVersionID, got: {err:?}"
|
||||
);
|
||||
|
||||
let delete_err = store.pools[0].disk_set[0]
|
||||
.clone()
|
||||
.inner_list_object_versions_for_recursive_delete(bucket, "", Some("k".to_string()), Some("v".to_string()), 8)
|
||||
.await
|
||||
.expect_err("recursive-delete listing must reject non-UUID version-id-marker");
|
||||
assert!(
|
||||
matches!(
|
||||
&delete_err,
|
||||
StorageError::InvalidVersionID(err_bucket, err_key, err_version)
|
||||
if err_bucket == bucket && err_key == "k" && err_version == "v"
|
||||
),
|
||||
"expected InvalidVersionID, got: {delete_err:?}"
|
||||
);
|
||||
|
||||
let control_delim_page = store
|
||||
.clone()
|
||||
.inner_list_object_versions(bucket, "", None, None, Some("\x0f".to_string()), 8)
|
||||
.await
|
||||
.expect("control-character delimiter without version-id-marker must succeed");
|
||||
assert_eq!(
|
||||
control_delim_page
|
||||
.objects
|
||||
.iter()
|
||||
.map(|object| object.name.as_str())
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["obj-a"]
|
||||
);
|
||||
assert!(control_delim_page.prefixes.is_empty());
|
||||
|
||||
let valid_null_marker_page = store
|
||||
.clone()
|
||||
.inner_list_object_versions(bucket, "", Some("k".to_string()), Some("null".to_string()), Some("\x0f".to_string()), 8)
|
||||
.await
|
||||
.expect("valid null version-id-marker with control-character delimiter must succeed");
|
||||
assert_eq!(
|
||||
valid_null_marker_page
|
||||
.objects
|
||||
.iter()
|
||||
.map(|object| object.name.as_str())
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["obj-a"]
|
||||
);
|
||||
assert!(valid_null_marker_page.prefixes.is_empty());
|
||||
}
|
||||
|
||||
// ECA-03 / #944: a page whose raw keys fully collapse into fewer than max_keys
|
||||
// common prefixes must still report truncation and carry a continuation marker,
|
||||
// otherwise every key beyond the scan window is silently dropped.
|
||||
@@ -8445,12 +8527,33 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_null_version_marker_handling() {
|
||||
let parsed = parse_version_marker("null".to_string()).expect("null marker should parse");
|
||||
let parsed = parse_version_marker("bucket", Some("key"), "null".to_string()).expect("null marker should parse");
|
||||
assert_eq!(parsed, VersionMarker::Null);
|
||||
|
||||
let valid_uuid = "550e8400-e29b-41d4-a716-446655440000";
|
||||
let parsed = parse_version_marker(valid_uuid.to_string()).expect("uuid marker should parse");
|
||||
let parsed = parse_version_marker("bucket", Some("key"), valid_uuid.to_string()).expect("uuid marker should parse");
|
||||
assert_eq!(parsed, VersionMarker::Version(Uuid::parse_str(valid_uuid).unwrap()));
|
||||
|
||||
let invalid = parse_version_marker("bkt", Some("k"), "v".to_string()).expect_err("invalid marker should fail");
|
||||
assert!(
|
||||
matches!(
|
||||
&invalid,
|
||||
StorageError::InvalidVersionID(bucket, key, version)
|
||||
if bucket == "bkt" && key == "k" && version == "v"
|
||||
),
|
||||
"expected InvalidVersionID, got: {invalid:?}"
|
||||
);
|
||||
|
||||
let invalid_without_key =
|
||||
parse_version_marker("bkt", None, "v".to_string()).expect_err("invalid marker without key should fail");
|
||||
assert!(
|
||||
matches!(
|
||||
&invalid_without_key,
|
||||
StorageError::InvalidVersionID(bucket, key, version)
|
||||
if bucket == "bkt" && key.is_empty() && version == "v"
|
||||
),
|
||||
"expected InvalidVersionID with empty key, got: {invalid_without_key:?}"
|
||||
);
|
||||
}
|
||||
|
||||
/// Test that next_version_idmarker returns "null" for non-versioned objects
|
||||
@@ -8476,7 +8579,7 @@ mod test {
|
||||
// Server parses "null" as an explicit null-version marker
|
||||
let server_response = "null";
|
||||
let client_request = server_response;
|
||||
let parsed = parse_version_marker(client_request.to_string()).expect("null marker should parse");
|
||||
let parsed = parse_version_marker("bucket", Some("key"), client_request.to_string()).expect("null marker should parse");
|
||||
assert_eq!(parsed, VersionMarker::Null);
|
||||
|
||||
// Scenario 2: Versioned object
|
||||
@@ -8486,7 +8589,7 @@ mod test {
|
||||
let uuid_str = "550e8400-e29b-41d4-a716-446655440000";
|
||||
let server_response = uuid_str;
|
||||
let client_request = server_response;
|
||||
let parsed = parse_version_marker(client_request.to_string()).expect("uuid marker should parse");
|
||||
let parsed = parse_version_marker("bucket", Some("key"), client_request.to_string()).expect("uuid marker should parse");
|
||||
assert_eq!(parsed, VersionMarker::Version(Uuid::parse_str(uuid_str).unwrap()));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@ The gateway release serves S3 with rustfs/gateway. Remove `RUSTFS_S3_STACK` from
|
||||
| `PutBucketPolicy` (`#2684`, `8f81762a6`) | For a malformed JSON policy body, both versions return HTTP 400. The gateway returns the XML error code `MalformedPolicy` (matching AWS S3). RustFS `1.0.5` returns `InvalidArgument`. Clients that classify bucket-policy validation errors by code need to handle both during a rollout. |
|
||||
| `CreateBucket` (`#2684`, `8676d2f3b`) | For a successful default-region `CreateBucket` (`200 OK`), the gateway returns HTTP `Location: /<bucket>` (matching AWS S3 and `c-bkt-0001`). RustFS `1.0.5` omits the `Location` header. Clients that inspect `Location` on bucket creation need to handle its presence on gateway nodes and absence on `1.0.5` nodes during a rollout. |
|
||||
|
||||
`c-sig-0598` is recorded in the [pinned gateway conformance rulings](https://github.com/rustfs/gateway/blob/095d4763a3f58a5e1d22fe7a231bf1c105473de8/conformance/rulings/rustfs-profile.toml); host-assembled conformance rulings are tracked in [`.config/conformance-rulings.toml`](../../.config/conformance-rulings.toml), and the signed `PutBucketPolicy` and `CreateBucket` `accepted-change` rulings are recorded in `rustfs/backlog#2684`.
|
||||
`c-sig-0598` is recorded in the [pinned gateway conformance rulings](https://github.com/rustfs/gateway/blob/b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b/conformance/rulings/rustfs-profile.toml); host-assembled conformance rulings are tracked in [`.config/conformance-rulings.toml`](../../.config/conformance-rulings.toml), and the signed `PutBucketPolicy` and `CreateBucket` `accepted-change` rulings are recorded in `rustfs/backlog#2684`.
|
||||
|
||||
@@ -338,4 +338,109 @@ mod tests {
|
||||
.expect_err("no store");
|
||||
assert_eq!(err.code(), &S3ErrorCode::InternalError);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial_test::serial]
|
||||
fn list_object_versions_rejects_invalid_version_id_marker_with_bad_request_and_handles_control_delimiter() {
|
||||
use crate::app::gating_test_env::{run_large_stack_test, shared_gating_ambient, shared_gating_ecstore};
|
||||
use crate::app::metadata_listing::{MetadataListQuery, VersionsQuery};
|
||||
use rustfs_gateway::{Limits, MetaView, OperationCodec, ResponseBody, TargetKind, WireRequest};
|
||||
|
||||
run_large_stack_test("list-versions-invalid-marker", || async {
|
||||
let usecase = DefaultBucketUsecase::with_context(Some(shared_gating_ambient().await));
|
||||
let store = shared_gating_ecstore().await;
|
||||
let bucket = BucketName::new(format!("list-versions-marker-{}", uuid::Uuid::new_v4().simple())).unwrap();
|
||||
store
|
||||
.make_bucket(bucket.as_str(), &MakeBucketOptions::default())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let err = usecase
|
||||
.execute_list_object_versions(
|
||||
owned_envelope(http::Method::GET),
|
||||
gateway_dto::ListObjectVersionsInput {
|
||||
bucket: bucket.clone(),
|
||||
key_marker: Some("k".to_owned()),
|
||||
version_id_marker: Some(OpaqueString::from("v")),
|
||||
delimiter: Some("\x0f".to_owned()),
|
||||
max_keys: Some(8),
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.expect_err("invalid version-id-marker must be rejected");
|
||||
assert_eq!(err.code(), &S3ErrorCode::InvalidArgument);
|
||||
assert_eq!(err.status_code(), Some(StatusCode::BAD_REQUEST));
|
||||
|
||||
let metadata_err = usecase
|
||||
.list_object_versions_metadata(
|
||||
&owned_envelope(http::Method::GET),
|
||||
VersionsQuery {
|
||||
listing: MetadataListQuery {
|
||||
bucket: bucket.as_str().to_owned(),
|
||||
delimiter: Some("\x0f".to_owned()),
|
||||
max_keys: Some(8),
|
||||
..Default::default()
|
||||
},
|
||||
key_marker: Some("k".to_owned()),
|
||||
version_id_marker: Some("v".to_owned()),
|
||||
},
|
||||
)
|
||||
.await
|
||||
.expect_err("metadata listing must reject invalid version-id-marker");
|
||||
assert_eq!(metadata_err.code(), &S3ErrorCode::InvalidArgument);
|
||||
assert_eq!(metadata_err.status_code(), Some(StatusCode::BAD_REQUEST));
|
||||
|
||||
let output = usecase
|
||||
.execute_list_object_versions(
|
||||
owned_envelope(http::Method::GET),
|
||||
gateway_dto::ListObjectVersionsInput {
|
||||
bucket: bucket.clone(),
|
||||
key_marker: Some("k".to_owned()),
|
||||
version_id_marker: Some(OpaqueString::from("null")),
|
||||
delimiter: Some("\x0f".to_owned()),
|
||||
max_keys: Some(8),
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.expect("valid version-id-marker with control delimiter must succeed");
|
||||
assert_eq!(output.delimiter.as_deref(), Some("\x0f"));
|
||||
|
||||
let request = http::Request::get(format!("http://localhost/{}?versions&delimiter=%0F", bucket.as_str()))
|
||||
.header(http::header::HOST, "localhost")
|
||||
.body(bytes::Bytes::new())
|
||||
.unwrap();
|
||||
let wire = WireRequest::accept(request, &Limits::default()).unwrap();
|
||||
let view = MetaView::of(&wire, TargetKind::Bucket).unwrap().with_rustfs_response_layout();
|
||||
let encoded =
|
||||
gateway_dto::ListObjectVersions::encode(output, &view, 200).expect("control delimiter response must encode");
|
||||
assert_eq!(encoded.status, StatusCode::OK);
|
||||
let ResponseBody::Complete(bytes) = encoded.body else {
|
||||
panic!("ListObjectVersions must return an XML document");
|
||||
};
|
||||
let xml = String::from_utf8(bytes).expect("ListObjectVersions XML must be UTF-8");
|
||||
assert!(xml.contains("<Delimiter>%0F</Delimiter>"), "unexpected XML: {xml}");
|
||||
|
||||
let metadata_output = usecase
|
||||
.list_object_versions_metadata(
|
||||
&owned_envelope(http::Method::GET),
|
||||
VersionsQuery {
|
||||
listing: MetadataListQuery {
|
||||
bucket: bucket.as_str().to_owned(),
|
||||
delimiter: Some("\x0f".to_owned()),
|
||||
max_keys: Some(8),
|
||||
..Default::default()
|
||||
},
|
||||
key_marker: Some("k".to_owned()),
|
||||
version_id_marker: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
.expect("metadata listing with control delimiter must succeed");
|
||||
metadata_output
|
||||
.to_xml()
|
||||
.expect("metadata listing XML with control delimiter must serialize");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,11 +389,8 @@ mod tests {
|
||||
"every plaintext POST Object SSE-C form upload must increment the counter"
|
||||
);
|
||||
let logs = String::from_utf8(buffer.0.lock().expect("log buffer").clone()).expect("UTF-8 logs");
|
||||
let warning_lines: Vec<_> = logs
|
||||
.lines()
|
||||
.filter(|line| line.contains("ssec_request_without_tls"))
|
||||
.collect();
|
||||
assert_eq!(warning_lines.len(), 1, "the plaintext SSE-C warning must fire once per process");
|
||||
let warning_count = logs.lines().filter(|line| line.contains("ssec_request_without_tls")).count();
|
||||
assert_eq!(warning_count, 1, "the plaintext SSE-C warning must fire once per process");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user