greentic-secrets-runner 0.4.14

Host bridge for environment-backed secrets with tenant policy enforcement.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Debug, Error, Clone, PartialEq, Eq)]
pub enum SecretError {
    #[error("secret `{key}` is not allowed by policy")]
    Denied { key: String },
    #[error("secret `{key}` not found in environment")]
    NotFound { key: String },
}

impl SecretError {
    pub fn code(&self) -> &'static str {
        match self {
            SecretError::Denied { .. } => "denied",
            SecretError::NotFound { .. } => "not_found",
        }
    }
}