litellm/litellm-rust/crates/secrets/src/error.rs
Yujong Lee b926cf998a chore: merge main into litellm_rust_secrets_azure_key_vault
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 21:47:21 +00:00

39 lines
1.4 KiB
Rust

#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("encrypted environment value is missing")]
MissingCiphertext,
#[error("ciphertext is not valid base64 for the configured manager")]
InvalidCiphertext,
#[error("decrypted value is not UTF-8")]
Utf8,
#[error("unsupported OIDC provider or missing build feature")]
UnsupportedOidc,
#[error("OIDC reference requires a provider and audience")]
InvalidOidc,
#[error("OIDC environment variable is missing")]
MissingEnvironment,
#[error("OIDC request failed")]
OidcHttp,
#[error("OIDC provider returned HTTP {0}")]
OidcStatus(u16),
#[error("OIDC response is invalid")]
OidcResponse,
#[error("OIDC file path must be absolute and within the credential allowlist")]
UnsafeOidcPath,
#[error("OIDC file could not be read")]
OidcFile,
#[error("secret cannot be converted to {expected}")]
TypeMismatch { expected: &'static str },
#[cfg(feature = "aws")]
#[error(transparent)]
Aws(#[from] litellm_secrets_aws::Error),
#[cfg(feature = "google")]
#[error(transparent)]
Google(#[from] litellm_secrets_google::Error),
#[cfg(feature = "azure")]
#[error(transparent)]
Azure(#[from] litellm_secrets_azure::Error),
#[cfg(feature = "cyberark")]
#[error(transparent)]
Cyberark(#[from] litellm_secrets_cyberark::Error),
}