Skip to main content

authentik_client/models/
ldap_source_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LdapSourceRequest : LDAP Source Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LdapSourceRequest {
17    /// Source's display Name.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Internal source name, used in URLs.
21    #[serde(rename = "slug")]
22    pub slug: String,
23    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
24    pub enabled: Option<bool>,
25    /// When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon.
26    #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")]
27    pub promoted: Option<bool>,
28    /// Flow to use when authenticating existing users.
29    #[serde(
30        rename = "authentication_flow",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub authentication_flow: Option<Option<uuid::Uuid>>,
36    /// Flow to use when enrolling new users.
37    #[serde(
38        rename = "enrollment_flow",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub enrollment_flow: Option<Option<uuid::Uuid>>,
44    #[serde(rename = "user_property_mappings", skip_serializing_if = "Option::is_none")]
45    pub user_property_mappings: Option<Vec<uuid::Uuid>>,
46    #[serde(rename = "group_property_mappings", skip_serializing_if = "Option::is_none")]
47    pub group_property_mappings: Option<Vec<uuid::Uuid>>,
48    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
49    pub policy_engine_mode: Option<models::PolicyEngineMode>,
50    /// How the source determines if an existing user should be authenticated or a new user enrolled.
51    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
52    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
53    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
54    pub user_path_template: Option<String>,
55    #[serde(rename = "icon", skip_serializing_if = "Option::is_none")]
56    pub icon: Option<String>,
57    #[serde(rename = "server_uri")]
58    pub server_uri: String,
59    /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair.
60    #[serde(
61        rename = "peer_certificate",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub peer_certificate: Option<Option<uuid::Uuid>>,
67    /// Client certificate to authenticate against the LDAP Server's Certificate.
68    #[serde(
69        rename = "client_certificate",
70        default,
71        with = "::serde_with::rust::double_option",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub client_certificate: Option<Option<uuid::Uuid>>,
75    #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")]
76    pub bind_cn: Option<String>,
77    #[serde(rename = "bind_password", skip_serializing_if = "Option::is_none")]
78    pub bind_password: Option<String>,
79    #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")]
80    pub start_tls: Option<bool>,
81    #[serde(rename = "sni", skip_serializing_if = "Option::is_none")]
82    pub sni: Option<bool>,
83    #[serde(rename = "base_dn")]
84    pub base_dn: String,
85    /// Prepended to Base DN for User-queries.
86    #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")]
87    pub additional_user_dn: Option<String>,
88    /// Prepended to Base DN for Group-queries.
89    #[serde(rename = "additional_group_dn", skip_serializing_if = "Option::is_none")]
90    pub additional_group_dn: Option<String>,
91    /// Consider Objects matching this filter to be Users.
92    #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")]
93    pub user_object_filter: Option<String>,
94    /// Consider Objects matching this filter to be Groups.
95    #[serde(rename = "group_object_filter", skip_serializing_if = "Option::is_none")]
96    pub group_object_filter: Option<String>,
97    /// Field which contains members of a group.
98    #[serde(rename = "group_membership_field", skip_serializing_if = "Option::is_none")]
99    pub group_membership_field: Option<String>,
100    /// Attribute which matches the value of `group_membership_field`.
101    #[serde(rename = "user_membership_attribute", skip_serializing_if = "Option::is_none")]
102    pub user_membership_attribute: Option<String>,
103    /// Field which contains a unique Identifier.
104    #[serde(rename = "object_uniqueness_field", skip_serializing_if = "Option::is_none")]
105    pub object_uniqueness_field: Option<String>,
106    /// Update internal authentik password when login succeeds with LDAP
107    #[serde(
108        rename = "password_login_update_internal_password",
109        skip_serializing_if = "Option::is_none"
110    )]
111    pub password_login_update_internal_password: Option<bool>,
112    #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")]
113    pub sync_users: Option<bool>,
114    /// When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source.
115    #[serde(rename = "sync_users_password", skip_serializing_if = "Option::is_none")]
116    pub sync_users_password: Option<bool>,
117    #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")]
118    pub sync_groups: Option<bool>,
119    #[serde(
120        rename = "sync_parent_group",
121        default,
122        with = "::serde_with::rust::double_option",
123        skip_serializing_if = "Option::is_none"
124    )]
125    pub sync_parent_group: Option<Option<uuid::Uuid>>,
126    /// Lookup group membership based on a user attribute instead of a group attribute. This allows nested group resolution on systems like FreeIPA and Active Directory
127    #[serde(rename = "lookup_groups_from_user", skip_serializing_if = "Option::is_none")]
128    pub lookup_groups_from_user: Option<bool>,
129    /// Delete authentik users and groups which were previously supplied by this source, but are now missing from it.
130    #[serde(rename = "delete_not_found_objects", skip_serializing_if = "Option::is_none")]
131    pub delete_not_found_objects: Option<bool>,
132    /// When to trigger sync for outgoing providers
133    #[serde(rename = "sync_outgoing_trigger_mode", skip_serializing_if = "Option::is_none")]
134    pub sync_outgoing_trigger_mode: Option<models::SyncOutgoingTriggerModeEnum>,
135}
136
137impl LdapSourceRequest {
138    /// LDAP Source Serializer
139    pub fn new(name: String, slug: String, server_uri: String, base_dn: String) -> LdapSourceRequest {
140        LdapSourceRequest {
141            name,
142            slug,
143            enabled: None,
144            promoted: None,
145            authentication_flow: None,
146            enrollment_flow: None,
147            user_property_mappings: None,
148            group_property_mappings: None,
149            policy_engine_mode: None,
150            user_matching_mode: None,
151            user_path_template: None,
152            icon: None,
153            server_uri,
154            peer_certificate: None,
155            client_certificate: None,
156            bind_cn: None,
157            bind_password: None,
158            start_tls: None,
159            sni: None,
160            base_dn,
161            additional_user_dn: None,
162            additional_group_dn: None,
163            user_object_filter: None,
164            group_object_filter: None,
165            group_membership_field: None,
166            user_membership_attribute: None,
167            object_uniqueness_field: None,
168            password_login_update_internal_password: None,
169            sync_users: None,
170            sync_users_password: None,
171            sync_groups: None,
172            sync_parent_group: None,
173            lookup_groups_from_user: None,
174            delete_not_found_objects: None,
175            sync_outgoing_trigger_mode: None,
176        }
177    }
178}