mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-01 09:48:20 +00:00
fix(tier): harden reference proof and audit output (#6807)
Validate lifecycle tier references through the tier reference proof path, preserve S3 list CommonPrefix XML compatibility, and make GetObject audit completion use real S3 error status codes. Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -396,3 +396,30 @@ impl DeleteMultiObjects {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::ListBucketV2Result;
|
||||
|
||||
#[test]
|
||||
fn list_bucket_v2_common_prefix_accepts_s3_pascal_case_xml() {
|
||||
let xml = r#"
|
||||
<ListBucketResult>
|
||||
<Name>tier-bucket</Name>
|
||||
<Prefix></Prefix>
|
||||
<KeyCount>1</KeyCount>
|
||||
<MaxKeys>1000</MaxKeys>
|
||||
<Delimiter>/</Delimiter>
|
||||
<IsTruncated>false</IsTruncated>
|
||||
<CommonPrefixes>
|
||||
<Prefix>tenant-a/</Prefix>
|
||||
</CommonPrefixes>
|
||||
</ListBucketResult>
|
||||
"#;
|
||||
|
||||
let result = quick_xml::de::from_str::<ListBucketV2Result>(xml).expect("S3 list response should decode");
|
||||
|
||||
assert_eq!(result.common_prefixes.len(), 1);
|
||||
assert_eq!(result.common_prefixes[0].prefix, "tenant-a/");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user