pub struct HarnessConfig {
pub harness_secret: String,
pub harness_secret_previous: Option<String>,
pub harness_secret_revoked: Vec<String>,
pub harness_venture: Option<String>,
pub admin_token: Option<String>,
pub env: VentureEnv,
}Expand description
The harness-level keys, parsed once from the environment Config
(issue #3): HARNESS_SECRET (required, ≥ 32 bytes),
HARNESS_SECRET_PREVIOUS (optional), ADMIN_TOKEN (optional),
ENV (development|staging|production, default development), and
the issue #137 key-ring keys: HARNESS_SECRET_REVOKED (optional,
comma-separated key ids whose tokens must be refused immediately) and
HARNESS_VENTURE (optional label binding tokens to this venture, so
one venture’s links cannot verify in another that shares its secret by
mistake).
Dummy secrets only, in tests:
HARNESS_SECRET = "test-secret-0123456789abcdef-0123".
Fields§
§harness_secret: String§harness_secret_previous: Option<String>§harness_secret_revoked: Vec<String>Key ids revoked at boot (issue #137). Ids and states, never key material — this list is safe to log.
harness_venture: Option<String>The venture binding label for issued tokens (issue #137).
admin_token: Option<String>§env: VentureEnvImplementations§
Source§impl HarnessConfig
impl HarnessConfig
Sourcepub fn from_config(config: &dyn Config) -> Result<Self, ConfigError>
pub fn from_config(config: &dyn Config) -> Result<Self, ConfigError>
§Errors
One problem per invalid key, reported together: missing or short
HARNESS_SECRET, unknown ENV value.
Sourcepub fn signer(&self) -> HmacSigner
pub fn signer(&self) -> HmacSigner
The HMAC signer for this configuration: a bounded key ring (ADR
0006 as amended by ADR 0014, issue #137). HARNESS_SECRET is the
signing key, HARNESS_SECRET_PREVIOUS a verification-only key, and
every id named in HARNESS_SECRET_REVOKED is burned before the
ring is frozen. Tokens are bound to HARNESS_VENTURE and ENV so
a link minted in one venture or environment never verifies in
another.
§Panics
Only when from_config was bypassed with an invalid secret.
Trait Implementations§
Source§impl Clone for HarnessConfig
impl Clone for HarnessConfig
Source§fn clone(&self) -> HarnessConfig
fn clone(&self) -> HarnessConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more