authentik_client/models/
saml_source.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.10.2
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    /// Flow to use when authenticating existing users.
28    #[serde(
29        rename = "authentication_flow",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub authentication_flow: Option<Option<uuid::Uuid>>,
35    /// Flow to use when enrolling new users.
36    #[serde(
37        rename = "enrollment_flow",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub enrollment_flow: Option<Option<uuid::Uuid>>,
43    #[serde(rename = "user_property_mappings", skip_serializing_if = "Option::is_none")]
44    pub user_property_mappings: Option<Vec<uuid::Uuid>>,
45    #[serde(rename = "group_property_mappings", skip_serializing_if = "Option::is_none")]
46    pub group_property_mappings: Option<Vec<uuid::Uuid>>,
47    /// Get object component so that we know how to edit the object
48    #[serde(rename = "component")]
49    pub component: String,
50    /// Return object's verbose_name
51    #[serde(rename = "verbose_name")]
52    pub verbose_name: String,
53    /// Return object's plural verbose_name
54    #[serde(rename = "verbose_name_plural")]
55    pub verbose_name_plural: String,
56    /// Return internal model name
57    #[serde(rename = "meta_model_name")]
58    pub meta_model_name: String,
59    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
60    pub policy_engine_mode: Option<models::PolicyEngineMode>,
61    /// How the source determines if an existing user should be authenticated or a new user enrolled.
62    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
63    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
64    /// 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.
65    #[serde(rename = "managed", deserialize_with = "Option::deserialize")]
66    pub managed: Option<String>,
67    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
68    pub user_path_template: Option<String>,
69    #[serde(rename = "icon")]
70    pub icon: String,
71    /// How the source determines if an existing group should be used or a new group created.
72    #[serde(rename = "group_matching_mode", skip_serializing_if = "Option::is_none")]
73    pub group_matching_mode: Option<models::GroupMatchingModeEnum>,
74    /// Flow used before authentication.
75    #[serde(rename = "pre_authentication_flow")]
76    pub pre_authentication_flow: uuid::Uuid,
77    /// Also known as Entity ID. Defaults the Metadata URL.
78    #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")]
79    pub issuer: Option<String>,
80    /// URL that the initial Login request is sent to.
81    #[serde(rename = "sso_url")]
82    pub sso_url: String,
83    /// Optional URL if your IDP supports Single-Logout.
84    #[serde(
85        rename = "slo_url",
86        default,
87        with = "::serde_with::rust::double_option",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub slo_url: Option<Option<String>>,
91    /// Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.
92    #[serde(rename = "allow_idp_initiated", skip_serializing_if = "Option::is_none")]
93    pub allow_idp_initiated: Option<bool>,
94    /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent.
95    #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")]
96    pub name_id_policy: Option<models::SamlNameIdPolicyEnum>,
97    #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")]
98    pub binding_type: Option<models::BindingTypeEnum>,
99    /// When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default.
100    #[serde(
101        rename = "verification_kp",
102        default,
103        with = "::serde_with::rust::double_option",
104        skip_serializing_if = "Option::is_none"
105    )]
106    pub verification_kp: Option<Option<uuid::Uuid>>,
107    /// Keypair used to sign outgoing Responses going to the Identity Provider.
108    #[serde(
109        rename = "signing_kp",
110        default,
111        with = "::serde_with::rust::double_option",
112        skip_serializing_if = "Option::is_none"
113    )]
114    pub signing_kp: Option<Option<uuid::Uuid>>,
115    #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")]
116    pub digest_algorithm: Option<models::DigestAlgorithmEnum>,
117    #[serde(rename = "signature_algorithm", skip_serializing_if = "Option::is_none")]
118    pub signature_algorithm: Option<models::SignatureAlgorithmEnum>,
119    /// 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).
120    #[serde(rename = "temporary_user_delete_after", skip_serializing_if = "Option::is_none")]
121    pub temporary_user_delete_after: Option<String>,
122    /// 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.
123    #[serde(
124        rename = "encryption_kp",
125        default,
126        with = "::serde_with::rust::double_option",
127        skip_serializing_if = "Option::is_none"
128    )]
129    pub encryption_kp: Option<Option<uuid::Uuid>>,
130    #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")]
131    pub signed_assertion: Option<bool>,
132    #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")]
133    pub signed_response: Option<bool>,
134}
135
136impl SamlSource {
137    /// SAMLSource Serializer
138    pub fn new(
139        pk: uuid::Uuid,
140        name: String,
141        slug: String,
142        component: String,
143        verbose_name: String,
144        verbose_name_plural: String,
145        meta_model_name: String,
146        managed: Option<String>,
147        icon: String,
148        pre_authentication_flow: uuid::Uuid,
149        sso_url: String,
150    ) -> SamlSource {
151        SamlSource {
152            pk,
153            name,
154            slug,
155            enabled: None,
156            authentication_flow: None,
157            enrollment_flow: None,
158            user_property_mappings: None,
159            group_property_mappings: None,
160            component,
161            verbose_name,
162            verbose_name_plural,
163            meta_model_name,
164            policy_engine_mode: None,
165            user_matching_mode: None,
166            managed,
167            user_path_template: None,
168            icon,
169            group_matching_mode: None,
170            pre_authentication_flow,
171            issuer: None,
172            sso_url,
173            slo_url: None,
174            allow_idp_initiated: None,
175            name_id_policy: None,
176            binding_type: None,
177            verification_kp: None,
178            signing_kp: None,
179            digest_algorithm: None,
180            signature_algorithm: None,
181            temporary_user_delete_after: None,
182            encryption_kp: None,
183            signed_assertion: None,
184            signed_response: None,
185        }
186    }
187}