gateway_api/apis/experimental/
referencegrants.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f -
3// kopium version: 0.21.2
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube::CustomResource;
8    pub use schemars::JsonSchema;
9    pub use serde::{Deserialize, Serialize};
10}
11use self::prelude::*;
12
13/// Spec defines the desired state of ReferenceGrant.
14#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
15#[kube(
16    group = "gateway.networking.k8s.io",
17    version = "v1beta1",
18    kind = "ReferenceGrant",
19    plural = "referencegrants"
20)]
21#[kube(namespaced)]
22#[kube(derive = "Default")]
23#[kube(derive = "PartialEq")]
24pub struct ReferenceGrantSpec {
25    /// From describes the trusted namespaces and kinds that can reference the
26    /// resources described in "To". Each entry in this list MUST be considered
27    /// to be an additional place that references can be valid from, or to put
28    /// this another way, entries MUST be combined using OR.
29    ///
30    /// Support: Core
31    pub from: Vec<ReferenceGrantFrom>,
32    /// To describes the resources that may be referenced by the resources
33    /// described in "From". Each entry in this list MUST be considered to be an
34    /// additional place that references can be valid to, or to put this another
35    /// way, entries MUST be combined using OR.
36    ///
37    /// Support: Core
38    pub to: Vec<ReferenceGrantTo>,
39}
40
41/// ReferenceGrantFrom describes trusted namespaces and kinds.
42#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
43pub struct ReferenceGrantFrom {
44    /// Group is the group of the referent.
45    /// When empty, the Kubernetes core API group is inferred.
46    ///
47    /// Support: Core
48    pub group: String,
49    /// Kind is the kind of the referent. Although implementations may support
50    /// additional resources, the following types are part of the "Core"
51    /// support level for this field.
52    ///
53    /// When used to permit a SecretObjectReference:
54    ///
55    /// * Gateway
56    ///
57    /// When used to permit a BackendObjectReference:
58    ///
59    /// * GRPCRoute
60    /// * HTTPRoute
61    /// * TCPRoute
62    /// * TLSRoute
63    /// * UDPRoute
64    pub kind: String,
65    /// Namespace is the namespace of the referent.
66    ///
67    /// Support: Core
68    pub namespace: String,
69}
70
71/// ReferenceGrantTo describes what Kinds are allowed as targets of the
72/// references.
73#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
74pub struct ReferenceGrantTo {
75    /// Group is the group of the referent.
76    /// When empty, the Kubernetes core API group is inferred.
77    ///
78    /// Support: Core
79    pub group: String,
80    /// Kind is the kind of the referent. Although implementations may support
81    /// additional resources, the following types are part of the "Core"
82    /// support level for this field:
83    ///
84    /// * Secret when used to permit a SecretObjectReference
85    /// * Service when used to permit a BackendObjectReference
86    pub kind: String,
87    /// Name is the name of the referent. When unspecified, this policy
88    /// refers to all resources of the specified Group and Kind in the local
89    /// namespace.
90    #[serde(default, skip_serializing_if = "Option::is_none")]
91    pub name: Option<String>,
92}