pub struct HarnessConfig {
pub harness_secret: String,
pub harness_secret_previous: 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).
Dummy secrets only, in tests:
HARNESS_SECRET = "test-secret-0123456789abcdef-0123".
Fields§
§harness_secret: String§harness_secret_previous: Option<String>§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 (ADR 0006).
§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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HarnessConfig
impl RefUnwindSafe for HarnessConfig
impl Send for HarnessConfig
impl Sync for HarnessConfig
impl Unpin for HarnessConfig
impl UnsafeUnpin for HarnessConfig
impl UnwindSafe for HarnessConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more