k8s_pb/api/authorization/v1/
mod.rs

1// This file is @generated by prost-build.
2/// ExtraValue masks the value so protobuf can generate
3/// +protobuf.nullable=true
4/// +protobuf.options.(gogoproto.goproto_stringer)=false
5///
6/// items, if empty, will result in an empty slice
7#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8pub struct ExtraValue {
9    #[prost(string, repeated, tag = "1")]
10    pub items: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
11}
12/// FieldSelectorAttributes indicates a field limited access.
13/// Webhook authors are encouraged to
14/// * ensure rawSelector and requirements are not both set
15/// * consider the requirements field if set
16/// * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see <https://www.oxeye.io/resources/golang-parameter-smuggling-attack> for more details.
17/// For the *SubjectAccessReview endpoints of the kube-apiserver:
18/// * If rawSelector is empty and requirements are empty, the request is not limited.
19/// * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
20/// * If rawSelector is empty and requirements are present, the requirements should be honored
21/// * If rawSelector is present and requirements are present, the request is invalid.
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct FieldSelectorAttributes {
24    /// rawSelector is the serialization of a field selector that would be included in a query parameter.
25    /// Webhook implementations are encouraged to ignore rawSelector.
26    /// The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
27    /// +optional
28    #[prost(string, optional, tag = "1")]
29    pub raw_selector: ::core::option::Option<::prost::alloc::string::String>,
30    /// requirements is the parsed interpretation of a field selector.
31    /// All requirements must be met for a resource instance to match the selector.
32    /// Webhook implementations should handle requirements, but how to handle them is up to the webhook.
33    /// Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements
34    /// are not understood.
35    /// +optional
36    /// +listType=atomic
37    #[prost(message, repeated, tag = "2")]
38    pub requirements: ::prost::alloc::vec::Vec<
39        super::super::super::apimachinery::pkg::apis::meta::v1::FieldSelectorRequirement,
40    >,
41}
42/// LabelSelectorAttributes indicates a label limited access.
43/// Webhook authors are encouraged to
44/// * ensure rawSelector and requirements are not both set
45/// * consider the requirements field if set
46/// * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see <https://www.oxeye.io/resources/golang-parameter-smuggling-attack> for more details.
47/// For the *SubjectAccessReview endpoints of the kube-apiserver:
48/// * If rawSelector is empty and requirements are empty, the request is not limited.
49/// * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
50/// * If rawSelector is empty and requirements are present, the requirements should be honored
51/// * If rawSelector is present and requirements are present, the request is invalid.
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct LabelSelectorAttributes {
54    /// rawSelector is the serialization of a field selector that would be included in a query parameter.
55    /// Webhook implementations are encouraged to ignore rawSelector.
56    /// The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.
57    /// +optional
58    #[prost(string, optional, tag = "1")]
59    pub raw_selector: ::core::option::Option<::prost::alloc::string::String>,
60    /// requirements is the parsed interpretation of a label selector.
61    /// All requirements must be met for a resource instance to match the selector.
62    /// Webhook implementations should handle requirements, but how to handle them is up to the webhook.
63    /// Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements
64    /// are not understood.
65    /// +optional
66    /// +listType=atomic
67    #[prost(message, repeated, tag = "2")]
68    pub requirements: ::prost::alloc::vec::Vec<
69        super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelectorRequirement,
70    >,
71}
72/// LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace.
73/// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
74/// checking.
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct LocalSubjectAccessReview {
77    /// Standard list metadata.
78    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
79    /// +optional
80    #[prost(message, optional, tag = "1")]
81    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
82    /// Spec holds information about the request being evaluated.  spec.namespace must be equal to the namespace
83    /// you made the request against.  If empty, it is defaulted.
84    #[prost(message, optional, tag = "2")]
85    pub spec: ::core::option::Option<SubjectAccessReviewSpec>,
86    /// Status is filled in by the server and indicates whether the request is allowed or not
87    /// +optional
88    #[prost(message, optional, tag = "3")]
89    pub status: ::core::option::Option<SubjectAccessReviewStatus>,
90}
91/// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
92#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
93pub struct NonResourceAttributes {
94    /// Path is the URL path of the request
95    /// +optional
96    #[prost(string, optional, tag = "1")]
97    pub path: ::core::option::Option<::prost::alloc::string::String>,
98    /// Verb is the standard HTTP verb
99    /// +optional
100    #[prost(string, optional, tag = "2")]
101    pub verb: ::core::option::Option<::prost::alloc::string::String>,
102}
103/// NonResourceRule holds information that describes a rule for the non-resource
104#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
105pub struct NonResourceRule {
106    /// Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options.  "*" means all.
107    /// +listType=atomic
108    #[prost(string, repeated, tag = "1")]
109    pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
110    /// NonResourceURLs is a set of partial urls that a user should have access to.  *s are allowed, but only as the full,
111    /// final step in the path.  "*" means all.
112    /// +optional
113    /// +listType=atomic
114    #[prost(string, repeated, tag = "2")]
115    pub non_resource_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
116}
117/// ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface
118#[derive(Clone, PartialEq, ::prost::Message)]
119pub struct ResourceAttributes {
120    /// Namespace is the namespace of the action being requested.  Currently, there is no distinction between no namespace and all namespaces
121    /// "" (empty) is defaulted for LocalSubjectAccessReviews
122    /// "" (empty) is empty for cluster-scoped resources
123    /// "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
124    /// +optional
125    #[prost(string, optional, tag = "1")]
126    pub namespace: ::core::option::Option<::prost::alloc::string::String>,
127    /// Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy.  "*" means all.
128    /// +optional
129    #[prost(string, optional, tag = "2")]
130    pub verb: ::core::option::Option<::prost::alloc::string::String>,
131    /// Group is the API Group of the Resource.  "*" means all.
132    /// +optional
133    #[prost(string, optional, tag = "3")]
134    pub group: ::core::option::Option<::prost::alloc::string::String>,
135    /// Version is the API Version of the Resource.  "*" means all.
136    /// +optional
137    #[prost(string, optional, tag = "4")]
138    pub version: ::core::option::Option<::prost::alloc::string::String>,
139    /// Resource is one of the existing resource types.  "*" means all.
140    /// +optional
141    #[prost(string, optional, tag = "5")]
142    pub resource: ::core::option::Option<::prost::alloc::string::String>,
143    /// Subresource is one of the existing resource types.  "" means none.
144    /// +optional
145    #[prost(string, optional, tag = "6")]
146    pub subresource: ::core::option::Option<::prost::alloc::string::String>,
147    /// Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all.
148    /// +optional
149    #[prost(string, optional, tag = "7")]
150    pub name: ::core::option::Option<::prost::alloc::string::String>,
151    /// fieldSelector describes the limitation on access based on field.  It can only limit access, not broaden it.
152    /// +optional
153    #[prost(message, optional, tag = "8")]
154    pub field_selector: ::core::option::Option<FieldSelectorAttributes>,
155    /// labelSelector describes the limitation on access based on labels.  It can only limit access, not broaden it.
156    /// +optional
157    #[prost(message, optional, tag = "9")]
158    pub label_selector: ::core::option::Option<LabelSelectorAttributes>,
159}
160/// ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant,
161/// may contain duplicates, and possibly be incomplete.
162#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
163pub struct ResourceRule {
164    /// Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy.  "*" means all.
165    /// +listType=atomic
166    #[prost(string, repeated, tag = "1")]
167    pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
168    /// APIGroups is the name of the APIGroup that contains the resources.  If multiple API groups are specified, any action requested against one of
169    /// the enumerated resources in any API group will be allowed.  "*" means all.
170    /// +optional
171    /// +listType=atomic
172    #[prost(string, repeated, tag = "2")]
173    pub api_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
174    /// Resources is a list of resources this rule applies to.  "*" means all in the specified apiGroups.
175    ///   "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups.
176    /// +optional
177    /// +listType=atomic
178    #[prost(string, repeated, tag = "3")]
179    pub resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
180    /// ResourceNames is an optional white list of names that the rule applies to.  An empty set means that everything is allowed.  "*" means all.
181    /// +optional
182    /// +listType=atomic
183    #[prost(string, repeated, tag = "4")]
184    pub resource_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
185}
186/// SelfSubjectAccessReview checks whether or the current user can perform an action.  Not filling in a
187/// spec.namespace means "in all namespaces".  Self is a special case, because users should always be able
188/// to check whether they can perform an action
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct SelfSubjectAccessReview {
191    /// Standard list metadata.
192    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
193    /// +optional
194    #[prost(message, optional, tag = "1")]
195    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
196    /// Spec holds information about the request being evaluated.  user and groups must be empty
197    #[prost(message, optional, tag = "2")]
198    pub spec: ::core::option::Option<SelfSubjectAccessReviewSpec>,
199    /// Status is filled in by the server and indicates whether the request is allowed or not
200    /// +optional
201    #[prost(message, optional, tag = "3")]
202    pub status: ::core::option::Option<SubjectAccessReviewStatus>,
203}
204/// SelfSubjectAccessReviewSpec is a description of the access request.  Exactly one of ResourceAuthorizationAttributes
205/// and NonResourceAuthorizationAttributes must be set
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct SelfSubjectAccessReviewSpec {
208    /// ResourceAuthorizationAttributes describes information for a resource access request
209    /// +optional
210    #[prost(message, optional, tag = "1")]
211    pub resource_attributes: ::core::option::Option<ResourceAttributes>,
212    /// NonResourceAttributes describes information for a non-resource access request
213    /// +optional
214    #[prost(message, optional, tag = "2")]
215    pub non_resource_attributes: ::core::option::Option<NonResourceAttributes>,
216}
217/// SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace.
218/// The returned list of actions may be incomplete depending on the server's authorization mode,
219/// and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions,
220/// or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to
221/// drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns.
222/// SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct SelfSubjectRulesReview {
225    /// Standard list metadata.
226    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
227    /// +optional
228    #[prost(message, optional, tag = "1")]
229    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
230    /// Spec holds information about the request being evaluated.
231    #[prost(message, optional, tag = "2")]
232    pub spec: ::core::option::Option<SelfSubjectRulesReviewSpec>,
233    /// Status is filled in by the server and indicates the set of actions a user can perform.
234    /// +optional
235    #[prost(message, optional, tag = "3")]
236    pub status: ::core::option::Option<SubjectRulesReviewStatus>,
237}
238/// SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.
239#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
240pub struct SelfSubjectRulesReviewSpec {
241    /// Namespace to evaluate rules for. Required.
242    #[prost(string, optional, tag = "1")]
243    pub namespace: ::core::option::Option<::prost::alloc::string::String>,
244}
245/// SubjectAccessReview checks whether or not a user or group can perform an action.
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct SubjectAccessReview {
248    /// Standard list metadata.
249    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
250    /// +optional
251    #[prost(message, optional, tag = "1")]
252    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
253    /// Spec holds information about the request being evaluated
254    #[prost(message, optional, tag = "2")]
255    pub spec: ::core::option::Option<SubjectAccessReviewSpec>,
256    /// Status is filled in by the server and indicates whether the request is allowed or not
257    /// +optional
258    #[prost(message, optional, tag = "3")]
259    pub status: ::core::option::Option<SubjectAccessReviewStatus>,
260}
261/// SubjectAccessReviewSpec is a description of the access request.  Exactly one of ResourceAuthorizationAttributes
262/// and NonResourceAuthorizationAttributes must be set
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct SubjectAccessReviewSpec {
265    /// ResourceAuthorizationAttributes describes information for a resource access request
266    /// +optional
267    #[prost(message, optional, tag = "1")]
268    pub resource_attributes: ::core::option::Option<ResourceAttributes>,
269    /// NonResourceAttributes describes information for a non-resource access request
270    /// +optional
271    #[prost(message, optional, tag = "2")]
272    pub non_resource_attributes: ::core::option::Option<NonResourceAttributes>,
273    /// User is the user you're testing for.
274    /// If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups
275    /// +optional
276    #[prost(string, optional, tag = "3")]
277    pub user: ::core::option::Option<::prost::alloc::string::String>,
278    /// Groups is the groups you're testing for.
279    /// +optional
280    /// +listType=atomic
281    #[prost(string, repeated, tag = "4")]
282    pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
283    /// Extra corresponds to the user.Info.GetExtra() method from the authenticator.  Since that is input to the authorizer
284    /// it needs a reflection here.
285    /// +optional
286    #[prost(btree_map = "string, message", tag = "5")]
287    pub extra: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, ExtraValue>,
288    /// UID information about the requesting user.
289    /// +optional
290    #[prost(string, optional, tag = "6")]
291    pub uid: ::core::option::Option<::prost::alloc::string::String>,
292}
293/// SubjectAccessReviewStatus
294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
295pub struct SubjectAccessReviewStatus {
296    /// Allowed is required. True if the action would be allowed, false otherwise.
297    #[prost(bool, optional, tag = "1")]
298    pub allowed: ::core::option::Option<bool>,
299    /// Denied is optional. True if the action would be denied, otherwise
300    /// false. If both allowed is false and denied is false, then the
301    /// authorizer has no opinion on whether to authorize the action. Denied
302    /// may not be true if Allowed is true.
303    /// +optional
304    #[prost(bool, optional, tag = "4")]
305    pub denied: ::core::option::Option<bool>,
306    /// Reason is optional.  It indicates why a request was allowed or denied.
307    /// +optional
308    #[prost(string, optional, tag = "2")]
309    pub reason: ::core::option::Option<::prost::alloc::string::String>,
310    /// EvaluationError is an indication that some error occurred during the authorization check.
311    /// It is entirely possible to get an error and be able to continue determine authorization status in spite of it.
312    /// For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.
313    /// +optional
314    #[prost(string, optional, tag = "3")]
315    pub evaluation_error: ::core::option::Option<::prost::alloc::string::String>,
316}
317/// SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on
318/// the set of authorizers the server is configured with and any errors experienced during evaluation.
319/// Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission,
320/// even if that list is incomplete.
321#[derive(Clone, PartialEq, ::prost::Message)]
322pub struct SubjectRulesReviewStatus {
323    /// ResourceRules is the list of actions the subject is allowed to perform on resources.
324    /// The list ordering isn't significant, may contain duplicates, and possibly be incomplete.
325    /// +listType=atomic
326    #[prost(message, repeated, tag = "1")]
327    pub resource_rules: ::prost::alloc::vec::Vec<ResourceRule>,
328    /// NonResourceRules is the list of actions the subject is allowed to perform on non-resources.
329    /// The list ordering isn't significant, may contain duplicates, and possibly be incomplete.
330    /// +listType=atomic
331    #[prost(message, repeated, tag = "2")]
332    pub non_resource_rules: ::prost::alloc::vec::Vec<NonResourceRule>,
333    /// Incomplete is true when the rules returned by this call are incomplete. This is most commonly
334    /// encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation.
335    #[prost(bool, optional, tag = "3")]
336    pub incomplete: ::core::option::Option<bool>,
337    /// EvaluationError can appear in combination with Rules. It indicates an error occurred during
338    /// rule evaluation, such as an authorizer that doesn't support rule evaluation, and that
339    /// ResourceRules and/or NonResourceRules may be incomplete.
340    /// +optional
341    #[prost(string, optional, tag = "4")]
342    pub evaluation_error: ::core::option::Option<::prost::alloc::string::String>,
343}
344
345impl crate::Resource for LocalSubjectAccessReview {
346    const API_VERSION: &'static str = "authorization.k8s.io/v1";
347    const GROUP: &'static str = "authorization.k8s.io";
348    const VERSION: &'static str = "v1";
349    const KIND: &'static str = "LocalSubjectAccessReview";
350    const URL_PATH_SEGMENT: &'static str = "localsubjectaccessreviews";
351    type Scope = crate::NamespaceResourceScope;
352}
353impl crate::Metadata for LocalSubjectAccessReview {
354    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
355    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
356        self.metadata.as_ref()
357    }
358    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
359        self.metadata.as_mut()
360    }
361}
362impl crate::HasSpec for LocalSubjectAccessReview {
363    type Spec = crate::api::authorization::v1::SubjectAccessReviewSpec;
364    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
365        self.spec.as_ref()
366    }
367    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
368        self.spec.as_mut()
369    }
370}
371impl crate::HasStatus for LocalSubjectAccessReview {
372    type Status = crate::api::authorization::v1::SubjectAccessReviewStatus;
373    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
374        self.status.as_ref()
375    }
376    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
377        self.status.as_mut()
378    }
379}
380
381impl crate::Resource for SelfSubjectAccessReview {
382    const API_VERSION: &'static str = "authorization.k8s.io/v1";
383    const GROUP: &'static str = "authorization.k8s.io";
384    const VERSION: &'static str = "v1";
385    const KIND: &'static str = "SelfSubjectAccessReview";
386    const URL_PATH_SEGMENT: &'static str = "selfsubjectaccessreviews";
387    type Scope = crate::ClusterResourceScope;
388}
389impl crate::Metadata for SelfSubjectAccessReview {
390    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
391    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
392        self.metadata.as_ref()
393    }
394    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
395        self.metadata.as_mut()
396    }
397}
398impl crate::HasSpec for SelfSubjectAccessReview {
399    type Spec = crate::api::authorization::v1::SelfSubjectAccessReviewSpec;
400    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
401        self.spec.as_ref()
402    }
403    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
404        self.spec.as_mut()
405    }
406}
407impl crate::HasStatus for SelfSubjectAccessReview {
408    type Status = crate::api::authorization::v1::SubjectAccessReviewStatus;
409    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
410        self.status.as_ref()
411    }
412    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
413        self.status.as_mut()
414    }
415}
416
417impl crate::Resource for SelfSubjectRulesReview {
418    const API_VERSION: &'static str = "authorization.k8s.io/v1";
419    const GROUP: &'static str = "authorization.k8s.io";
420    const VERSION: &'static str = "v1";
421    const KIND: &'static str = "SelfSubjectRulesReview";
422    const URL_PATH_SEGMENT: &'static str = "selfsubjectrulesreviews";
423    type Scope = crate::ClusterResourceScope;
424}
425impl crate::Metadata for SelfSubjectRulesReview {
426    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
427    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
428        self.metadata.as_ref()
429    }
430    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
431        self.metadata.as_mut()
432    }
433}
434impl crate::HasSpec for SelfSubjectRulesReview {
435    type Spec = crate::api::authorization::v1::SelfSubjectRulesReviewSpec;
436    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
437        self.spec.as_ref()
438    }
439    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
440        self.spec.as_mut()
441    }
442}
443impl crate::HasStatus for SelfSubjectRulesReview {
444    type Status = crate::api::authorization::v1::SubjectRulesReviewStatus;
445    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
446        self.status.as_ref()
447    }
448    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
449        self.status.as_mut()
450    }
451}
452
453impl crate::Resource for SubjectAccessReview {
454    const API_VERSION: &'static str = "authorization.k8s.io/v1";
455    const GROUP: &'static str = "authorization.k8s.io";
456    const VERSION: &'static str = "v1";
457    const KIND: &'static str = "SubjectAccessReview";
458    const URL_PATH_SEGMENT: &'static str = "subjectaccessreviews";
459    type Scope = crate::ClusterResourceScope;
460}
461impl crate::Metadata for SubjectAccessReview {
462    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
463    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
464        self.metadata.as_ref()
465    }
466    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
467        self.metadata.as_mut()
468    }
469}
470impl crate::HasSpec for SubjectAccessReview {
471    type Spec = crate::api::authorization::v1::SubjectAccessReviewSpec;
472    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
473        self.spec.as_ref()
474    }
475    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
476        self.spec.as_mut()
477    }
478}
479impl crate::HasStatus for SubjectAccessReview {
480    type Status = crate::api::authorization::v1::SubjectAccessReviewStatus;
481    fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
482        self.status.as_ref()
483    }
484    fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
485        self.status.as_mut()
486    }
487}