istio-api-rs 0.12.0

A collection of CRDs for api used in Istio.
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium -Af resources/istio/v1_23_0/security/v1beta1/PeerAuthentication.yaml --api-version v1beta1
// kopium version: 0.22.5

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use schemars::JsonSchema;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
}
use self::prelude::*;

/// Peer authentication configuration for workloads. See more details at: <https://istio.io/docs/reference/config/security/peer_authentication.html>
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[kube(group = "security.istio.io", version = "v1beta1", kind = "PeerAuthentication", plural = "peerauthentications")]
#[kube(namespaced)]
pub struct PeerAuthenticationSpec {
    /// Mutual TLS settings for workload.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mtls: Option<PeerAuthenticationMtls>,
    /// Port specific mutual TLS settings.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "portLevelMtls")]
    pub port_level_mtls: Option<BTreeMap<String, PeerAuthenticationPortLevelMtls>>,
    /// The selector determines the workloads to apply the PeerAuthentication on.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<PeerAuthenticationSelector>,
}

/// Mutual TLS settings for workload.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct PeerAuthenticationMtls {
    /// Defines the mTLS mode used for peer authentication.
    /// 
    /// Valid Options: DISABLE, PERMISSIVE, STRICT
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<PeerAuthenticationMtlsMode>,
}

/// Mutual TLS settings for workload.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum PeerAuthenticationMtlsMode {
    #[serde(rename = "UNSET")]
    Unset,
    #[serde(rename = "DISABLE")]
    Disable,
    #[serde(rename = "PERMISSIVE")]
    Permissive,
    #[serde(rename = "STRICT")]
    Strict,
}

/// Port specific mutual TLS settings.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct PeerAuthenticationPortLevelMtls {
    /// Defines the mTLS mode used for peer authentication.
    /// 
    /// Valid Options: DISABLE, PERMISSIVE, STRICT
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mode: Option<PeerAuthenticationPortLevelMtlsMode>,
}

/// Port specific mutual TLS settings.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub enum PeerAuthenticationPortLevelMtlsMode {
    #[serde(rename = "UNSET")]
    Unset,
    #[serde(rename = "DISABLE")]
    Disable,
    #[serde(rename = "PERMISSIVE")]
    Permissive,
    #[serde(rename = "STRICT")]
    Strict,
}

/// The selector determines the workloads to apply the PeerAuthentication on.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct PeerAuthenticationSelector {
    /// One or more labels that indicate a specific set of pods/VMs on which a policy should be applied.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
    pub match_labels: Option<BTreeMap<String, String>>,
}