gateway_api/apis/standard/
referencegrants.rs

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