k8s_pb/api/flowcontrol/v1beta1/mod.rs
1// This file is @generated by prost-build.
2/// ExemptPriorityLevelConfiguration describes the configurable aspects
3/// of the handling of exempt requests.
4/// In the mandatory exempt configuration object the values in the fields
5/// here can be modified by authorized users, unlike the rest of the `spec`.
6#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7pub struct ExemptPriorityLevelConfiguration {
8 /// `nominalConcurrencyShares` (NCS) contributes to the computation of the
9 /// NominalConcurrencyLimit (NominalCL) of this level.
10 /// This is the number of execution seats nominally reserved for this priority level.
11 /// This DOES NOT limit the dispatching from this priority level
12 /// but affects the other priority levels through the borrowing mechanism.
13 /// The server's concurrency limit (ServerCL) is divided among all the
14 /// priority levels in proportion to their NCS values:
15 ///
16 /// NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs )
17 /// sum_ncs = sum\[priority level k\] NCS(k)
18 ///
19 /// Bigger numbers mean a larger nominal concurrency limit,
20 /// at the expense of every other priority level.
21 /// This field has a default value of zero.
22 /// +optional
23 #[prost(int32, optional, tag = "1")]
24 pub nominal_concurrency_shares: ::core::option::Option<i32>,
25 /// `lendablePercent` prescribes the fraction of the level's NominalCL that
26 /// can be borrowed by other priority levels. This value of this
27 /// field must be between 0 and 100, inclusive, and it defaults to 0.
28 /// The number of seats that other levels can borrow from this level, known
29 /// as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.
30 ///
31 /// LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )
32 ///
33 /// +optional
34 #[prost(int32, optional, tag = "2")]
35 pub lendable_percent: ::core::option::Option<i32>,
36}
37/// FlowDistinguisherMethod specifies the method of a flow distinguisher.
38#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
39pub struct FlowDistinguisherMethod {
40 /// `type` is the type of flow distinguisher method
41 /// The supported types are "ByUser" and "ByNamespace".
42 /// Required.
43 #[prost(string, optional, tag = "1")]
44 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
45}
46/// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with
47/// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher".
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct FlowSchema {
50 /// `metadata` is the standard object's metadata.
51 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
52 /// +optional
53 #[prost(message, optional, tag = "1")]
54 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
55 /// `spec` is the specification of the desired behavior of a FlowSchema.
56 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
57 /// +optional
58 #[prost(message, optional, tag = "2")]
59 pub spec: ::core::option::Option<FlowSchemaSpec>,
60 /// `status` is the current status of a FlowSchema.
61 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
62 /// +optional
63 #[prost(message, optional, tag = "3")]
64 pub status: ::core::option::Option<FlowSchemaStatus>,
65}
66/// FlowSchemaCondition describes conditions for a FlowSchema.
67#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
68pub struct FlowSchemaCondition {
69 /// `type` is the type of the condition.
70 /// Required.
71 #[prost(string, optional, tag = "1")]
72 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
73 /// `status` is the status of the condition.
74 /// Can be True, False, Unknown.
75 /// Required.
76 #[prost(string, optional, tag = "2")]
77 pub status: ::core::option::Option<::prost::alloc::string::String>,
78 /// `lastTransitionTime` is the last time the condition transitioned from one status to another.
79 #[prost(message, optional, tag = "3")]
80 pub last_transition_time:
81 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
82 /// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
83 #[prost(string, optional, tag = "4")]
84 pub reason: ::core::option::Option<::prost::alloc::string::String>,
85 /// `message` is a human-readable message indicating details about last transition.
86 #[prost(string, optional, tag = "5")]
87 pub message: ::core::option::Option<::prost::alloc::string::String>,
88}
89/// FlowSchemaList is a list of FlowSchema objects.
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct FlowSchemaList {
92 /// `metadata` is the standard list metadata.
93 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
94 /// +optional
95 #[prost(message, optional, tag = "1")]
96 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
97 /// `items` is a list of FlowSchemas.
98 #[prost(message, repeated, tag = "2")]
99 pub items: ::prost::alloc::vec::Vec<FlowSchema>,
100}
101/// FlowSchemaSpec describes how the FlowSchema's specification looks like.
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct FlowSchemaSpec {
104 /// `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot
105 /// be resolved, the FlowSchema will be ignored and marked as invalid in its status.
106 /// Required.
107 #[prost(message, optional, tag = "1")]
108 pub priority_level_configuration: ::core::option::Option<PriorityLevelConfigurationReference>,
109 /// `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen
110 /// FlowSchema is among those with the numerically lowest (which we take to be logically highest)
111 /// MatchingPrecedence. Each MatchingPrecedence value must be ranged in \[1,10000\].
112 /// Note that if the precedence is not specified, it will be set to 1000 as default.
113 /// +optional
114 #[prost(int32, optional, tag = "2")]
115 pub matching_precedence: ::core::option::Option<i32>,
116 /// `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema.
117 /// `nil` specifies that the distinguisher is disabled and thus will always be the empty string.
118 /// +optional
119 #[prost(message, optional, tag = "3")]
120 pub distinguisher_method: ::core::option::Option<FlowDistinguisherMethod>,
121 /// `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if
122 /// at least one member of rules matches the request.
123 /// if it is an empty slice, there will be no requests matching the FlowSchema.
124 /// +listType=atomic
125 /// +optional
126 #[prost(message, repeated, tag = "4")]
127 pub rules: ::prost::alloc::vec::Vec<PolicyRulesWithSubjects>,
128}
129/// FlowSchemaStatus represents the current state of a FlowSchema.
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct FlowSchemaStatus {
132 /// `conditions` is a list of the current states of FlowSchema.
133 /// +listType=map
134 /// +listMapKey=type
135 /// +optional
136 #[prost(message, repeated, tag = "1")]
137 pub conditions: ::prost::alloc::vec::Vec<FlowSchemaCondition>,
138}
139/// GroupSubject holds detailed information for group-kind subject.
140#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
141pub struct GroupSubject {
142 /// name is the user group that matches, or "*" to match all user groups.
143 /// See <https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go> for some
144 /// well-known group names.
145 /// Required.
146 #[prost(string, optional, tag = "1")]
147 pub name: ::core::option::Option<::prost::alloc::string::String>,
148}
149/// LimitResponse defines how to handle requests that can not be executed right now.
150/// +union
151#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
152pub struct LimitResponse {
153 /// `type` is "Queue" or "Reject".
154 /// "Queue" means that requests that can not be executed upon arrival
155 /// are held in a queue until they can be executed or a queuing limit
156 /// is reached.
157 /// "Reject" means that requests that can not be executed upon arrival
158 /// are rejected.
159 /// Required.
160 /// +unionDiscriminator
161 #[prost(string, optional, tag = "1")]
162 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
163 /// `queuing` holds the configuration parameters for queuing.
164 /// This field may be non-empty only if `type` is `"Queue"`.
165 /// +optional
166 #[prost(message, optional, tag = "2")]
167 pub queuing: ::core::option::Option<QueuingConfiguration>,
168}
169/// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits.
170/// It addresses two issues:
171/// - How are requests for this priority level limited?
172/// - What should be done with requests that exceed the limit?
173#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
174pub struct LimitedPriorityLevelConfiguration {
175 /// `assuredConcurrencyShares` (ACS) configures the execution
176 /// limit, which is a limit on the number of requests of this
177 /// priority level that may be executing at a given time. ACS must
178 /// be a positive number. The server's concurrency limit (SCL) is
179 /// divided among the concurrency-controlled priority levels in
180 /// proportion to their assured concurrency shares. This produces
181 /// the assured concurrency value (ACV) --- the number of requests
182 /// that may be executing at a time --- for each such priority
183 /// level:
184 ///
185 /// ACV(l) = ceil( SCL * ACS(l) / ( sum\[priority levels k\] ACS(k) ) )
186 ///
187 /// bigger numbers of ACS mean more reserved concurrent requests (at the
188 /// expense of every other PL).
189 /// This field has a default value of 30.
190 /// +optional
191 #[prost(int32, optional, tag = "1")]
192 pub assured_concurrency_shares: ::core::option::Option<i32>,
193 /// `limitResponse` indicates what to do with requests that can not be executed right now
194 #[prost(message, optional, tag = "2")]
195 pub limit_response: ::core::option::Option<LimitResponse>,
196 /// `lendablePercent` prescribes the fraction of the level's NominalCL that
197 /// can be borrowed by other priority levels. The value of this
198 /// field must be between 0 and 100, inclusive, and it defaults to 0.
199 /// The number of seats that other levels can borrow from this level, known
200 /// as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.
201 ///
202 /// LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )
203 ///
204 /// +optional
205 #[prost(int32, optional, tag = "3")]
206 pub lendable_percent: ::core::option::Option<i32>,
207 /// `borrowingLimitPercent`, if present, configures a limit on how many
208 /// seats this priority level can borrow from other priority levels.
209 /// The limit is known as this level's BorrowingConcurrencyLimit
210 /// (BorrowingCL) and is a limit on the total number of seats that this
211 /// level may borrow at any one time.
212 /// This field holds the ratio of that limit to the level's nominal
213 /// concurrency limit. When this field is non-nil, it must hold a
214 /// non-negative integer and the limit is calculated as follows.
215 ///
216 /// BorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )
217 ///
218 /// The value of this field can be more than 100, implying that this
219 /// priority level can borrow a number of seats that is greater than
220 /// its own nominal concurrency limit (NominalCL).
221 /// When this field is left `nil`, the limit is effectively infinite.
222 /// +optional
223 #[prost(int32, optional, tag = "4")]
224 pub borrowing_limit_percent: ::core::option::Option<i32>,
225}
226/// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the
227/// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member
228/// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.
229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
230pub struct NonResourcePolicyRule {
231 /// `verbs` is a list of matching verbs and may not be empty.
232 /// "*" matches all verbs. If it is present, it must be the only entry.
233 /// +listType=set
234 /// Required.
235 #[prost(string, repeated, tag = "1")]
236 pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
237 /// `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty.
238 /// For example:
239 /// - "/healthz" is legal
240 /// - "/hea*" is illegal
241 /// - "/hea" is legal but matches nothing
242 /// - "/hea/*" also matches nothing
243 /// - "/healthz/*" matches all per-component health checks.
244 /// "*" matches all non-resource urls. if it is present, it must be the only entry.
245 /// +listType=set
246 /// Required.
247 #[prost(string, repeated, tag = "6")]
248 pub non_resource_ur_ls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
249}
250/// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject
251/// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches
252/// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member
253/// of resourceRules or nonResourceRules matches the request.
254#[derive(Clone, PartialEq, ::prost::Message)]
255pub struct PolicyRulesWithSubjects {
256 /// subjects is the list of normal user, serviceaccount, or group that this rule cares about.
257 /// There must be at least one member in this slice.
258 /// A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request.
259 /// +listType=atomic
260 /// Required.
261 #[prost(message, repeated, tag = "1")]
262 pub subjects: ::prost::alloc::vec::Vec<Subject>,
263 /// `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the
264 /// target resource.
265 /// At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
266 /// +listType=atomic
267 /// +optional
268 #[prost(message, repeated, tag = "2")]
269 pub resource_rules: ::prost::alloc::vec::Vec<ResourcePolicyRule>,
270 /// `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb
271 /// and the target non-resource URL.
272 /// +listType=atomic
273 /// +optional
274 #[prost(message, repeated, tag = "3")]
275 pub non_resource_rules: ::prost::alloc::vec::Vec<NonResourcePolicyRule>,
276}
277/// PriorityLevelConfiguration represents the configuration of a priority level.
278#[derive(Clone, PartialEq, ::prost::Message)]
279pub struct PriorityLevelConfiguration {
280 /// `metadata` is the standard object's metadata.
281 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
282 /// +optional
283 #[prost(message, optional, tag = "1")]
284 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
285 /// `spec` is the specification of the desired behavior of a "request-priority".
286 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
287 /// +optional
288 #[prost(message, optional, tag = "2")]
289 pub spec: ::core::option::Option<PriorityLevelConfigurationSpec>,
290 /// `status` is the current status of a "request-priority".
291 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
292 /// +optional
293 #[prost(message, optional, tag = "3")]
294 pub status: ::core::option::Option<PriorityLevelConfigurationStatus>,
295}
296/// PriorityLevelConfigurationCondition defines the condition of priority level.
297#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
298pub struct PriorityLevelConfigurationCondition {
299 /// `type` is the type of the condition.
300 /// Required.
301 #[prost(string, optional, tag = "1")]
302 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
303 /// `status` is the status of the condition.
304 /// Can be True, False, Unknown.
305 /// Required.
306 #[prost(string, optional, tag = "2")]
307 pub status: ::core::option::Option<::prost::alloc::string::String>,
308 /// `lastTransitionTime` is the last time the condition transitioned from one status to another.
309 #[prost(message, optional, tag = "3")]
310 pub last_transition_time:
311 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
312 /// `reason` is a unique, one-word, CamelCase reason for the condition's last transition.
313 #[prost(string, optional, tag = "4")]
314 pub reason: ::core::option::Option<::prost::alloc::string::String>,
315 /// `message` is a human-readable message indicating details about last transition.
316 #[prost(string, optional, tag = "5")]
317 pub message: ::core::option::Option<::prost::alloc::string::String>,
318}
319/// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.
320#[derive(Clone, PartialEq, ::prost::Message)]
321pub struct PriorityLevelConfigurationList {
322 /// `metadata` is the standard object's metadata.
323 /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
324 /// +optional
325 #[prost(message, optional, tag = "1")]
326 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
327 /// `items` is a list of request-priorities.
328 #[prost(message, repeated, tag = "2")]
329 pub items: ::prost::alloc::vec::Vec<PriorityLevelConfiguration>,
330}
331/// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used.
332#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
333pub struct PriorityLevelConfigurationReference {
334 /// `name` is the name of the priority level configuration being referenced
335 /// Required.
336 #[prost(string, optional, tag = "1")]
337 pub name: ::core::option::Option<::prost::alloc::string::String>,
338}
339/// PriorityLevelConfigurationSpec specifies the configuration of a priority level.
340/// +union
341#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
342pub struct PriorityLevelConfigurationSpec {
343 /// `type` indicates whether this priority level is subject to
344 /// limitation on request execution. A value of `"Exempt"` means
345 /// that requests of this priority level are not subject to a limit
346 /// (and thus are never queued) and do not detract from the
347 /// capacity made available to other priority levels. A value of
348 /// `"Limited"` means that (a) requests of this priority level
349 /// _are_ subject to limits and (b) some of the server's limited
350 /// capacity is made available exclusively to this priority level.
351 /// Required.
352 /// +unionDiscriminator
353 #[prost(string, optional, tag = "1")]
354 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
355 /// `limited` specifies how requests are handled for a Limited priority level.
356 /// This field must be non-empty if and only if `type` is `"Limited"`.
357 /// +optional
358 #[prost(message, optional, tag = "2")]
359 pub limited: ::core::option::Option<LimitedPriorityLevelConfiguration>,
360 /// `exempt` specifies how requests are handled for an exempt priority level.
361 /// This field MUST be empty if `type` is `"Limited"`.
362 /// This field MAY be non-empty if `type` is `"Exempt"`.
363 /// If empty and `type` is `"Exempt"` then the default values
364 /// for `ExemptPriorityLevelConfiguration` apply.
365 /// +optional
366 #[prost(message, optional, tag = "3")]
367 pub exempt: ::core::option::Option<ExemptPriorityLevelConfiguration>,
368}
369/// PriorityLevelConfigurationStatus represents the current state of a "request-priority".
370#[derive(Clone, PartialEq, ::prost::Message)]
371pub struct PriorityLevelConfigurationStatus {
372 /// `conditions` is the current state of "request-priority".
373 /// +listType=map
374 /// +listMapKey=type
375 /// +optional
376 #[prost(message, repeated, tag = "1")]
377 pub conditions: ::prost::alloc::vec::Vec<PriorityLevelConfigurationCondition>,
378}
379/// QueuingConfiguration holds the configuration parameters for queuing
380#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
381pub struct QueuingConfiguration {
382 /// `queues` is the number of queues for this priority level. The
383 /// queues exist independently at each apiserver. The value must be
384 /// positive. Setting it to 1 effectively precludes
385 /// shufflesharding and thus makes the distinguisher method of
386 /// associated flow schemas irrelevant. This field has a default
387 /// value of 64.
388 /// +optional
389 #[prost(int32, optional, tag = "1")]
390 pub queues: ::core::option::Option<i32>,
391 /// `handSize` is a small positive number that configures the
392 /// shuffle sharding of requests into queues. When enqueuing a request
393 /// at this priority level the request's flow identifier (a string
394 /// pair) is hashed and the hash value is used to shuffle the list
395 /// of queues and deal a hand of the size specified here. The
396 /// request is put into one of the shortest queues in that hand.
397 /// `handSize` must be no larger than `queues`, and should be
398 /// significantly smaller (so that a few heavy flows do not
399 /// saturate most of the queues). See the user-facing
400 /// documentation for more extensive guidance on setting this
401 /// field. This field has a default value of 8.
402 /// +optional
403 #[prost(int32, optional, tag = "2")]
404 pub hand_size: ::core::option::Option<i32>,
405 /// `queueLengthLimit` is the maximum number of requests allowed to
406 /// be waiting in a given queue of this priority level at a time;
407 /// excess requests are rejected. This value must be positive. If
408 /// not specified, it will be defaulted to 50.
409 /// +optional
410 #[prost(int32, optional, tag = "3")]
411 pub queue_length_limit: ::core::option::Option<i32>,
412}
413/// ResourcePolicyRule is a predicate that matches some resource
414/// requests, testing the request's verb and the target resource. A
415/// ResourcePolicyRule matches a resource request if and only if: (a)
416/// at least one member of verbs matches the request, (b) at least one
417/// member of apiGroups matches the request, (c) at least one member of
418/// resources matches the request, and (d) either (d1) the request does
419/// not specify a namespace (i.e., `Namespace==""`) and clusterScope is
420/// true or (d2) the request specifies a namespace and least one member
421/// of namespaces matches the request's namespace.
422#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
423pub struct ResourcePolicyRule {
424 /// `verbs` is a list of matching verbs and may not be empty.
425 /// "*" matches all verbs and, if present, must be the only entry.
426 /// +listType=set
427 /// Required.
428 #[prost(string, repeated, tag = "1")]
429 pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
430 /// `apiGroups` is a list of matching API groups and may not be empty.
431 /// "*" matches all API groups and, if present, must be the only entry.
432 /// +listType=set
433 /// Required.
434 #[prost(string, repeated, tag = "2")]
435 pub api_groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
436 /// `resources` is a list of matching resources (i.e., lowercase
437 /// and plural) with, if desired, subresource. For example, [
438 /// "services", "nodes/status" ]. This list may not be empty.
439 /// "*" matches all resources and, if present, must be the only entry.
440 /// Required.
441 /// +listType=set
442 #[prost(string, repeated, tag = "3")]
443 pub resources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
444 /// `clusterScope` indicates whether to match requests that do not
445 /// specify a namespace (which happens either because the resource
446 /// is not namespaced or the request targets all namespaces).
447 /// If this field is omitted or false then the `namespaces` field
448 /// must contain a non-empty list.
449 /// +optional
450 #[prost(bool, optional, tag = "4")]
451 pub cluster_scope: ::core::option::Option<bool>,
452 /// `namespaces` is a list of target namespaces that restricts
453 /// matches. A request that specifies a target namespace matches
454 /// only if either (a) this list contains that target namespace or
455 /// (b) this list contains "*". Note that "*" matches any
456 /// specified namespace but does not match a request that _does
457 /// not specify_ a namespace (see the `clusterScope` field for
458 /// that).
459 /// This list may be empty, but only if `clusterScope` is true.
460 /// +optional
461 /// +listType=set
462 #[prost(string, repeated, tag = "5")]
463 pub namespaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
464}
465/// ServiceAccountSubject holds detailed information for service-account-kind subject.
466#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
467pub struct ServiceAccountSubject {
468 /// `namespace` is the namespace of matching ServiceAccount objects.
469 /// Required.
470 #[prost(string, optional, tag = "1")]
471 pub namespace: ::core::option::Option<::prost::alloc::string::String>,
472 /// `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name.
473 /// Required.
474 #[prost(string, optional, tag = "2")]
475 pub name: ::core::option::Option<::prost::alloc::string::String>,
476}
477/// Subject matches the originator of a request, as identified by the request authentication system. There are three
478/// ways of matching an originator; by user, group, or service account.
479/// +union
480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
481pub struct Subject {
482 /// `kind` indicates which one of the other fields is non-empty.
483 /// Required
484 /// +unionDiscriminator
485 #[prost(string, optional, tag = "1")]
486 pub kind: ::core::option::Option<::prost::alloc::string::String>,
487 /// `user` matches based on username.
488 /// +optional
489 #[prost(message, optional, tag = "2")]
490 pub user: ::core::option::Option<UserSubject>,
491 /// `group` matches based on user group name.
492 /// +optional
493 #[prost(message, optional, tag = "3")]
494 pub group: ::core::option::Option<GroupSubject>,
495 /// `serviceAccount` matches ServiceAccounts.
496 /// +optional
497 #[prost(message, optional, tag = "4")]
498 pub service_account: ::core::option::Option<ServiceAccountSubject>,
499}
500/// UserSubject holds detailed information for user-kind subject.
501#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
502pub struct UserSubject {
503 /// `name` is the username that matches, or "*" to match all usernames.
504 /// Required.
505 #[prost(string, optional, tag = "1")]
506 pub name: ::core::option::Option<::prost::alloc::string::String>,
507}