Skip to main content

authentik_client/models/
proxy_provider.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/// ProxyProvider : ProxyProvider Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProxyProvider {
17    #[serde(rename = "pk")]
18    pub pk: i32,
19    #[serde(rename = "name")]
20    pub name: String,
21    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
22    #[serde(
23        rename = "authentication_flow",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub authentication_flow: Option<Option<uuid::Uuid>>,
29    /// Flow used when authorizing this provider.
30    #[serde(rename = "authorization_flow")]
31    pub authorization_flow: uuid::Uuid,
32    /// Flow used ending the session from a provider.
33    #[serde(rename = "invalidation_flow")]
34    pub invalidation_flow: uuid::Uuid,
35    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
36    pub property_mappings: Option<Vec<uuid::Uuid>>,
37    /// Get object component so that we know how to edit the object
38    #[serde(rename = "component")]
39    pub component: String,
40    /// Internal application name, used in URLs.
41    #[serde(rename = "assigned_application_slug", deserialize_with = "Option::deserialize")]
42    pub assigned_application_slug: Option<String>,
43    /// Application's display Name.
44    #[serde(rename = "assigned_application_name", deserialize_with = "Option::deserialize")]
45    pub assigned_application_name: Option<String>,
46    /// Internal application name, used in URLs.
47    #[serde(
48        rename = "assigned_backchannel_application_slug",
49        deserialize_with = "Option::deserialize"
50    )]
51    pub assigned_backchannel_application_slug: Option<String>,
52    /// Application's display Name.
53    #[serde(
54        rename = "assigned_backchannel_application_name",
55        deserialize_with = "Option::deserialize"
56    )]
57    pub assigned_backchannel_application_name: Option<String>,
58    /// Return object's verbose_name
59    #[serde(rename = "verbose_name")]
60    pub verbose_name: String,
61    /// Return object's plural verbose_name
62    #[serde(rename = "verbose_name_plural")]
63    pub verbose_name_plural: String,
64    /// Return internal model name
65    #[serde(rename = "meta_model_name")]
66    pub meta_model_name: String,
67    #[serde(rename = "client_id")]
68    pub client_id: String,
69    #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")]
70    pub internal_host: Option<String>,
71    #[serde(rename = "external_host")]
72    pub external_host: String,
73    /// Validate SSL Certificates of upstream servers
74    #[serde(rename = "internal_host_ssl_validation", skip_serializing_if = "Option::is_none")]
75    pub internal_host_ssl_validation: Option<bool>,
76    #[serde(
77        rename = "certificate",
78        default,
79        with = "::serde_with::rust::double_option",
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub certificate: Option<Option<uuid::Uuid>>,
83    /// Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression.
84    #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")]
85    pub skip_path_regex: Option<String>,
86    /// Set a custom HTTP-Basic Authentication header based on values from authentik.
87    #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")]
88    pub basic_auth_enabled: Option<bool>,
89    /// User/Group Attribute used for the password part of the HTTP-Basic Header.
90    #[serde(rename = "basic_auth_password_attribute", skip_serializing_if = "Option::is_none")]
91    pub basic_auth_password_attribute: Option<String>,
92    /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used.
93    #[serde(rename = "basic_auth_user_attribute", skip_serializing_if = "Option::is_none")]
94    pub basic_auth_user_attribute: Option<String>,
95    /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.
96    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
97    pub mode: Option<models::ProxyMode>,
98    /// When enabled, this provider will intercept the authorization header and authenticate requests based on its value.
99    #[serde(rename = "intercept_header_auth", skip_serializing_if = "Option::is_none")]
100    pub intercept_header_auth: Option<bool>,
101    #[serde(rename = "redirect_uris")]
102    pub redirect_uris: Vec<models::RedirectUri>,
103    #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")]
104    pub cookie_domain: Option<String>,
105    #[serde(rename = "jwt_federation_sources", skip_serializing_if = "Option::is_none")]
106    pub jwt_federation_sources: Option<Vec<uuid::Uuid>>,
107    #[serde(rename = "jwt_federation_providers", skip_serializing_if = "Option::is_none")]
108    pub jwt_federation_providers: Option<Vec<i32>>,
109    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
110    #[serde(rename = "access_token_validity", skip_serializing_if = "Option::is_none")]
111    pub access_token_validity: Option<String>,
112    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
113    #[serde(rename = "refresh_token_validity", skip_serializing_if = "Option::is_none")]
114    pub refresh_token_validity: Option<String>,
115    #[serde(rename = "outpost_set")]
116    pub outpost_set: Vec<String>,
117}
118
119impl ProxyProvider {
120    /// ProxyProvider Serializer
121    pub fn new(
122        pk: i32,
123        name: String,
124        authorization_flow: uuid::Uuid,
125        invalidation_flow: uuid::Uuid,
126        component: String,
127        assigned_application_slug: Option<String>,
128        assigned_application_name: Option<String>,
129        assigned_backchannel_application_slug: Option<String>,
130        assigned_backchannel_application_name: Option<String>,
131        verbose_name: String,
132        verbose_name_plural: String,
133        meta_model_name: String,
134        client_id: String,
135        external_host: String,
136        redirect_uris: Vec<models::RedirectUri>,
137        outpost_set: Vec<String>,
138    ) -> ProxyProvider {
139        ProxyProvider {
140            pk,
141            name,
142            authentication_flow: None,
143            authorization_flow,
144            invalidation_flow,
145            property_mappings: None,
146            component,
147            assigned_application_slug,
148            assigned_application_name,
149            assigned_backchannel_application_slug,
150            assigned_backchannel_application_name,
151            verbose_name,
152            verbose_name_plural,
153            meta_model_name,
154            client_id,
155            internal_host: None,
156            external_host,
157            internal_host_ssl_validation: None,
158            certificate: None,
159            skip_path_regex: None,
160            basic_auth_enabled: None,
161            basic_auth_password_attribute: None,
162            basic_auth_user_attribute: None,
163            mode: None,
164            intercept_header_auth: None,
165            redirect_uris,
166            cookie_domain: None,
167            jwt_federation_sources: None,
168            jwt_federation_providers: None,
169            access_token_validity: None,
170            refresh_token_validity: None,
171            outpost_set,
172        }
173    }
174}