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