k8s_crds_traefik/
tlsoptions.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -f tlsoptions.yml --schema=derived --docs -b --derive=Default --derive=PartialEq --smart-derive-elision
3// kopium version: 0.21.2
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube_derive::CustomResource;
8    #[cfg(feature = "schemars")]
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11    #[cfg(feature = "builder")]
12    pub use typed_builder::TypedBuilder;
13}
14use self::prelude::*;
15
16/// TLSOptionSpec defines the desired state of a TLSOption.
17#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
18#[cfg_attr(feature = "builder", derive(TypedBuilder))]
19#[cfg_attr(feature = "schemars", derive(JsonSchema))]
20#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
21#[kube(
22    group = "traefik.io",
23    version = "v1alpha1",
24    kind = "TLSOption",
25    plural = "tlsoptions"
26)]
27#[kube(namespaced)]
28#[kube(derive = "Default")]
29#[kube(derive = "PartialEq")]
30pub struct TLSOptionSpec {
31    /// ALPNProtocols defines the list of supported application level protocols for the TLS handshake, in order of preference.
32    /// More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/tls/tls-certificates/#certificates-stores#alpn-protocols
33    #[serde(
34        default,
35        skip_serializing_if = "Option::is_none",
36        rename = "alpnProtocols"
37    )]
38    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
39    pub alpn_protocols: Option<Vec<String>>,
40    /// CipherSuites defines the list of supported cipher suites for TLS versions up to TLS 1.2.
41    /// More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/tls/tls-certificates/#certificates-stores#cipher-suites
42    #[serde(
43        default,
44        skip_serializing_if = "Option::is_none",
45        rename = "cipherSuites"
46    )]
47    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
48    pub cipher_suites: Option<Vec<String>>,
49    /// ClientAuth defines the server's policy for TLS Client Authentication.
50    #[serde(
51        default,
52        skip_serializing_if = "Option::is_none",
53        rename = "clientAuth"
54    )]
55    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
56    pub client_auth: Option<TLSOptionClientAuth>,
57    /// CurvePreferences defines the preferred elliptic curves.
58    /// More info: https://doc.traefik.io/traefik/v3.6/reference/routing-configuration/http/tls/tls-certificates/#certificates-stores#curve-preferences
59    #[serde(
60        default,
61        skip_serializing_if = "Option::is_none",
62        rename = "curvePreferences"
63    )]
64    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
65    pub curve_preferences: Option<Vec<String>>,
66    /// DisableSessionTickets disables TLS session resumption via session tickets.
67    #[serde(
68        default,
69        skip_serializing_if = "Option::is_none",
70        rename = "disableSessionTickets"
71    )]
72    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
73    pub disable_session_tickets: Option<bool>,
74    /// MaxVersion defines the maximum TLS version that Traefik will accept.
75    /// Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
76    /// Default: None.
77    #[serde(
78        default,
79        skip_serializing_if = "Option::is_none",
80        rename = "maxVersion"
81    )]
82    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
83    pub max_version: Option<String>,
84    /// MinVersion defines the minimum TLS version that Traefik will accept.
85    /// Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
86    /// Default: VersionTLS10.
87    #[serde(
88        default,
89        skip_serializing_if = "Option::is_none",
90        rename = "minVersion"
91    )]
92    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
93    pub min_version: Option<String>,
94    /// PreferServerCipherSuites defines whether the server chooses a cipher suite among his own instead of among the client's.
95    /// It is enabled automatically when minVersion or maxVersion is set.
96    /// Deprecated: https://github.com/golang/go/issues/45430
97    #[serde(
98        default,
99        skip_serializing_if = "Option::is_none",
100        rename = "preferServerCipherSuites"
101    )]
102    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
103    pub prefer_server_cipher_suites: Option<bool>,
104    /// SniStrict defines whether Traefik allows connections from clients connections that do not specify a server_name extension.
105    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sniStrict")]
106    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
107    pub sni_strict: Option<bool>,
108}
109
110/// ClientAuth defines the server's policy for TLS Client Authentication.
111#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
112#[cfg_attr(feature = "builder", derive(TypedBuilder))]
113#[cfg_attr(feature = "schemars", derive(JsonSchema))]
114pub struct TLSOptionClientAuth {
115    /// ClientAuthType defines the client authentication type to apply.
116    #[serde(
117        default,
118        skip_serializing_if = "Option::is_none",
119        rename = "clientAuthType"
120    )]
121    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
122    pub client_auth_type: Option<TLSOptionClientAuthClientAuthType>,
123    /// SecretNames defines the names of the referenced Kubernetes Secret storing certificate details.
124    #[serde(
125        default,
126        skip_serializing_if = "Option::is_none",
127        rename = "secretNames"
128    )]
129    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
130    pub secret_names: Option<Vec<String>>,
131}
132
133/// ClientAuth defines the server's policy for TLS Client Authentication.
134#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
135#[cfg_attr(feature = "schemars", derive(JsonSchema))]
136pub enum TLSOptionClientAuthClientAuthType {
137    NoClientCert,
138    RequestClientCert,
139    RequireAnyClientCert,
140    VerifyClientCertIfGiven,
141    RequireAndVerifyClientCert,
142}