Skip to main content

authentik_client/models/
saml_source.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.12.4
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    #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")]
77    pub icon_themed_urls: Option<models::ThemedUrls>,
78    /// How the source determines if an existing group should be used or a new group created.
79    #[serde(rename = "group_matching_mode", skip_serializing_if = "Option::is_none")]
80    pub group_matching_mode: Option<models::GroupMatchingModeEnum>,
81    /// Flow used before authentication.
82    #[serde(rename = "pre_authentication_flow")]
83    pub pre_authentication_flow: uuid::Uuid,
84    /// Also known as Entity ID. Defaults the Metadata URL.
85    #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")]
86    pub issuer: Option<String>,
87    /// URL that the initial Login request is sent to.
88    #[serde(rename = "sso_url")]
89    pub sso_url: String,
90    /// Optional URL if your IDP supports Single-Logout.
91    #[serde(
92        rename = "slo_url",
93        default,
94        with = "::serde_with::rust::double_option",
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub slo_url: Option<Option<String>>,
98    /// Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.
99    #[serde(rename = "allow_idp_initiated", skip_serializing_if = "Option::is_none")]
100    pub allow_idp_initiated: Option<bool>,
101    /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent.
102    #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")]
103    pub name_id_policy: Option<models::SamlNameIdPolicyEnum>,
104    #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")]
105    pub binding_type: Option<models::BindingTypeEnum>,
106    /// When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default.
107    #[serde(
108        rename = "verification_kp",
109        default,
110        with = "::serde_with::rust::double_option",
111        skip_serializing_if = "Option::is_none"
112    )]
113    pub verification_kp: Option<Option<uuid::Uuid>>,
114    /// Keypair used to sign outgoing Responses going to the Identity Provider.
115    #[serde(
116        rename = "signing_kp",
117        default,
118        with = "::serde_with::rust::double_option",
119        skip_serializing_if = "Option::is_none"
120    )]
121    pub signing_kp: Option<Option<uuid::Uuid>>,
122    #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")]
123    pub digest_algorithm: Option<models::DigestAlgorithmEnum>,
124    #[serde(rename = "signature_algorithm", skip_serializing_if = "Option::is_none")]
125    pub signature_algorithm: Option<models::SignatureAlgorithmEnum>,
126    /// 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).
127    #[serde(rename = "temporary_user_delete_after", skip_serializing_if = "Option::is_none")]
128    pub temporary_user_delete_after: Option<String>,
129    /// 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.
130    #[serde(
131        rename = "encryption_kp",
132        default,
133        with = "::serde_with::rust::double_option",
134        skip_serializing_if = "Option::is_none"
135    )]
136    pub encryption_kp: Option<Option<uuid::Uuid>>,
137    #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")]
138    pub signed_assertion: Option<bool>,
139    #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")]
140    pub signed_response: Option<bool>,
141}
142
143impl SamlSource {
144    /// SAMLSource Serializer
145    pub fn new(
146        pk: uuid::Uuid,
147        name: String,
148        slug: String,
149        component: String,
150        verbose_name: String,
151        verbose_name_plural: String,
152        meta_model_name: String,
153        managed: Option<String>,
154        icon_url: String,
155        icon_themed_urls: Option<models::ThemedUrls>,
156        pre_authentication_flow: uuid::Uuid,
157        sso_url: String,
158    ) -> SamlSource {
159        SamlSource {
160            pk,
161            name,
162            slug,
163            enabled: None,
164            promoted: None,
165            authentication_flow: None,
166            enrollment_flow: None,
167            user_property_mappings: None,
168            group_property_mappings: None,
169            component,
170            verbose_name,
171            verbose_name_plural,
172            meta_model_name,
173            policy_engine_mode: None,
174            user_matching_mode: None,
175            managed,
176            user_path_template: None,
177            icon: None,
178            icon_url,
179            icon_themed_urls,
180            group_matching_mode: None,
181            pre_authentication_flow,
182            issuer: None,
183            sso_url,
184            slo_url: None,
185            allow_idp_initiated: None,
186            name_id_policy: None,
187            binding_type: None,
188            verification_kp: None,
189            signing_kp: None,
190            digest_algorithm: None,
191            signature_algorithm: None,
192            temporary_user_delete_after: None,
193            encryption_kp: None,
194            signed_assertion: None,
195            signed_response: None,
196        }
197    }
198}