1 /* 2 Copyright 2022 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package v1alpha1 18 19 import ( 20 v1 "k8s.io/api/authentication/v1" 21 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 ) 23 24 // +genclient 25 // +genclient:nonNamespaced 26 // +genclient:onlyVerbs=create 27 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 28 // +k8s:prerelease-lifecycle-gen:introduced=1.26 29 30 // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. 31 // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or 32 // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. 33 type SelfSubjectReview struct { 34 metav1.TypeMeta `json:",inline"` 35 // Standard object's metadata. 36 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 37 // +optional 38 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 39 // Status is filled in by the server with the user attributes. 40 Status SelfSubjectReviewStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` 41 } 42 43 // SelfSubjectReviewStatus is filled by the kube-apiserver and sent back to a user. 44 type SelfSubjectReviewStatus struct { 45 // User attributes of the user making this request. 46 // +optional 47 UserInfo v1.UserInfo `json:"userInfo,omitempty" protobuf:"bytes,1,opt,name=userInfo"` 48 } 49