authentik_rust/models/
patched_o_auth_source_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/// PatchedOAuthSourceRequest : OAuth Source Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PatchedOAuthSourceRequest {
16    /// Source's display Name.
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// Internal source name, used in URLs.
20    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
21    pub slug: Option<String>,
22    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
23    pub enabled: Option<bool>,
24    /// Flow to use when authenticating existing users.
25    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub authentication_flow: Option<Option<uuid::Uuid>>,
27    /// Flow to use when enrolling new users.
28    #[serde(rename = "enrollment_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub enrollment_flow: Option<Option<uuid::Uuid>>,
30    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
31    pub policy_engine_mode: Option<models::PolicyEngineMode>,
32    /// How the source determines if an existing user should be authenticated or a new user enrolled.  * `identifier` - Use the source-specific identifier * `email_link` - Link to a user with identical email address. Can have security implications when a source doesn't validate email addresses. * `email_deny` - Use the user's email address, but deny enrollment when the email address already exists. * `username_link` - Link to a user with identical username. Can have security implications when a username is used with another source. * `username_deny` - Use the user's username, but deny enrollment when the username already exists.
33    #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")]
34    pub user_matching_mode: Option<models::UserMatchingModeEnum>,
35    #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")]
36    pub user_path_template: Option<String>,
37    #[serde(rename = "provider_type", skip_serializing_if = "Option::is_none")]
38    pub provider_type: Option<models::ProviderTypeEnum>,
39    /// URL used to request the initial token. This URL is only required for OAuth 1.
40    #[serde(rename = "request_token_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub request_token_url: Option<Option<String>>,
42    /// URL the user is redirect to to conest the flow.
43    #[serde(rename = "authorization_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub authorization_url: Option<Option<String>>,
45    /// URL used by authentik to retrieve tokens.
46    #[serde(rename = "access_token_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub access_token_url: Option<Option<String>>,
48    /// URL used by authentik to get user information.
49    #[serde(rename = "profile_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub profile_url: Option<Option<String>>,
51    #[serde(rename = "consumer_key", skip_serializing_if = "Option::is_none")]
52    pub consumer_key: Option<String>,
53    #[serde(rename = "consumer_secret", skip_serializing_if = "Option::is_none")]
54    pub consumer_secret: Option<String>,
55    #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")]
56    pub additional_scopes: Option<String>,
57    #[serde(rename = "oidc_well_known_url", skip_serializing_if = "Option::is_none")]
58    pub oidc_well_known_url: Option<String>,
59    #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")]
60    pub oidc_jwks_url: Option<String>,
61    #[serde(rename = "oidc_jwks", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
62    pub oidc_jwks: Option<Option<serde_json::Value>>,
63}
64
65impl PatchedOAuthSourceRequest {
66    /// OAuth Source Serializer
67    pub fn new() -> PatchedOAuthSourceRequest {
68        PatchedOAuthSourceRequest {
69            name: None,
70            slug: None,
71            enabled: None,
72            authentication_flow: None,
73            enrollment_flow: None,
74            policy_engine_mode: None,
75            user_matching_mode: None,
76            user_path_template: None,
77            provider_type: None,
78            request_token_url: None,
79            authorization_url: None,
80            access_token_url: None,
81            profile_url: None,
82            consumer_key: None,
83            consumer_secret: None,
84            additional_scopes: None,
85            oidc_well_known_url: None,
86            oidc_jwks_url: None,
87            oidc_jwks: None,
88        }
89    }
90}
91