mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
* refactor(rust): simplify Python secret callbacks * feat(rust): align secret manager operation contexts * test(rust): port secret name validation cases * fix(rust): restore secret manager CI checks * fix(rust): validate Vault contexts and preserve rotation timeouts --------- Co-authored-by: Yujong Lee <yujong@berri.ai>
28 lines
904 B
Rust
28 lines
904 B
Rust
use std::sync::Arc;
|
|
|
|
use litellm_core_utils::settings::ProcessEnvironment;
|
|
use litellm_secrets_azure::AzureKeyVault;
|
|
use litellm_secrets_types::Secret;
|
|
use rstest::rstest;
|
|
|
|
#[rstest]
|
|
#[tokio::test]
|
|
#[ignore]
|
|
async fn reads_a_real_secret() {
|
|
let environment = Arc::new(ProcessEnvironment);
|
|
let manager = AzureKeyVault::new(environment).unwrap();
|
|
let name = std::env::var("AZURE_KEY_VAULT_LIVE_SECRET_NAME").unwrap();
|
|
let secret = manager.get_secret(&name).await.unwrap().unwrap();
|
|
assert!(matches!(&secret, Secret::String(_)));
|
|
let host = std::env::var("AZURE_KEY_VAULT_URI")
|
|
.unwrap()
|
|
.parse::<reqwest::Url>()
|
|
.unwrap()
|
|
.host_str()
|
|
.unwrap()
|
|
.to_owned();
|
|
let value_len = secret.as_str().unwrap().len();
|
|
println!(
|
|
"native provider=litellm-secrets-azure vault_host={host} secret={name} value_len={value_len}"
|
|
);
|
|
}
|