Skip to main content

windmill_api/models/
client_ip_diagnostics.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.895.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClientIpDiagnostics {
16    #[serde(rename = "peer", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub peer: Option<Option<String>>,
18    #[serde(rename = "forwarding_header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub forwarding_header: Option<Option<String>>,
20    /// as audit entries and the login rate limit record it
21    #[serde(rename = "client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub client_ip: Option<Option<String>>,
23    /// as token IP allowlists see it
24    #[serde(rename = "enforced_client_ip", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub enforced_client_ip: Option<Option<String>>,
26    #[serde(rename = "trusted_proxies_set")]
27    pub trusted_proxies_set: bool,
28    /// a whole private range is trusted, so any host on the private network can name its own client address
29    #[serde(rename = "private_ranges_trusted")]
30    pub private_ranges_trusted: bool,
31    #[serde(rename = "client_ip_header", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub client_ip_header: Option<Option<String>>,
33    #[serde(rename = "enforced")]
34    pub enforced: Box<models::ClientIpTrustView>,
35    /// absent when it is the enforced view, which it differs from only by Cloudflare
36    #[serde(rename = "attributed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub attributed: Option<Option<Box<models::ClientIpTrustView>>>,
38    #[serde(rename = "configuration")]
39    pub configuration: Box<models::ClientIpDiagnosticsConfiguration>,
40    #[serde(rename = "forwarders")]
41    pub forwarders: Vec<models::ClientIpDiagnosticsForwardersInner>,
42}
43
44impl ClientIpDiagnostics {
45    pub fn new(trusted_proxies_set: bool, private_ranges_trusted: bool, enforced: models::ClientIpTrustView, configuration: models::ClientIpDiagnosticsConfiguration, forwarders: Vec<models::ClientIpDiagnosticsForwardersInner>) -> ClientIpDiagnostics {
46        ClientIpDiagnostics {
47            peer: None,
48            forwarding_header: None,
49            client_ip: None,
50            enforced_client_ip: None,
51            trusted_proxies_set,
52            private_ranges_trusted,
53            client_ip_header: None,
54            enforced: Box::new(enforced),
55            attributed: None,
56            configuration: Box::new(configuration),
57            forwarders,
58        }
59    }
60}
61