use tonic::codegen::async_trait;
use crate::api::RuntimeMetadata;
use crate::error::Result;
#[async_trait]
pub trait SecretsProvider: Send + Sync + 'static {
async fn configure(
&self,
_name: &str,
_config: serde_json::Map<String, serde_json::Value>,
) -> Result<()> {
Ok(())
}
fn metadata(&self) -> Option<RuntimeMetadata> {
None
}
fn warnings(&self) -> Vec<String> {
Vec::new()
}
async fn health_check(&self) -> Result<()> {
Ok(())
}
async fn close(&self) -> Result<()> {
Ok(())
}
async fn get_secret(&self, name: &str) -> Result<String>;
}