authentik_rust/models/
o_auth2_provider.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/// OAuth2Provider : OAuth2Provider Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OAuth2Provider {
16    #[serde(rename = "pk")]
17    pub pk: i32,
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
21    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub authentication_flow: Option<Option<uuid::Uuid>>,
23    /// Flow used when authorizing this provider.
24    #[serde(rename = "authorization_flow")]
25    pub authorization_flow: uuid::Uuid,
26    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
27    pub property_mappings: Option<Vec<uuid::Uuid>>,
28    /// Get object component so that we know how to edit the object
29    #[serde(rename = "component")]
30    pub component: String,
31    /// Internal application name, used in URLs.
32    #[serde(rename = "assigned_application_slug")]
33    pub assigned_application_slug: String,
34    /// Application's display Name.
35    #[serde(rename = "assigned_application_name")]
36    pub assigned_application_name: String,
37    /// Internal application name, used in URLs.
38    #[serde(rename = "assigned_backchannel_application_slug")]
39    pub assigned_backchannel_application_slug: String,
40    /// Application's display Name.
41    #[serde(rename = "assigned_backchannel_application_name")]
42    pub assigned_backchannel_application_name: String,
43    /// Return object's verbose_name
44    #[serde(rename = "verbose_name")]
45    pub verbose_name: String,
46    /// Return object's plural verbose_name
47    #[serde(rename = "verbose_name_plural")]
48    pub verbose_name_plural: String,
49    /// Return internal model name
50    #[serde(rename = "meta_model_name")]
51    pub meta_model_name: String,
52    /// Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable  * `confidential` - Confidential * `public` - Public
53    #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")]
54    pub client_type: Option<models::ClientTypeEnum>,
55    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
56    pub client_id: Option<String>,
57    #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")]
58    pub client_secret: Option<String>,
59    /// Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
60    #[serde(rename = "access_code_validity", skip_serializing_if = "Option::is_none")]
61    pub access_code_validity: Option<String>,
62    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
63    #[serde(rename = "access_token_validity", skip_serializing_if = "Option::is_none")]
64    pub access_token_validity: Option<String>,
65    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
66    #[serde(rename = "refresh_token_validity", skip_serializing_if = "Option::is_none")]
67    pub refresh_token_validity: Option<String>,
68    /// Include User claims from scopes in the id_token, for applications that don't access the userinfo endpoint.
69    #[serde(rename = "include_claims_in_id_token", skip_serializing_if = "Option::is_none")]
70    pub include_claims_in_id_token: Option<bool>,
71    /// Key used to sign the tokens. Only required when JWT Algorithm is set to RS256.
72    #[serde(rename = "signing_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
73    pub signing_key: Option<Option<uuid::Uuid>>,
74    /// Enter each URI on a new line.
75    #[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")]
76    pub redirect_uris: Option<String>,
77    /// Configure what data should be used as unique User Identifier. For most cases, the default should be fine.  * `hashed_user_id` - Based on the Hashed User ID * `user_id` - Based on user ID * `user_uuid` - Based on user UUID * `user_username` - Based on the username * `user_email` - Based on the User's Email. This is recommended over the UPN method. * `user_upn` - Based on the User's UPN, only works if user has a 'upn' attribute set. Use this method only if you have different UPN and Mail domains.
78    #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")]
79    pub sub_mode: Option<models::SubModeEnum>,
80    /// Configure how the issuer field of the ID Token should be filled.  * `global` - Same identifier is used for all providers * `per_provider` - Each provider has a different issuer, based on the application slug.
81    #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")]
82    pub issuer_mode: Option<models::IssuerModeEnum>,
83    #[serde(rename = "jwks_sources", skip_serializing_if = "Option::is_none")]
84    pub jwks_sources: Option<Vec<uuid::Uuid>>,
85}
86
87impl OAuth2Provider {
88    /// OAuth2Provider Serializer
89    pub fn new(pk: i32, name: String, authorization_flow: uuid::Uuid, component: String, assigned_application_slug: String, assigned_application_name: String, assigned_backchannel_application_slug: String, assigned_backchannel_application_name: String, verbose_name: String, verbose_name_plural: String, meta_model_name: String) -> OAuth2Provider {
90        OAuth2Provider {
91            pk,
92            name,
93            authentication_flow: None,
94            authorization_flow,
95            property_mappings: None,
96            component,
97            assigned_application_slug,
98            assigned_application_name,
99            assigned_backchannel_application_slug,
100            assigned_backchannel_application_name,
101            verbose_name,
102            verbose_name_plural,
103            meta_model_name,
104            client_type: None,
105            client_id: None,
106            client_secret: None,
107            access_code_validity: None,
108            access_token_validity: None,
109            refresh_token_validity: None,
110            include_claims_in_id_token: None,
111            signing_key: None,
112            redirect_uris: None,
113            sub_mode: None,
114            issuer_mode: None,
115            jwks_sources: None,
116        }
117    }
118}
119