authentik_rust/models/
proxy_outpost_config.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/// ProxyOutpostConfig : Proxy provider serializer for outposts
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ProxyOutpostConfig {
16    #[serde(rename = "pk")]
17    pub pk: i32,
18    #[serde(rename = "name")]
19    pub name: String,
20    #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")]
21    pub internal_host: Option<String>,
22    #[serde(rename = "external_host")]
23    pub external_host: String,
24    /// Validate SSL Certificates of upstream servers
25    #[serde(rename = "internal_host_ssl_validation", skip_serializing_if = "Option::is_none")]
26    pub internal_host_ssl_validation: Option<bool>,
27    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
28    pub client_id: Option<String>,
29    #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")]
30    pub client_secret: Option<String>,
31    #[serde(rename = "oidc_configuration")]
32    pub oidc_configuration: Box<models::OpenIdConnectConfiguration>,
33    #[serde(rename = "cookie_secret", skip_serializing_if = "Option::is_none")]
34    pub cookie_secret: Option<String>,
35    #[serde(rename = "certificate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub certificate: Option<Option<uuid::Uuid>>,
37    /// Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression.
38    #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")]
39    pub skip_path_regex: Option<String>,
40    /// Set a custom HTTP-Basic Authentication header based on values from authentik.
41    #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")]
42    pub basic_auth_enabled: Option<bool>,
43    /// User/Group Attribute used for the password part of the HTTP-Basic Header.
44    #[serde(rename = "basic_auth_password_attribute", skip_serializing_if = "Option::is_none")]
45    pub basic_auth_password_attribute: Option<String>,
46    /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used.
47    #[serde(rename = "basic_auth_user_attribute", skip_serializing_if = "Option::is_none")]
48    pub basic_auth_user_attribute: Option<String>,
49    /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.  * `proxy` - Proxy * `forward_single` - Forward Single * `forward_domain` - Forward Domain
50    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
51    pub mode: Option<models::ProxyMode>,
52    #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")]
53    pub cookie_domain: Option<String>,
54    /// Get token validity as second count
55    #[serde(rename = "access_token_validity", deserialize_with = "Option::deserialize")]
56    pub access_token_validity: Option<f64>,
57    /// When enabled, this provider will intercept the authorization header and authenticate requests based on its value.
58    #[serde(rename = "intercept_header_auth", skip_serializing_if = "Option::is_none")]
59    pub intercept_header_auth: Option<bool>,
60    /// Get all the scope names the outpost should request, including custom-defined ones
61    #[serde(rename = "scopes_to_request")]
62    pub scopes_to_request: Vec<String>,
63    /// Internal application name, used in URLs.
64    #[serde(rename = "assigned_application_slug")]
65    pub assigned_application_slug: String,
66    /// Application's display Name.
67    #[serde(rename = "assigned_application_name")]
68    pub assigned_application_name: String,
69}
70
71impl ProxyOutpostConfig {
72    /// Proxy provider serializer for outposts
73    pub fn new(pk: i32, name: String, external_host: String, oidc_configuration: models::OpenIdConnectConfiguration, access_token_validity: Option<f64>, scopes_to_request: Vec<String>, assigned_application_slug: String, assigned_application_name: String) -> ProxyOutpostConfig {
74        ProxyOutpostConfig {
75            pk,
76            name,
77            internal_host: None,
78            external_host,
79            internal_host_ssl_validation: None,
80            client_id: None,
81            client_secret: None,
82            oidc_configuration: Box::new(oidc_configuration),
83            cookie_secret: None,
84            certificate: None,
85            skip_path_regex: None,
86            basic_auth_enabled: None,
87            basic_auth_password_attribute: None,
88            basic_auth_user_attribute: None,
89            mode: None,
90            cookie_domain: None,
91            access_token_validity,
92            intercept_header_auth: None,
93            scopes_to_request,
94            assigned_application_slug,
95            assigned_application_name,
96        }
97    }
98}
99