1use tonic::codegen::async_trait;
2
3use crate::api::RuntimeMetadata;
4use crate::error::Result;
5
6#[async_trait]
7pub trait SecretsProvider: Send + Sync + 'static {
8 async fn configure(
9 &self,
10 _name: &str,
11 _config: serde_json::Map<String, serde_json::Value>,
12 ) -> Result<()> {
13 Ok(())
14 }
15
16 fn metadata(&self) -> Option<RuntimeMetadata> {
17 None
18 }
19
20 fn warnings(&self) -> Vec<String> {
21 Vec::new()
22 }
23
24 async fn health_check(&self) -> Result<()> {
25 Ok(())
26 }
27
28 async fn close(&self) -> Result<()> {
29 Ok(())
30 }
31
32 async fn get_secret(&self, name: &str) -> Result<String>;
33}