Skip to main content

authentik_client/models/
ldap_provider_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/// LdapProviderRequest : LDAPProvider Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LdapProviderRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
20    #[serde(
21        rename = "authentication_flow",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub authentication_flow: Option<Option<uuid::Uuid>>,
27    /// Flow used when authorizing this provider.
28    #[serde(rename = "authorization_flow")]
29    pub authorization_flow: uuid::Uuid,
30    /// Flow used ending the session from a provider.
31    #[serde(rename = "invalidation_flow")]
32    pub invalidation_flow: uuid::Uuid,
33    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
34    pub property_mappings: Option<Vec<uuid::Uuid>>,
35    /// DN under which objects are accessible.
36    #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")]
37    pub base_dn: Option<String>,
38    #[serde(
39        rename = "certificate",
40        default,
41        with = "::serde_with::rust::double_option",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub certificate: Option<Option<uuid::Uuid>>,
45    #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")]
46    pub tls_server_name: Option<String>,
47    /// 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
48    #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")]
49    pub uid_start_number: Option<i32>,
50    /// 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
51    #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")]
52    pub gid_start_number: Option<i32>,
53    #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")]
54    pub search_mode: Option<models::LdapapiAccessMode>,
55    #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")]
56    pub bind_mode: Option<models::LdapapiAccessMode>,
57    /// 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.
58    #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")]
59    pub mfa_support: Option<bool>,
60}
61
62impl LdapProviderRequest {
63    /// LDAPProvider Serializer
64    pub fn new(name: String, authorization_flow: uuid::Uuid, invalidation_flow: uuid::Uuid) -> LdapProviderRequest {
65        LdapProviderRequest {
66            name,
67            authentication_flow: None,
68            authorization_flow,
69            invalidation_flow,
70            property_mappings: None,
71            base_dn: None,
72            certificate: None,
73            tls_server_name: None,
74            uid_start_number: None,
75            gid_start_number: None,
76            search_mode: None,
77            bind_mode: None,
78            mfa_support: None,
79        }
80    }
81}