use crate::error::VaultError;
use crate::types::{AuditEvent, Credential, RuntimeSecretHandle, WorkloadToken};
#[async_trait::async_trait]
pub trait VaultBackend: Send + Sync {
fn backend_type(&self) -> crate::types::BackendType;
async fn health_check(&self) -> Result<(), VaultError>;
async fn list_credentials(&self) -> Result<Vec<Credential>, VaultError>;
async fn get_credential(&self, id: &str) -> Result<Credential, VaultError>;
async fn issue_runtime_handle(
&self,
credential_id: &str,
scope: &[String],
ttl_seconds: u64,
) -> Result<RuntimeSecretHandle, VaultError>;
async fn mint_workload_token(
&self,
credential_id: &str,
audience: &str,
ttl_seconds: u64,
) -> Result<WorkloadToken, VaultError>;
async fn rotate(&self, credential_id: &str) -> Result<(), VaultError>;
async fn revoke(&self, credential_id: &str) -> Result<(), VaultError>;
async fn audit_log(
&self,
credential_id: Option<&str>,
limit: usize,
) -> Result<Vec<AuditEvent>, VaultError>;
}