blob: 60354e6a6f1cce42596bee46218a746794774e05 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.api.rbac.v1alpha1;
23
24import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/runtime/generated.proto";
26import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
27
28// Package-wide variables from generator "generated".
29option go_package = "v1alpha1";
30
31// AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole
32message AggregationRule {
33 // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules.
34 // If any of the selectors match, then the ClusterRole's permissions will be added
35 // +optional
36 repeated k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector clusterRoleSelectors = 1;
37}
38
39// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
40// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22.
41message ClusterRole {
42 // Standard object's metadata.
43 // +optional
44 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
45
46 // Rules holds all the PolicyRules for this ClusterRole
47 // +optional
48 repeated PolicyRule rules = 2;
49
50 // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole.
51 // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be
52 // stomped by the controller.
53 // +optional
54 optional AggregationRule aggregationRule = 3;
55}
56
57// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace,
58// and adds who information via Subject.
59// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22.
60message ClusterRoleBinding {
61 // Standard object's metadata.
62 // +optional
63 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
64
65 // Subjects holds references to the objects the role applies to.
66 // +optional
67 repeated Subject subjects = 2;
68
69 // RoleRef can only reference a ClusterRole in the global namespace.
70 // If the RoleRef cannot be resolved, the Authorizer must return an error.
71 optional RoleRef roleRef = 3;
72}
73
74// ClusterRoleBindingList is a collection of ClusterRoleBindings.
75// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will no longer be served in v1.22.
76message ClusterRoleBindingList {
77 // Standard object's metadata.
78 // +optional
79 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
80
81 // Items is a list of ClusterRoleBindings
82 repeated ClusterRoleBinding items = 2;
83}
84
85// ClusterRoleList is a collection of ClusterRoles.
86// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22.
87message ClusterRoleList {
88 // Standard object's metadata.
89 // +optional
90 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
91
92 // Items is a list of ClusterRoles
93 repeated ClusterRole items = 2;
94}
95
96// PolicyRule holds information that describes a policy rule, but does not contain information
97// about who the rule applies to or which namespace the rule applies to.
98message PolicyRule {
99 // Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.
100 repeated string verbs = 1;
101
102 // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
103 // the enumerated resources in any API group will be allowed.
104 // +optional
105 repeated string apiGroups = 3;
106
107 // Resources is a list of resources this rule applies to. ResourceAll represents all resources.
108 // +optional
109 repeated string resources = 4;
110
111 // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
112 // +optional
113 repeated string resourceNames = 5;
114
115 // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path
116 // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding.
117 // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both.
118 // +optional
119 repeated string nonResourceURLs = 6;
120}
121
122// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
123// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22.
124message Role {
125 // Standard object's metadata.
126 // +optional
127 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
128
129 // Rules holds all the PolicyRules for this Role
130 // +optional
131 repeated PolicyRule rules = 2;
132}
133
134// RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace.
135// It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given
136// namespace only have effect in that namespace.
137// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22.
138message RoleBinding {
139 // Standard object's metadata.
140 // +optional
141 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
142
143 // Subjects holds references to the objects the role applies to.
144 // +optional
145 repeated Subject subjects = 2;
146
147 // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace.
148 // If the RoleRef cannot be resolved, the Authorizer must return an error.
149 optional RoleRef roleRef = 3;
150}
151
152// RoleBindingList is a collection of RoleBindings
153// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22.
154message RoleBindingList {
155 // Standard object's metadata.
156 // +optional
157 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
158
159 // Items is a list of RoleBindings
160 repeated RoleBinding items = 2;
161}
162
163// RoleList is a collection of Roles.
164// Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22.
165message RoleList {
166 // Standard object's metadata.
167 // +optional
168 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
169
170 // Items is a list of Roles
171 repeated Role items = 2;
172}
173
174// RoleRef contains information that points to the role being used
175message RoleRef {
176 // APIGroup is the group for the resource being referenced
177 optional string apiGroup = 1;
178
179 // Kind is the type of resource being referenced
180 optional string kind = 2;
181
182 // Name is the name of resource being referenced
183 optional string name = 3;
184}
185
186// Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference,
187// or a value for non-objects such as user and group names.
188message Subject {
189 // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount".
190 // If the Authorizer does not recognized the kind value, the Authorizer should report an error.
191 optional string kind = 1;
192
193 // APIVersion holds the API group and version of the referenced subject.
194 // Defaults to "v1" for ServiceAccount subjects.
195 // Defaults to "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects.
196 // +k8s:conversion-gen=false
197 // +optional
198 optional string apiVersion = 2;
199
200 // Name of the object being referenced.
201 optional string name = 3;
202
203 // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty
204 // the Authorizer should report an error.
205 // +optional
206 optional string namespace = 4;
207}
208