1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use derive_more::{Display, Error};
#[derive(Debug, Display, Error, PartialEq, Eq, Hash, Clone)]
pub enum AuthenticationError {
#[display(fmt = "Authorization header not set")]
AuthorizationHeaderNotSet,
#[display(fmt = "Invalid Authorization header")]
InvalidAuthorizationHeader,
#[display(fmt = "Access denied")]
InvalidAuthentication,
#[display(fmt = "Invalid authentication type")]
InvalidToken,
#[display(fmt = "Access denied")]
UsernameNotFound,
}
#[derive(Debug, Display, Error, PartialEq, Eq, Hash, Clone)]
pub enum JwkLoaderError {
#[display(fmt = "The key file could not be read")]
KeyFileCouldNotBeRead,
#[display(fmt = "Invalid key file")]
InvalidKeyFile,
#[display(fmt = "Invalid JSON response")]
InvalidJsonResponse,
#[display(fmt = "JWKs could not be downloaded")]
JwksCouldNotBeDownloaded,
}