Skip to main content

authentik_client/models/
ldap_provider.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LdapProvider : LDAPProvider Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LdapProvider {
17    #[serde(rename = "pk")]
18    pub pk: i32,
19    #[serde(rename = "name")]
20    pub name: String,
21    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
22    #[serde(
23        rename = "authentication_flow",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub authentication_flow: Option<Option<uuid::Uuid>>,
29    /// Flow used when authorizing this provider.
30    #[serde(rename = "authorization_flow")]
31    pub authorization_flow: uuid::Uuid,
32    /// Flow used ending the session from a provider.
33    #[serde(rename = "invalidation_flow")]
34    pub invalidation_flow: uuid::Uuid,
35    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
36    pub property_mappings: Option<Vec<uuid::Uuid>>,
37    /// Get object component so that we know how to edit the object
38    #[serde(rename = "component")]
39    pub component: String,
40    /// Internal application name, used in URLs.
41    #[serde(rename = "assigned_application_slug", deserialize_with = "Option::deserialize")]
42    pub assigned_application_slug: Option<String>,
43    /// Application's display Name.
44    #[serde(rename = "assigned_application_name", deserialize_with = "Option::deserialize")]
45    pub assigned_application_name: Option<String>,
46    /// Internal application name, used in URLs.
47    #[serde(
48        rename = "assigned_backchannel_application_slug",
49        deserialize_with = "Option::deserialize"
50    )]
51    pub assigned_backchannel_application_slug: Option<String>,
52    /// Application's display Name.
53    #[serde(
54        rename = "assigned_backchannel_application_name",
55        deserialize_with = "Option::deserialize"
56    )]
57    pub assigned_backchannel_application_name: Option<String>,
58    /// Return object's verbose_name
59    #[serde(rename = "verbose_name")]
60    pub verbose_name: String,
61    /// Return object's plural verbose_name
62    #[serde(rename = "verbose_name_plural")]
63    pub verbose_name_plural: String,
64    /// Return internal model name
65    #[serde(rename = "meta_model_name")]
66    pub meta_model_name: String,
67    /// DN under which objects are accessible.
68    #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")]
69    pub base_dn: Option<String>,
70    #[serde(
71        rename = "certificate",
72        default,
73        with = "::serde_with::rust::double_option",
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub certificate: Option<Option<uuid::Uuid>>,
77    #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")]
78    pub tls_server_name: Option<String>,
79    /// The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local users uidNumber
80    #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")]
81    pub uid_start_number: Option<i32>,
82    /// The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that we don't collide with local groups or users primary groups gidNumber
83    #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")]
84    pub gid_start_number: Option<i32>,
85    #[serde(rename = "outpost_set")]
86    pub outpost_set: Vec<String>,
87    #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")]
88    pub search_mode: Option<models::LdapapiAccessMode>,
89    #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")]
90    pub bind_mode: Option<models::LdapapiAccessMode>,
91    /// When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon.
92    #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")]
93    pub mfa_support: Option<bool>,
94}
95
96impl LdapProvider {
97    /// LDAPProvider Serializer
98    pub fn new(
99        pk: i32,
100        name: String,
101        authorization_flow: uuid::Uuid,
102        invalidation_flow: uuid::Uuid,
103        component: String,
104        assigned_application_slug: Option<String>,
105        assigned_application_name: Option<String>,
106        assigned_backchannel_application_slug: Option<String>,
107        assigned_backchannel_application_name: Option<String>,
108        verbose_name: String,
109        verbose_name_plural: String,
110        meta_model_name: String,
111        outpost_set: Vec<String>,
112    ) -> LdapProvider {
113        LdapProvider {
114            pk,
115            name,
116            authentication_flow: None,
117            authorization_flow,
118            invalidation_flow,
119            property_mappings: None,
120            component,
121            assigned_application_slug,
122            assigned_application_name,
123            assigned_backchannel_application_slug,
124            assigned_backchannel_application_name,
125            verbose_name,
126            verbose_name_plural,
127            meta_model_name,
128            base_dn: None,
129            certificate: None,
130            tls_server_name: None,
131            uid_start_number: None,
132            gid_start_number: None,
133            outpost_set,
134            search_mode: None,
135            bind_mode: None,
136            mfa_support: None,
137        }
138    }
139}