proxmox_api/generated/access/domains/
realm.rs1pub mod sync;
2pub struct RealmClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> RealmClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str, realm: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}/{}", parent_path, realm),
14 }
15 }
16}
17impl<T> RealmClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Delete an authentication server."]
22 pub fn delete(&self) -> Result<(), T::Error> {
23 let path = self.path.to_string();
24 self.client.delete(&path, &())
25 }
26}
27impl<T> RealmClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Get auth server configuration."]
32 pub fn get(&self) -> Result<(), T::Error> {
33 let path = self.path.to_string();
34 self.client.get(&path, &())
35 }
36}
37impl<T> RealmClient<T>
38where
39 T: crate::client::Client,
40{
41 #[doc = "Update authentication server settings."]
42 pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
43 let path = self.path.to_string();
44 self.client.put(&path, ¶ms)
45 }
46}
47#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
48pub struct PutParams {
49 #[serde(rename = "acr-values")]
50 #[serde(skip_serializing_if = "Option::is_none", default)]
51 #[doc = "Specifies the Authentication Context Class Reference values that theAuthorization Server is being requested to use for the Auth Request."]
52 pub acr_values: Option<String>,
53 #[serde(
54 serialize_with = "crate::types::serialize_bool_optional",
55 deserialize_with = "crate::types::deserialize_bool_optional"
56 )]
57 #[serde(skip_serializing_if = "Option::is_none", default)]
58 #[doc = "Automatically create users if they do not exist."]
59 pub autocreate: Option<bool>,
60 #[serde(skip_serializing_if = "Option::is_none", default)]
61 #[doc = "LDAP base domain name"]
62 pub base_dn: Option<String>,
63 #[serde(skip_serializing_if = "Option::is_none", default)]
64 #[doc = "LDAP bind domain name"]
65 pub bind_dn: Option<String>,
66 #[serde(skip_serializing_if = "Option::is_none", default)]
67 #[doc = "Path to the CA certificate store"]
68 pub capath: Option<String>,
69 #[serde(rename = "case-sensitive")]
70 #[serde(
71 serialize_with = "crate::types::serialize_bool_optional",
72 deserialize_with = "crate::types::deserialize_bool_optional"
73 )]
74 #[serde(skip_serializing_if = "Option::is_none", default)]
75 #[doc = "username is case-sensitive"]
76 pub case_sensitive: Option<bool>,
77 #[serde(skip_serializing_if = "Option::is_none", default)]
78 #[doc = "Path to the client certificate"]
79 pub cert: Option<String>,
80 #[serde(skip_serializing_if = "Option::is_none", default)]
81 #[doc = "Path to the client certificate key"]
82 pub certkey: Option<String>,
83 #[serde(rename = "check-connection")]
84 #[serde(
85 serialize_with = "crate::types::serialize_bool_optional",
86 deserialize_with = "crate::types::deserialize_bool_optional"
87 )]
88 #[serde(skip_serializing_if = "Option::is_none", default)]
89 #[doc = "Check bind connection to the server."]
90 pub check_connection: Option<bool>,
91 #[serde(rename = "client-id")]
92 #[serde(skip_serializing_if = "Option::is_none", default)]
93 #[doc = "OpenID Client ID"]
94 pub client_id: Option<String>,
95 #[serde(rename = "client-key")]
96 #[serde(skip_serializing_if = "Option::is_none", default)]
97 #[doc = "OpenID Client Key"]
98 pub client_key: Option<String>,
99 #[serde(skip_serializing_if = "Option::is_none", default)]
100 #[doc = "Description."]
101 pub comment: Option<String>,
102 #[serde(
103 serialize_with = "crate::types::serialize_bool_optional",
104 deserialize_with = "crate::types::deserialize_bool_optional"
105 )]
106 #[serde(skip_serializing_if = "Option::is_none", default)]
107 #[doc = "Use this as default realm"]
108 pub default: Option<bool>,
109 #[serde(skip_serializing_if = "Option::is_none", default)]
110 #[doc = "A list of settings you want to delete."]
111 pub delete: Option<String>,
112 #[serde(skip_serializing_if = "Option::is_none", default)]
113 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
114 pub digest: Option<String>,
115 #[serde(skip_serializing_if = "Option::is_none", default)]
116 #[doc = "AD domain name"]
117 pub domain: Option<String>,
118 #[serde(skip_serializing_if = "Option::is_none", default)]
119 #[doc = "LDAP filter for user sync."]
120 pub filter: Option<String>,
121 #[serde(skip_serializing_if = "Option::is_none", default)]
122 #[doc = "The objectclasses for groups."]
123 pub group_classes: Option<String>,
124 #[serde(skip_serializing_if = "Option::is_none", default)]
125 #[doc = "LDAP base domain name for group sync. If not set, the base_dn will be used."]
126 pub group_dn: Option<String>,
127 #[serde(skip_serializing_if = "Option::is_none", default)]
128 #[doc = "LDAP filter for group sync."]
129 pub group_filter: Option<String>,
130 #[serde(skip_serializing_if = "Option::is_none", default)]
131 #[doc = "LDAP attribute representing a groups name. If not set or found, the first value of the DN will be used as name."]
132 pub group_name_attr: Option<String>,
133 #[serde(rename = "issuer-url")]
134 #[serde(skip_serializing_if = "Option::is_none", default)]
135 #[doc = "OpenID Issuer Url"]
136 pub issuer_url: Option<String>,
137 #[serde(skip_serializing_if = "Option::is_none", default)]
138 #[doc = "LDAP protocol mode."]
139 pub mode: Option<Mode>,
140 #[serde(skip_serializing_if = "Option::is_none", default)]
141 #[doc = "LDAP bind password. Will be stored in '/etc/pve/priv/realm/\\<REALM\\>.pw'."]
142 pub password: Option<String>,
143 #[serde(
144 serialize_with = "crate::types::serialize_int_optional",
145 deserialize_with = "crate::types::deserialize_int_optional"
146 )]
147 #[serde(skip_serializing_if = "Option::is_none", default)]
148 #[doc = "Server port."]
149 pub port: Option<u64>,
150 #[serde(skip_serializing_if = "Option::is_none", default)]
151 #[doc = "Specifies whether the Authorization Server prompts the End-User for reauthentication and consent."]
152 pub prompt: Option<String>,
153 #[serde(skip_serializing_if = "Option::is_none", default)]
154 #[doc = "Specifies the scopes (user details) that should be authorized and returned, for example 'email' or 'profile'."]
155 pub scopes: Option<String>,
156 #[serde(
157 serialize_with = "crate::types::serialize_bool_optional",
158 deserialize_with = "crate::types::deserialize_bool_optional"
159 )]
160 #[serde(skip_serializing_if = "Option::is_none", default)]
161 #[doc = "Use secure LDAPS protocol. DEPRECATED: use 'mode' instead."]
162 pub secure: Option<bool>,
163 #[serde(skip_serializing_if = "Option::is_none", default)]
164 #[doc = "Server IP address (or DNS name)"]
165 pub server1: Option<String>,
166 #[serde(skip_serializing_if = "Option::is_none", default)]
167 #[doc = "Fallback Server IP address (or DNS name)"]
168 pub server2: Option<String>,
169 #[serde(skip_serializing_if = "Option::is_none", default)]
170 #[doc = "LDAPS TLS/SSL version. It's not recommended to use version older than 1.2!"]
171 pub sslversion: Option<Sslversion>,
172 #[serde(rename = "sync-defaults-options")]
173 #[serde(skip_serializing_if = "Option::is_none", default)]
174 #[doc = "The default options for behavior of synchronizations."]
175 pub sync_defaults_options: Option<String>,
176 #[serde(skip_serializing_if = "Option::is_none", default)]
177 #[doc = "Comma separated list of key=value pairs for specifying which LDAP attributes map to which PVE user field. For example, to map the LDAP attribute 'mail' to PVEs 'email', write 'email=mail'. By default, each PVE user field is represented by an LDAP attribute of the same name."]
178 pub sync_attributes: Option<String>,
179 #[serde(skip_serializing_if = "Option::is_none", default)]
180 #[doc = "Use Two-factor authentication."]
181 pub tfa: Option<String>,
182 #[serde(skip_serializing_if = "Option::is_none", default)]
183 #[doc = "LDAP user attribute name"]
184 pub user_attr: Option<String>,
185 #[serde(skip_serializing_if = "Option::is_none", default)]
186 #[doc = "The objectclasses for users."]
187 pub user_classes: Option<String>,
188 #[serde(
189 serialize_with = "crate::types::serialize_bool_optional",
190 deserialize_with = "crate::types::deserialize_bool_optional"
191 )]
192 #[serde(skip_serializing_if = "Option::is_none", default)]
193 #[doc = "Verify the server's SSL certificate"]
194 pub verify: Option<bool>,
195 #[serde(
196 flatten,
197 default,
198 skip_serializing_if = "::std::collections::HashMap::is_empty"
199 )]
200 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
201}
202#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
203pub enum Mode {
204 #[serde(rename = "ldap")]
205 Ldap,
206 #[serde(rename = "ldap+starttls")]
207 LdapStarttls,
208 #[serde(rename = "ldaps")]
209 Ldaps,
210}
211impl Default for Mode {
212 fn default() -> Self {
213 Self::Ldap
214 }
215}
216#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
217pub enum Sslversion {
218 #[serde(rename = "tlsv1")]
219 Tlsv1,
220 #[serde(rename = "tlsv1_1")]
221 Tlsv11,
222 #[serde(rename = "tlsv1_2")]
223 Tlsv12,
224 #[serde(rename = "tlsv1_3")]
225 Tlsv13,
226}
227impl<T> RealmClient<T>
228where
229 T: crate::client::Client,
230{
231 pub fn sync(&self) -> sync::SyncClient<T> {
232 sync::SyncClient::<T>::new(self.client.clone(), &self.path)
233 }
234}