authentik_client/models/
saml_source.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.12.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// SamlSource : SAMLSource Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SamlSource {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    /// Source's display Name.
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Internal source name, used in URLs.
23    #[serde(rename = "slug")]
24    pub slug: String,
25    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
26    pub enabled: Option<bool>,
27    /// When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon.
28    #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")]
29    pub promoted: Option<bool>,
30    /// Flow to use when authenticating existing users.
31    #[serde(
32        rename = "authentication_flow",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub authentication_flow: Option<Option<uuid::Uuid>>,
38    /// Flow to use when enrolling new users.
39    #[serde(
40        rename = "enrollment_flow",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub enrollment_flow: Option<Option<uuid::Uuid>>,
46    #[serde(rename = "user_property_mappings", skip_serializing_if = "Option::is_none")]
47    pub user_property_mappings: Option<Vec<uuid::Uuid>>,
48    #[serde(rename = "group_property_mappings", skip_serializing_if = "Option::is_none")]
49    pub group_property_mappings: Option<Vec<uuid::Uuid>>,
50    /// Get object component so that we know how to edit the object
51    #[serde(rename = "component")]
52    pub component: String,
53    /// Return object's verbose_name
54    #[serde(rename = "verbose_name")]
55    pub verbose_name: String,
56    /// Return object's plural verbose_name
57    #[serde(rename = "verbose_name_plural")]
58    pub verbose_name_plural: String,
59    /// Return internal model name
60    #[serde(rename = "meta_model_name")]
61    pub meta_model_name: String,
62    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
63    pub policy_engine_mode: Option<models::PolicyEngineMode>,
64    /// How the source determines if an existing user should be authenticated or a new user enrolled.
65    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
66    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
67    /// Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
68    #[serde(rename = "managed", deserialize_with = "Option::deserialize")]
69    pub managed: Option<String>,
70    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
71    pub user_path_template: Option<String>,
72    #[serde(rename = "icon", skip_serializing_if = "Option::is_none")]
73    pub icon: Option<String>,
74    #[serde(rename = "icon_url")]
75    pub icon_url: String,
76    /// How the source determines if an existing group should be used or a new group created.
77    #[serde(rename = "group_matching_mode", skip_serializing_if = "Option::is_none")]
78    pub group_matching_mode: Option<models::GroupMatchingModeEnum>,
79    /// Flow used before authentication.
80    #[serde(rename = "pre_authentication_flow")]
81    pub pre_authentication_flow: uuid::Uuid,
82    /// Also known as Entity ID. Defaults the Metadata URL.
83    #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")]
84    pub issuer: Option<String>,
85    /// URL that the initial Login request is sent to.
86    #[serde(rename = "sso_url")]
87    pub sso_url: String,
88    /// Optional URL if your IDP supports Single-Logout.
89    #[serde(
90        rename = "slo_url",
91        default,
92        with = "::serde_with::rust::double_option",
93        skip_serializing_if = "Option::is_none"
94    )]
95    pub slo_url: Option<Option<String>>,
96    /// Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.
97    #[serde(rename = "allow_idp_initiated", skip_serializing_if = "Option::is_none")]
98    pub allow_idp_initiated: Option<bool>,
99    /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent.
100    #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")]
101    pub name_id_policy: Option<models::SamlNameIdPolicyEnum>,
102    #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")]
103    pub binding_type: Option<models::BindingTypeEnum>,
104    /// When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default.
105    #[serde(
106        rename = "verification_kp",
107        default,
108        with = "::serde_with::rust::double_option",
109        skip_serializing_if = "Option::is_none"
110    )]
111    pub verification_kp: Option<Option<uuid::Uuid>>,
112    /// Keypair used to sign outgoing Responses going to the Identity Provider.
113    #[serde(
114        rename = "signing_kp",
115        default,
116        with = "::serde_with::rust::double_option",
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub signing_kp: Option<Option<uuid::Uuid>>,
120    #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")]
121    pub digest_algorithm: Option<models::DigestAlgorithmEnum>,
122    #[serde(rename = "signature_algorithm", skip_serializing_if = "Option::is_none")]
123    pub signature_algorithm: Option<models::SignatureAlgorithmEnum>,
124    /// Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3).
125    #[serde(rename = "temporary_user_delete_after", skip_serializing_if = "Option::is_none")]
126    pub temporary_user_delete_after: Option<String>,
127    /// When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key.
128    #[serde(
129        rename = "encryption_kp",
130        default,
131        with = "::serde_with::rust::double_option",
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub encryption_kp: Option<Option<uuid::Uuid>>,
135    #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")]
136    pub signed_assertion: Option<bool>,
137    #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")]
138    pub signed_response: Option<bool>,
139}
140
141impl SamlSource {
142    /// SAMLSource Serializer
143    pub fn new(
144        pk: uuid::Uuid,
145        name: String,
146        slug: String,
147        component: String,
148        verbose_name: String,
149        verbose_name_plural: String,
150        meta_model_name: String,
151        managed: Option<String>,
152        icon_url: String,
153        pre_authentication_flow: uuid::Uuid,
154        sso_url: String,
155    ) -> SamlSource {
156        SamlSource {
157            pk,
158            name,
159            slug,
160            enabled: None,
161            promoted: None,
162            authentication_flow: None,
163            enrollment_flow: None,
164            user_property_mappings: None,
165            group_property_mappings: None,
166            component,
167            verbose_name,
168            verbose_name_plural,
169            meta_model_name,
170            policy_engine_mode: None,
171            user_matching_mode: None,
172            managed,
173            user_path_template: None,
174            icon: None,
175            icon_url,
176            group_matching_mode: None,
177            pre_authentication_flow,
178            issuer: None,
179            sso_url,
180            slo_url: None,
181            allow_idp_initiated: None,
182            name_id_policy: None,
183            binding_type: None,
184            verification_kp: None,
185            signing_kp: None,
186            digest_algorithm: None,
187            signature_algorithm: None,
188            temporary_user_delete_after: None,
189            encryption_kp: None,
190            signed_assertion: None,
191            signed_response: None,
192        }
193    }
194}