fix(gateway): allow clearing API key IP whitelists

This commit is contained in:
RWDai
2026-05-20 13:41:14 +08:00
parent 149651f831
commit 1604a6d87d
4 changed files with 74 additions and 7 deletions
@@ -36,8 +36,8 @@ pub(crate) use self::email_templates::{
};
pub(crate) use self::external_models::OFFICIAL_EXTERNAL_MODEL_PROVIDERS;
pub(crate) use self::normalize::{
deserialize_optional_json_patch, normalize_feature_settings, normalize_json_array,
normalize_json_object, normalize_string_list,
deserialize_optional_json_patch, deserialize_optional_string_list_patch,
normalize_feature_settings, normalize_json_array, normalize_json_object, normalize_string_list,
};
pub(crate) use self::payloads::{
InternalGatewayAuthContextRequest, InternalGatewayExecuteRequest,
@@ -72,6 +72,15 @@ where
<Option<Value> as serde::Deserialize>::deserialize(deserializer).map(Some)
}
pub(crate) fn deserialize_optional_string_list_patch<'de, D>(
deserializer: D,
) -> Result<Option<Option<Vec<String>>>, D::Error>
where
D: serde::Deserializer<'de>,
{
<Option<Vec<String>> as serde::Deserialize>::deserialize(deserializer).map(Some)
}
fn normalize_chat_pii_redaction_feature_settings(
settings: &mut Map<String, Value>,
) -> Result<(), String> {