use crate::vault::common::VaultStatus;
use crate::vault::{UnsealResult, VaultError};
use async_trait::async_trait;
#[async_trait]
pub trait VaultInterface {
async fn check_status(&self, addr: &str) -> Result<VaultStatus, VaultError>;
async fn unseal(&self, addr: &str, keys: Vec<String>) -> Result<UnsealResult, VaultError>;
async fn setup_root(
&self,
addr: &str,
secret_shares: u8,
secret_threshold: u8,
key_name: &str,
) -> Result<String, VaultError>;
async fn setup_sub(
&self,
root_addr: &str,
root_token: &str,
sub_addr: &str,
domain: &str,
ttl: &str,
) -> Result<String, VaultError>;
async fn get_unwrapped_transit_token(
&self,
root_addr: &str,
root_token: &str,
key_name: &str,
) -> Result<String, VaultError>;
}