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.8.6
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}
131
132impl SamlSource {
133    /// SAMLSource Serializer
134    pub fn new(
135        pk: uuid::Uuid,
136        name: String,
137        slug: String,
138        component: String,
139        verbose_name: String,
140        verbose_name_plural: String,
141        meta_model_name: String,
142        managed: Option<String>,
143        icon: String,
144        pre_authentication_flow: uuid::Uuid,
145        sso_url: String,
146    ) -> SamlSource {
147        SamlSource {
148            pk,
149            name,
150            slug,
151            enabled: None,
152            authentication_flow: None,
153            enrollment_flow: None,
154            user_property_mappings: None,
155            group_property_mappings: None,
156            component,
157            verbose_name,
158            verbose_name_plural,
159            meta_model_name,
160            policy_engine_mode: None,
161            user_matching_mode: None,
162            managed,
163            user_path_template: None,
164            icon,
165            group_matching_mode: None,
166            pre_authentication_flow,
167            issuer: None,
168            sso_url,
169            slo_url: None,
170            allow_idp_initiated: None,
171            name_id_policy: None,
172            binding_type: None,
173            verification_kp: None,
174            signing_kp: None,
175            digest_algorithm: None,
176            signature_algorithm: None,
177            temporary_user_delete_after: None,
178            encryption_kp: None,
179        }
180    }
181}