pub struct SecurityBootstrapConfig { /* private fields */ }Expand description
Security material required before a service is allowed to bind listeners.
Implementations§
Source§impl SecurityBootstrapConfig
impl SecurityBootstrapConfig
Sourcepub const fn new(profile: SecurityBootstrapProfile) -> Self
pub const fn new(profile: SecurityBootstrapProfile) -> Self
Creates a new SecurityBootstrapConfig.
Sourcepub fn from_env() -> Result<SecurityBootstrap, SecurityContractViolation>
pub fn from_env() -> Result<SecurityBootstrap, SecurityContractViolation>
Loads the canonical bootstrap environment without exposing configured values in errors.
Security bootstrap is disabled only when neither the profile nor any bootstrap field is configured.
§Errors
Returns a typed error when fields are configured without a profile, the profile is unknown, or any configured environment field is non-UTF-8.
Sourcepub fn with_trust_anchor(self, path: impl Into<PathBuf>) -> Self
pub fn with_trust_anchor(self, path: impl Into<PathBuf>) -> Self
Sets trust anchor and returns the updated value.
Sourcepub fn with_tls_identity(
self,
certificate: impl Into<PathBuf>,
private_key: impl Into<PathBuf>,
) -> Self
pub fn with_tls_identity( self, certificate: impl Into<PathBuf>, private_key: impl Into<PathBuf>, ) -> Self
Sets tls identity and returns the updated value.
Sourcepub fn with_secret_provider(self, provider: impl Into<String>) -> Self
pub fn with_secret_provider(self, provider: impl Into<String>) -> Self
Sets secret provider and returns the updated value.
Sourcepub fn with_admin_identity(self, path: impl Into<PathBuf>) -> Self
pub fn with_admin_identity(self, path: impl Into<PathBuf>) -> Self
Sets admin identity and returns the updated value.
Sourcepub fn with_request_policy(self, path: impl Into<PathBuf>) -> Self
pub fn with_request_policy(self, path: impl Into<PathBuf>) -> Self
Sets request policy and returns the updated value.
Sourcepub fn validate(
&self,
listener_addresses: &[SocketAddr],
) -> Result<ValidatedSecurityBootstrap, SecurityProviderError>
pub fn validate( &self, listener_addresses: &[SocketAddr], ) -> Result<ValidatedSecurityBootstrap, SecurityProviderError>
Validates all security prerequisites before the caller binds any listener.
§Errors
Secure mode fails closed for missing or unreadable material and unsupported providers. Development mode fails closed when any supplied listener is not loopback.