1pub type Result<T> = std::result::Result<T, Error>;
3
4#[derive(Debug, thiserror::Error)]
6pub enum Error {
7 #[error("x509 source has no current SVID")]
9 NoSvid,
10
11 #[error("x509 source has no bundle for trust domain {0}")]
13 NoBundle(String),
14
15 #[error("failed building rustls certified key: {0}")]
17 CertifiedKey(String),
18
19 #[error("failed parsing peer certificate: {0}")]
21 CertParse(String),
22
23 #[error("peer is missing SPIFFE ID URI SAN")]
25 MissingSpiffeId,
26
27 #[error("peer SPIFFE ID is not authorized: {0}")]
29 UnauthorizedSpiffeId(String),
30
31 #[error("rustls verifier builder error: {0}")]
33 VerifierBuilder(String),
34
35 #[error("rustls error: {0}")]
37 Rustls(#[from] rustls::Error),
38
39 #[error("internal: {0}")]
41 Internal(String),
42}