pub struct Config {Show 14 fields
pub server: ServerConfig,
pub tls: TlsConfig,
pub database: DbConfig,
pub cas: Vec<CaConfig>,
pub est: EstConfig,
pub hsm: Option<HsmConfig>,
pub otp: OtpConfig,
pub admin: Option<AdminConfig>,
pub audit: AuditConfig,
pub coap: Option<CoapConfig>,
pub cms_est: Option<CmsEstConfig>,
pub cmp: Option<CmpConfig>,
pub star: Option<StarConfig>,
pub ocsp: OcspConfig,
}Expand description
Root configuration for the Kipuka EST server.
Loaded from a TOML file via Config::from_file.
Fields§
§server: ServerConfigServer listener configuration.
tls: TlsConfigTLS configuration for the EST listener.
database: DbConfigDatabase connection configuration.
cas: Vec<CaConfig>Certificate Authority configurations.
Supports [ca] (single-CA backward compat) or [[ca]] (multi-CA).
est: EstConfigEST protocol configuration.
hsm: Option<HsmConfig>HSM / PKCS#11 configuration. Absent → software-only key storage.
otp: OtpConfigOTP enrollment authentication.
admin: Option<AdminConfig>Admin API configuration. Absent → admin endpoints disabled.
audit: AuditConfigAudit trail configuration.
coap: Option<CoapConfig>CoAP transport configuration (RFC 9483). Absent → CoAP disabled.
cms_est: Option<CmsEstConfig>CMS-wrapped EST configuration (RFC 8295). Absent → CMS-EST disabled.
cmp: Option<CmpConfig>CMP v3 configuration (RFC 9810). Absent → CMP disabled.
star: Option<StarConfig>STAR certificate configuration (RFC 8739). Absent → STAR disabled.
ocsp: OcspConfigOCSP configuration for certificate revocation checking (RFC 6960). Absent → OCSP checking disabled (RHELBU-3536 R21).
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_file(path: &str) -> Result<Self, String>
pub fn from_file(path: &str) -> Result<Self, String>
Load and validate configuration from a TOML file.
Returns the parsed config or a human-readable error string suitable for startup diagnostics.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate semantic constraints that cannot be expressed in serde alone.
Called automatically by Self::from_file.
Sourcepub fn default_ca(&self) -> &CaConfig
pub fn default_ca(&self) -> &CaConfig
Returns the default CA config: the one with is_default = true, or the
only CA when there is exactly one [[ca]] entry.
§Panics
Panics if cas is empty or no CA is marked default in a multi-CA
config. Self::validate prevents both situations.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more