Skip to main content

secrets_provider_tests/
contract.rs

1use anyhow::Result;
2use async_trait::async_trait;
3
4/// Minimal contract each provider must satisfy for conformance.
5#[async_trait]
6pub trait ProviderUnderTest: Send + Sync {
7    async fn put(&self, key: &str, value: &[u8]) -> Result<()>;
8    async fn get(&self, key: &str) -> Result<Option<Vec<u8>>>;
9    async fn delete(&self, key: &str) -> Result<()>;
10
11    /// Optional listing support.
12    async fn list(&self, _prefix: &str) -> Result<Vec<String>> {
13        Ok(Vec::new())
14    }
15}