2 Copyright The Kubernetes Authors.
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
18 // This file was autogenerated by go-to-protobuf. Do not edit it manually!
22 package k8s.io.api.authentication.v1;
24 import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
25 import "k8s.io/apimachinery/pkg/runtime/generated.proto";
26 import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28 // Package-wide variables from generator "generated".
29 option go_package = "v1";
31 // BoundObjectReference is a reference to an object that a token is bound to.
32 message BoundObjectReference {
33 // Kind of the referent. Valid kinds are 'Pod' and 'Secret'.
35 optional string kind = 1;
37 // API version of the referent.
39 optional string aPIVersion = 2;
41 // Name of the referent.
43 optional string name = 3;
45 // UID of the referent.
47 optional string uID = 4;
50 // ExtraValue masks the value so protobuf can generate
51 // +protobuf.nullable=true
52 // +protobuf.options.(gogoproto.goproto_stringer)=false
54 // items, if empty, will result in an empty slice
56 repeated string items = 1;
59 // TokenRequest requests a token for a given service account.
60 message TokenRequest {
62 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
64 optional TokenRequestSpec spec = 2;
67 optional TokenRequestStatus status = 3;
70 // TokenRequestSpec contains client provided parameters of a token request.
71 message TokenRequestSpec {
72 // Audiences are the intendend audiences of the token. A recipient of a
73 // token must identitfy themself with an identifier in the list of
74 // audiences of the token, and otherwise should reject the token. A
75 // token issued for multiple audiences may be used to authenticate
76 // against any of the audiences listed but implies a high degree of
77 // trust between the target audiences.
78 repeated string audiences = 1;
80 // ExpirationSeconds is the requested duration of validity of the request. The
81 // token issuer may return a token with a different validity duration so a
82 // client needs to check the 'expiration' field in a response.
84 optional int64 expirationSeconds = 4;
86 // BoundObjectRef is a reference to an object that the token will be bound to.
87 // The token will only be valid for as long as the bound objet exists.
89 optional BoundObjectReference boundObjectRef = 3;
92 // TokenRequestStatus is the result of a token request.
93 message TokenRequestStatus {
94 // Token is the opaque bearer token.
95 optional string token = 1;
97 // ExpirationTimestamp is the time of expiration of the returned token.
98 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2;
101 // TokenReview attempts to authenticate a token to a known user.
102 // Note: TokenReview requests may be cached by the webhook token authenticator
103 // plugin in the kube-apiserver.
104 message TokenReview {
106 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
108 // Spec holds information about the request being evaluated
109 optional TokenReviewSpec spec = 2;
111 // Status is filled in by the server and indicates whether the request can be authenticated.
113 optional TokenReviewStatus status = 3;
116 // TokenReviewSpec is a description of the token authentication request.
117 message TokenReviewSpec {
118 // Token is the opaque bearer token.
120 optional string token = 1;
122 // Audiences is a list of the identifiers that the resource server presented
123 // with the token identifies as. Audience-aware token authenticators will
124 // verify that the token was intended for at least one of the audiences in
125 // this list. If no audiences are provided, the audience will default to the
126 // audience of the Kubernetes apiserver.
128 repeated string audiences = 2;
131 // TokenReviewStatus is the result of the token authentication request.
132 message TokenReviewStatus {
133 // Authenticated indicates that the token was associated with a known user.
135 optional bool authenticated = 1;
137 // User is the UserInfo associated with the provided token.
139 optional UserInfo user = 2;
141 // Audiences are audience identifiers chosen by the authenticator that are
142 // compatible with both the TokenReview and token. An identifier is any
143 // identifier in the intersection of the TokenReviewSpec audiences and the
144 // token's audiences. A client of the TokenReview API that sets the
145 // spec.audiences field should validate that a compatible audience identifier
146 // is returned in the status.audiences field to ensure that the TokenReview
147 // server is audience aware. If a TokenReview returns an empty
148 // status.audience field where status.authenticated is "true", the token is
149 // valid against the audience of the Kubernetes API server.
151 repeated string audiences = 4;
153 // Error indicates that the token couldn't be checked
155 optional string error = 3;
158 // UserInfo holds the information about the user needed to implement the
159 // user.Info interface.
161 // The name that uniquely identifies this user among all active users.
163 optional string username = 1;
165 // A unique value that identifies this user across time. If this user is
166 // deleted and another user by the same name is added, they will have
169 optional string uid = 2;
171 // The names of groups this user is a part of.
173 repeated string groups = 3;
175 // Any additional information provided by the authenticator.
177 map<string, ExtraValue> extra = 4;