authentik_rust/models/
ldap_source_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// LdapSourceRequest : LDAP Source Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct LdapSourceRequest {
16    /// Source's display Name.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Internal source name, used in URLs.
20    #[serde(rename = "slug")]
21    pub slug: String,
22    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
23    pub enabled: Option<bool>,
24    /// Flow to use when authenticating existing users.
25    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub authentication_flow: Option<Option<uuid::Uuid>>,
27    /// Flow to use when enrolling new users.
28    #[serde(rename = "enrollment_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub enrollment_flow: Option<Option<uuid::Uuid>>,
30    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
31    pub policy_engine_mode: Option<models::PolicyEngineMode>,
32    /// How the source determines if an existing user should be authenticated or a new user enrolled.  * `identifier` - Use the source-specific identifier * `email_link` - Link to a user with identical email address. Can have security implications when a source doesn't validate email addresses. * `email_deny` - Use the user's email address, but deny enrollment when the email address already exists. * `username_link` - Link to a user with identical username. Can have security implications when a username is used with another source. * `username_deny` - Use the user's username, but deny enrollment when the username already exists.
33    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
34    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
35    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
36    pub user_path_template: Option<String>,
37    #[serde(rename = "server_uri")]
38    pub server_uri: String,
39    /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair.
40    #[serde(rename = "peer_certificate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub peer_certificate: Option<Option<uuid::Uuid>>,
42    /// Client certificate to authenticate against the LDAP Server's Certificate.
43    #[serde(rename = "client_certificate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub client_certificate: Option<Option<uuid::Uuid>>,
45    #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")]
46    pub bind_cn: Option<String>,
47    #[serde(rename = "bind_password", skip_serializing_if = "Option::is_none")]
48    pub bind_password: Option<String>,
49    #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")]
50    pub start_tls: Option<bool>,
51    #[serde(rename = "sni", skip_serializing_if = "Option::is_none")]
52    pub sni: Option<bool>,
53    #[serde(rename = "base_dn")]
54    pub base_dn: String,
55    /// Prepended to Base DN for User-queries.
56    #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")]
57    pub additional_user_dn: Option<String>,
58    /// Prepended to Base DN for Group-queries.
59    #[serde(rename = "additional_group_dn", skip_serializing_if = "Option::is_none")]
60    pub additional_group_dn: Option<String>,
61    /// Consider Objects matching this filter to be Users.
62    #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")]
63    pub user_object_filter: Option<String>,
64    /// Consider Objects matching this filter to be Groups.
65    #[serde(rename = "group_object_filter", skip_serializing_if = "Option::is_none")]
66    pub group_object_filter: Option<String>,
67    /// Field which contains members of a group.
68    #[serde(rename = "group_membership_field", skip_serializing_if = "Option::is_none")]
69    pub group_membership_field: Option<String>,
70    /// Field which contains a unique Identifier.
71    #[serde(rename = "object_uniqueness_field", skip_serializing_if = "Option::is_none")]
72    pub object_uniqueness_field: Option<String>,
73    #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")]
74    pub sync_users: Option<bool>,
75    /// When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source.
76    #[serde(rename = "sync_users_password", skip_serializing_if = "Option::is_none")]
77    pub sync_users_password: Option<bool>,
78    #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")]
79    pub sync_groups: Option<bool>,
80    #[serde(rename = "sync_parent_group", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
81    pub sync_parent_group: Option<Option<uuid::Uuid>>,
82    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
83    pub property_mappings: Option<Vec<uuid::Uuid>>,
84    /// Property mappings used for group creation/updating.
85    #[serde(rename = "property_mappings_group", skip_serializing_if = "Option::is_none")]
86    pub property_mappings_group: Option<Vec<uuid::Uuid>>,
87}
88
89impl LdapSourceRequest {
90    /// LDAP Source Serializer
91    pub fn new(name: String, slug: String, server_uri: String, base_dn: String) -> LdapSourceRequest {
92        LdapSourceRequest {
93            name,
94            slug,
95            enabled: None,
96            authentication_flow: None,
97            enrollment_flow: None,
98            policy_engine_mode: None,
99            user_matching_mode: None,
100            user_path_template: None,
101            server_uri,
102            peer_certificate: None,
103            client_certificate: None,
104            bind_cn: None,
105            bind_password: None,
106            start_tls: None,
107            sni: None,
108            base_dn,
109            additional_user_dn: None,
110            additional_group_dn: None,
111            user_object_filter: None,
112            group_object_filter: None,
113            group_membership_field: None,
114            object_uniqueness_field: None,
115            sync_users: None,
116            sync_users_password: None,
117            sync_groups: None,
118            sync_parent_group: None,
119            property_mappings: None,
120            property_mappings_group: None,
121        }
122    }
123}
124