Support per-format provider key auth

This commit is contained in:
fawney19
2026-04-29 15:46:50 +08:00
parent 07a319259b
commit e751289dfb
67 changed files with 1244 additions and 420 deletions

View File

@@ -30,7 +30,10 @@ pub(super) fn admin_monitoring_masked_provider_key_prefix(
"service_account" | "vertex_ai" => Some("[Service Account]".to_string()),
"oauth" => Some("[OAuth Token]".to_string()),
_ => {
let full_key = admin_monitoring_try_decrypt_secret(state, &key.encrypted_api_key)?;
let full_key = key
.encrypted_api_key
.as_deref()
.and_then(|ciphertext| admin_monitoring_try_decrypt_secret(state, ciphertext))?;
if full_key.len() <= 12 {
Some(format!("{full_key}***"))
} else {