llm_edge_security/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum SecurityError {
5    #[error("Authentication failed: {0}")]
6    AuthenticationFailed(String),
7
8    #[error("Invalid API key")]
9    InvalidApiKey,
10
11    #[error("Invalid JWT token: {0}")]
12    InvalidJwt(String),
13
14    #[error("Validation error: {0}")]
15    Validation(String),
16
17    #[error("Rate limit exceeded")]
18    RateLimitExceeded,
19
20    #[error("Internal error: {0}")]
21    Internal(String),
22}
23
24pub type SecurityResult<T> = Result<T, SecurityError>;