mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 18:07:47 +08:00
fix: restore security hardening compatibility and validation
Restore authorized rule reveal, explicit full HTTP capture and retention, video task business fields, and valid payment URLs. Add opt-in credential preservation for trusted recovery, fix frontend type contracts and async races, and eliminate PostgreSQL test fixture resource leaks. Document audit coverage and successful fmt and CI-scoped Clippy checks.
This commit is contained in:
@@ -41,16 +41,9 @@ fn usage_request_record_level_from_value(value: Option<&Value>) -> UsageRequestR
|
||||
return UsageRequestRecordLevel::Basic;
|
||||
};
|
||||
|
||||
if value.eq_ignore_ascii_case("basic")
|
||||
|| value.eq_ignore_ascii_case("base")
|
||||
|| value.eq_ignore_ascii_case("headers")
|
||||
|| value.eq_ignore_ascii_case("minimal")
|
||||
|| value.eq_ignore_ascii_case("none")
|
||||
{
|
||||
UsageRequestRecordLevel::Basic
|
||||
if value.eq_ignore_ascii_case("full") {
|
||||
UsageRequestRecordLevel::Full
|
||||
} else {
|
||||
// Raw HTTP payload capture is disabled at the runtime boundary. The setting remains
|
||||
// accepted for compatibility, but no longer authorizes collecting request/response data.
|
||||
UsageRequestRecordLevel::Basic
|
||||
}
|
||||
}
|
||||
@@ -501,7 +494,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn usage_runtime_access_disables_full_http_capture() {
|
||||
async fn usage_runtime_access_honors_explicit_full_http_capture() {
|
||||
let state = GatewayDataState::disabled().with_system_config_values_for_tests([(
|
||||
"request_record_level".to_string(),
|
||||
json!("full"),
|
||||
@@ -511,7 +504,32 @@ mod tests {
|
||||
.await
|
||||
.expect("request record level should read");
|
||||
|
||||
assert_eq!(level, UsageRequestRecordLevel::Basic);
|
||||
assert_eq!(level, UsageRequestRecordLevel::Full);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn usage_runtime_access_honors_legacy_full_without_overriding_current_config() {
|
||||
let state = GatewayDataState::disabled().with_system_config_values_for_tests([(
|
||||
"request_log_level".to_string(),
|
||||
json!(" FULL "),
|
||||
)]);
|
||||
assert_eq!(
|
||||
UsageRuntimeAccess::request_record_level(&state)
|
||||
.await
|
||||
.unwrap(),
|
||||
UsageRequestRecordLevel::Full
|
||||
);
|
||||
|
||||
let state = state.with_system_config_values_for_tests([
|
||||
("request_log_level".to_string(), json!("full")),
|
||||
("request_record_level".to_string(), json!("basic")),
|
||||
]);
|
||||
assert_eq!(
|
||||
UsageRuntimeAccess::request_record_level(&state)
|
||||
.await
|
||||
.unwrap(),
|
||||
UsageRequestRecordLevel::Basic
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user