mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 01:47:47 +08:00
feat(security): harden client IP and admin controls
This commit is contained in:
@@ -355,7 +355,8 @@ fn openai_reasoning_effort_value(suffix: &str) -> Option<&'static str> {
|
||||
"low" => Some("low"),
|
||||
"medium" => Some("medium"),
|
||||
"high" => Some("high"),
|
||||
"xhigh" | "max" => Some("xhigh"),
|
||||
"xhigh" => Some("xhigh"),
|
||||
"max" => Some("max"),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -457,6 +458,22 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn default_max_suffix_is_preserved_for_openai_formats() {
|
||||
assert_eq!(
|
||||
default_reasoning_mapping("openai:chat", "max"),
|
||||
Some(json!({ "reasoning_effort": "max" }))
|
||||
);
|
||||
assert_eq!(
|
||||
default_reasoning_mapping("openai:responses", "max"),
|
||||
Some(json!({ "reasoning": { "effort": "max" } }))
|
||||
);
|
||||
assert_eq!(
|
||||
default_reasoning_mapping("openai:responses:compact", "max"),
|
||||
Some(json!({ "reasoning": { "effort": "max" } }))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn combined_suffixes_are_order_insensitive() {
|
||||
let expected = Some(vec!["xhigh".to_string(), "fast".to_string()]);
|
||||
|
||||
Reference in New Issue
Block a user