style(gateway): format secret masking changes

This commit is contained in:
fawney19
2026-05-05 13:04:56 +08:00
parent f7071967c0
commit ccde3d4045
2 changed files with 4 additions and 7 deletions

View File

@@ -4,8 +4,7 @@ use crate::handlers::admin::provider::shared::support::{
}; };
use crate::handlers::admin::request::AdminAppState; use crate::handlers::admin::request::AdminAppState;
use crate::handlers::admin::shared::{ use crate::handlers::admin::shared::{
decrypt_catalog_secret_with_fallbacks, json_string_list, take_secret_prefix, decrypt_catalog_secret_with_fallbacks, json_string_list, take_secret_prefix, take_secret_suffix,
take_secret_suffix,
}; };
use crate::handlers::public::matches_model_mapping_for_models; use crate::handlers::public::matches_model_mapping_for_models;
use crate::{GatewayError, LocalProviderDeleteTaskState}; use crate::{GatewayError, LocalProviderDeleteTaskState};

View File

@@ -1647,10 +1647,8 @@ mod tests {
#[test] #[test]
fn masked_catalog_api_key_handles_unicode_plaintext_without_panicking() { fn masked_catalog_api_key_handles_unicode_plaintext_without_panicking() {
let state = AppState::new().expect("gateway should build"); let state = AppState::new().expect("gateway should build");
let encrypted_api_key = encrypt_python_fernet_plaintext( let encrypted_api_key =
DEVELOPMENT_ENCRYPTION_KEY, encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "测试-密钥-1234567890")
"测试-密钥-1234567890",
)
.expect("api key ciphertext should build"); .expect("api key ciphertext should build");
let key = StoredProviderCatalogKey::new( let key = StoredProviderCatalogKey::new(
"key-unicode".to_string(), "key-unicode".to_string(),