1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use async_trait::async_trait;
use serde::Serialize;
pub use shuttle_service::SecretStore;
use shuttle_service::{Error, Factory, ResourceBuilder, Type};
#[derive(Serialize)]
pub struct Secrets;
#[async_trait]
impl ResourceBuilder<SecretStore> for Secrets {
const TYPE: Type = Type::Secrets;
type Output = SecretStore;
fn new() -> Self {
Self {}
}
async fn build(build_data: &Self::Output) -> Result<SecretStore, crate::Error> {
Ok(build_data.clone())
}
async fn output(self, factory: &mut dyn Factory) -> Result<Self::Output, crate::Error> {
let secrets = factory.get_secrets().await?;
Ok(SecretStore::new(secrets))
}
}