authentik_rust/models/
saml_provider_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// SamlProviderRequest : SAMLProvider Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SamlProviderRequest {
16    #[serde(rename = "name")]
17    pub name: String,
18    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
19    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub authentication_flow: Option<Option<uuid::Uuid>>,
21    /// Flow used when authorizing this provider.
22    #[serde(rename = "authorization_flow")]
23    pub authorization_flow: uuid::Uuid,
24    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
25    pub property_mappings: Option<Vec<uuid::Uuid>>,
26    #[serde(rename = "acs_url")]
27    pub acs_url: String,
28    /// Value of the audience restriction field of the assertion. When left empty, no audience restriction will be added.
29    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
30    pub audience: Option<String>,
31    /// Also known as EntityID
32    #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")]
33    pub issuer: Option<String>,
34    /// Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3).
35    #[serde(rename = "assertion_valid_not_before", skip_serializing_if = "Option::is_none")]
36    pub assertion_valid_not_before: Option<String>,
37    /// Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
38    #[serde(rename = "assertion_valid_not_on_or_after", skip_serializing_if = "Option::is_none")]
39    pub assertion_valid_not_on_or_after: Option<String>,
40    /// Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
41    #[serde(rename = "session_valid_not_on_or_after", skip_serializing_if = "Option::is_none")]
42    pub session_valid_not_on_or_after: Option<String>,
43    /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered
44    #[serde(rename = "name_id_mapping", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub name_id_mapping: Option<Option<uuid::Uuid>>,
46    #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")]
47    pub digest_algorithm: Option<models::DigestAlgorithmEnum>,
48    #[serde(rename = "signature_algorithm", skip_serializing_if = "Option::is_none")]
49    pub signature_algorithm: Option<models::SignatureAlgorithmEnum>,
50    /// Keypair used to sign outgoing Responses going to the Service Provider.
51    #[serde(rename = "signing_kp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
52    pub signing_kp: Option<Option<uuid::Uuid>>,
53    /// When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default.
54    #[serde(rename = "verification_kp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
55    pub verification_kp: Option<Option<uuid::Uuid>>,
56    /// This determines how authentik sends the response back to the Service Provider.  * `redirect` - Redirect * `post` - Post
57    #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")]
58    pub sp_binding: Option<models::SpBindingEnum>,
59    /// Default relay_state value for IDP-initiated logins
60    #[serde(rename = "default_relay_state", skip_serializing_if = "Option::is_none")]
61    pub default_relay_state: Option<String>,
62}
63
64impl SamlProviderRequest {
65    /// SAMLProvider Serializer
66    pub fn new(name: String, authorization_flow: uuid::Uuid, acs_url: String) -> SamlProviderRequest {
67        SamlProviderRequest {
68            name,
69            authentication_flow: None,
70            authorization_flow,
71            property_mappings: None,
72            acs_url,
73            audience: None,
74            issuer: None,
75            assertion_valid_not_before: None,
76            assertion_valid_not_on_or_after: None,
77            session_valid_not_on_or_after: None,
78            name_id_mapping: None,
79            digest_algorithm: None,
80            signature_algorithm: None,
81            signing_kp: None,
82            verification_kp: None,
83            sp_binding: None,
84            default_relay_state: None,
85        }
86    }
87}
88