blob: b69636a814dd8d61f1e80e11a7cab257a1d3dfba [file] [log] [blame]
sslobodrd046be82019-01-16 10:02:22 -05001/*
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.authentication.v1;
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 = "v1";
30
31// BoundObjectReference is a reference to an object that a token is bound to.
32message BoundObjectReference {
33 // Kind of the referent. Valid kinds are 'Pod' and 'Secret'.
34 // +optional
35 optional string kind = 1;
36
37 // API version of the referent.
38 // +optional
39 optional string aPIVersion = 2;
40
41 // Name of the referent.
42 // +optional
43 optional string name = 3;
44
45 // UID of the referent.
46 // +optional
47 optional string uID = 4;
48}
49
50// ExtraValue masks the value so protobuf can generate
51// +protobuf.nullable=true
52// +protobuf.options.(gogoproto.goproto_stringer)=false
53message ExtraValue {
54 // items, if empty, will result in an empty slice
55
56 repeated string items = 1;
57}
58
59// TokenRequest requests a token for a given service account.
60message TokenRequest {
61 // +optional
62 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
63
64 optional TokenRequestSpec spec = 2;
65
66 // +optional
67 optional TokenRequestStatus status = 3;
68}
69
70// TokenRequestSpec contains client provided parameters of a token request.
71message 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;
79
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.
83 // +optional
84 optional int64 expirationSeconds = 4;
85
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.
88 // +optional
89 optional BoundObjectReference boundObjectRef = 3;
90}
91
92// TokenRequestStatus is the result of a token request.
93message TokenRequestStatus {
94 // Token is the opaque bearer token.
95 optional string token = 1;
96
97 // ExpirationTimestamp is the time of expiration of the returned token.
98 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time expirationTimestamp = 2;
99}
100
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.
104message TokenReview {
105 // +optional
106 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
107
108 // Spec holds information about the request being evaluated
109 optional TokenReviewSpec spec = 2;
110
111 // Status is filled in by the server and indicates whether the request can be authenticated.
112 // +optional
113 optional TokenReviewStatus status = 3;
114}
115
116// TokenReviewSpec is a description of the token authentication request.
117message TokenReviewSpec {
118 // Token is the opaque bearer token.
119 // +optional
120 optional string token = 1;
121
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.
127 // +optional
128 repeated string audiences = 2;
129}
130
131// TokenReviewStatus is the result of the token authentication request.
132message TokenReviewStatus {
133 // Authenticated indicates that the token was associated with a known user.
134 // +optional
135 optional bool authenticated = 1;
136
137 // User is the UserInfo associated with the provided token.
138 // +optional
139 optional UserInfo user = 2;
140
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.
150 // +optional
151 repeated string audiences = 4;
152
153 // Error indicates that the token couldn't be checked
154 // +optional
155 optional string error = 3;
156}
157
158// UserInfo holds the information about the user needed to implement the
159// user.Info interface.
160message UserInfo {
161 // The name that uniquely identifies this user among all active users.
162 // +optional
163 optional string username = 1;
164
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
167 // different UIDs.
168 // +optional
169 optional string uid = 2;
170
171 // The names of groups this user is a part of.
172 // +optional
173 repeated string groups = 3;
174
175 // Any additional information provided by the authenticator.
176 // +optional
177 map<string, ExtraValue> extra = 4;
178}
179