pub enum ValidationError {
FileNotFound(String),
FileNotReadable(String),
InvalidDomain(String),
InvalidCertFormat(String),
InvalidKeyFormat(String),
WeakKey(String),
SuspiciousPath(String),
DomainTooLong(String),
HomographAttack(String),
}Expand description
Validation errors that can occur during configuration validation.
§Security Context
These errors provide specific information about configuration failures to help administrators diagnose issues without exposing system internals.
Variants§
FileNotFound(String)
Certificate or key file not found at the specified path.
Check that the path is correct and the file exists.
FileNotReadable(String)
Certificate or key file exists but is not readable.
Check file permissions and ownership.
InvalidDomain(String)
Domain name does not comply with RFC 1035.
Domain must contain only alphanumerics, hyphens, and dots. Labels cannot start or end with hyphens.
InvalidCertFormat(String)
Certificate file does not contain PEM format markers.
Certificate must start with -----BEGIN CERTIFICATE-----
and end with -----END CERTIFICATE-----.
InvalidKeyFormat(String)
Private key file does not contain PEM format markers.
Private key must start with one of:
-----BEGIN PRIVATE KEY----------BEGIN RSA PRIVATE KEY----------BEGIN EC PRIVATE KEY----------BEGIN ENCRYPTED PRIVATE KEY-----
WeakKey(String)
Private key is too weak for secure cryptography.
SECURITY: Minimum requirements:
- RSA keys: 2048 bits minimum
- EC keys: 256 bits minimum (e.g., P-256, secp256r1)
Weak keys can be brute-forced or factored with modern hardware.
SuspiciousPath(String)
File path contains suspicious characters or traversal attempts.
Paths containing .. or ~ are rejected to prevent directory traversal.
DomainTooLong(String)
Domain name exceeds the maximum length of 253 characters.
HomographAttack(String)
Domain contains Unicode characters that could be homograph attacks.
SECURITY: Domains with Cyrillic, Greek, or other characters that visually resemble ASCII (e.g., Cyrillic ‘а’ vs ASCII ‘a’) are rejected to prevent phishing attacks like “аpple.com”.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ValidationError> for ConfigManagerError
impl From<ValidationError> for ConfigManagerError
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more