mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-16 01:48:21 +00:00
fix(policy): support version ID condition keys (#5810)
This commit is contained in:
@@ -1389,6 +1389,19 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn version_id_condition_ignores_spoofed_headers() {
|
||||
let cred = create_test_credentials();
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert("versionid", "spoofed-version".parse().unwrap());
|
||||
|
||||
let conditions = get_condition_values(&headers, &cred, None, None, None);
|
||||
assert_eq!(conditions.get("versionid"), None);
|
||||
|
||||
let conditions = get_condition_values(&headers, &cred, Some("server-version"), None, None);
|
||||
assert_eq!(conditions.get("versionid"), Some(&vec!["server-version".to_string()]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ghsa_6r96_claim_condition_keys_ignore_spoofed_headers() {
|
||||
// The credential carries no groups/roles claims, so these keys are absent --
|
||||
|
||||
Reference in New Issue
Block a user