openstack_keystone_core/identity/
error.rs1use thiserror::Error;
16
17use crate::common::password_hashing::PasswordHashError;
18use crate::error::BuilderError;
19use crate::resource::error::ResourceProviderError;
20
21#[derive(Error, Debug)]
23pub enum IdentityProviderError {
24 #[error(transparent)]
26 Authentication {
27 #[from]
28 source: crate::auth::AuthenticationError,
29 },
30
31 #[error("conflict: {0}")]
33 Conflict(String),
34
35 #[error("Date calculation error")]
36 DateError,
37
38 #[error("backend driver error: {0}")]
40 Driver(String),
41
42 #[error("group {0} not found")]
44 GroupNotFound(String),
45
46 #[error(transparent)]
47 Join {
48 #[from]
49 source: tokio::task::JoinError,
50 },
51
52 #[error("corrupted database entries for user {0}")]
53 MalformedUser(String),
54
55 #[error("no passwords for the user {0}")]
57 NoPasswordsForUser(String),
58
59 #[error("no passwords hash on the row id: {0}")]
61 NoPasswordHash(String),
62
63 #[error("no entry in the `user` table found for user_id: {0}")]
65 NoMainUserEntry(String),
66
67 #[error("password hashing error")]
69 PasswordHash {
70 #[from]
71 source: PasswordHashError,
72 },
73
74 #[error(transparent)]
76 ResourceProvider {
77 #[from]
78 source: ResourceProviderError,
79 },
80
81 #[error("data serialization error")]
83 Serde {
84 #[from]
85 source: serde_json::Error,
86 },
87
88 #[error(transparent)]
90 StructBuilder {
91 #[from]
93 source: BuilderError,
94 },
95
96 #[error("unsupported driver `{0}` for the identity provider")]
98 UnsupportedDriver(String),
99
100 #[error("user id must be given")]
101 UserIdMissing,
102
103 #[error("either user id or user name with user domain id or name must be given")]
105 UserIdOrNameWithDomain,
106
107 #[error("user {0} not found")]
109 UserNotFound(String),
110
111 #[error("request validation error: {}", source)]
113 Validation {
114 #[from]
116 source: validator::ValidationErrors,
117 },
118}