k8s_openapi_ext/get/
selfsubjectreview.rs1use super::*;
2
3pub trait SelfSubjectReviewGetExt {
4 fn status(&self) -> Option<&authenticationv1::SelfSubjectReviewStatus>;
5
6 fn userinfo(&self) -> Option<&authenticationv1::UserInfo> {
7 self.status()?.user_info.as_ref()
8 }
9
10 fn username(&self) -> Option<&str> {
11 self.userinfo()?.username.as_deref()
12 }
13
14 fn uid(&self) -> Option<&str> {
15 self.userinfo()?.uid.as_deref()
16 }
17
18 fn groups(&self) -> Option<&[String]> {
19 self.userinfo()?.groups.as_deref()
20 }
21
22 fn extra(&self) -> Option<&BTreeMap<String, Vec<String>>> {
23 self.userinfo()?.extra.as_ref()
24 }
25}
26
27impl SelfSubjectReviewGetExt for authenticationv1::SelfSubjectReview {
28 fn status(&self) -> Option<&authenticationv1::SelfSubjectReviewStatus> {
29 self.status.as_ref()
30 }
31}