k8s_traefik_api/
tlsoptions.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium tlsoptions.traefik.io -A -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::CustomResource;
8    pub use typed_builder::TypedBuilder;
9    pub use schemars::JsonSchema;
10    pub use serde::{Serialize, Deserialize};
11}
12use self::prelude::*;
13
14/// TLSOptionSpec defines the desired state of a TLSOption.
15#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
16#[kube(group = "traefik.io", version = "v1alpha1", kind = "TLSOption", plural = "tlsoptions")]
17#[kube(namespaced)]
18#[kube(derive="Default")]
19#[kube(derive="PartialEq")]
20pub struct TLSOptionSpec {
21    /// ALPNProtocols defines the list of supported application level protocols for the TLS handshake, in order of preference.
22    /// More info: https://doc.traefik.io/traefik/v3.3/https/tls/#alpn-protocols
23    #[serde(default, skip_serializing_if = "Option::is_none", rename = "alpnProtocols")]
24    #[builder(default, setter(strip_option))]
25    pub alpn_protocols: Option<Vec<String>>,
26    /// CipherSuites defines the list of supported cipher suites for TLS versions up to TLS 1.2.
27    /// More info: https://doc.traefik.io/traefik/v3.3/https/tls/#cipher-suites
28    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cipherSuites")]
29    #[builder(default, setter(strip_option))]
30    pub cipher_suites: Option<Vec<String>>,
31    /// ClientAuth defines the server's policy for TLS Client Authentication.
32    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientAuth")]
33    #[builder(default, setter(strip_option))]
34    pub client_auth: Option<TLSOptionClientAuth>,
35    /// CurvePreferences defines the preferred elliptic curves in a specific order.
36    /// More info: https://doc.traefik.io/traefik/v3.3/https/tls/#curve-preferences
37    #[serde(default, skip_serializing_if = "Option::is_none", rename = "curvePreferences")]
38    #[builder(default, setter(strip_option))]
39    pub curve_preferences: Option<Vec<String>>,
40    /// MaxVersion defines the maximum TLS version that Traefik will accept.
41    /// Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
42    /// Default: None.
43    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxVersion")]
44    #[builder(default, setter(strip_option))]
45    pub max_version: Option<String>,
46    /// MinVersion defines the minimum TLS version that Traefik will accept.
47    /// Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
48    /// Default: VersionTLS10.
49    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minVersion")]
50    #[builder(default, setter(strip_option))]
51    pub min_version: Option<String>,
52    /// PreferServerCipherSuites defines whether the server chooses a cipher suite among his own instead of among the client's.
53    /// It is enabled automatically when minVersion or maxVersion is set.
54    /// Deprecated: https://github.com/golang/go/issues/45430
55    #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferServerCipherSuites")]
56    #[builder(default, setter(strip_option))]
57    pub prefer_server_cipher_suites: Option<bool>,
58    /// SniStrict defines whether Traefik allows connections from clients connections that do not specify a server_name extension.
59    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sniStrict")]
60    #[builder(default, setter(strip_option))]
61    pub sni_strict: Option<bool>,
62}
63
64/// ClientAuth defines the server's policy for TLS Client Authentication.
65#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
66pub struct TLSOptionClientAuth {
67    /// ClientAuthType defines the client authentication type to apply.
68    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientAuthType")]
69    #[builder(default, setter(strip_option))]
70    pub client_auth_type: Option<TLSOptionClientAuthClientAuthType>,
71    /// SecretNames defines the names of the referenced Kubernetes Secret storing certificate details.
72    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretNames")]
73    #[builder(default, setter(strip_option))]
74    pub secret_names: Option<Vec<String>>,
75}
76
77/// ClientAuth defines the server's policy for TLS Client Authentication.
78#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
79pub enum TLSOptionClientAuthClientAuthType {
80    NoClientCert,
81    RequestClientCert,
82    RequireAnyClientCert,
83    VerifyClientCertIfGiven,
84    RequireAndVerifyClientCert,
85}
86