-
Notifications
You must be signed in to change notification settings - Fork 0
/
delegation.pb.go
323 lines (289 loc) · 12.2 KB
/
delegation.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: go.chromium.org/luci/server/auth/delegation/messages/delegation.proto
package messages
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Subtoken_Kind int32
const (
// This is to catch old tokens that don't have 'kind' field yet.
//
// Tokens of this kind are interpreted as 'BEARER_DELEGATION_TOKEN' for now,
// for compatibility. But eventually (when all backends are updated), they
// will become invalid (and there will be no way to generate them). This is
// needed to avoid old servers accidentally interpret tokens of kind != 0 as
// BEARER_DELEGATION_TOKEN tokens.
Subtoken_UNKNOWN_KIND Subtoken_Kind = 0
// The token of this kind can be sent in X-Delegation-Token-V1 HTTP header.
// The services will check all restrictions of the token, and will
// authenticate requests as coming from 'delegated_identity'.
Subtoken_BEARER_DELEGATION_TOKEN Subtoken_Kind = 1
)
var Subtoken_Kind_name = map[int32]string{
0: "UNKNOWN_KIND",
1: "BEARER_DELEGATION_TOKEN",
}
var Subtoken_Kind_value = map[string]int32{
"UNKNOWN_KIND": 0,
"BEARER_DELEGATION_TOKEN": 1,
}
func (x Subtoken_Kind) String() string {
return proto.EnumName(Subtoken_Kind_name, int32(x))
}
func (Subtoken_Kind) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_67dd1eacea24f38c, []int{1, 0}
}
// Signed serialized Subtoken.
//
// This message is just an envelope that carries the serialized Subtoken message
// and its signature.
//
// Next ID: 6.
type DelegationToken struct {
// Identity of a service that signed this token.
//
// It can be a 'service:<app-id>' string or 'user:<service-account-email>'
// string.
//
// In both cases the appropriate certificate store will be queried (via SSL)
// for the public key to use for signature verification.
SignerId string `protobuf:"bytes,2,opt,name=signer_id,json=signerId,proto3" json:"signer_id,omitempty"`
// ID of a key used for making the signature.
//
// There can be multiple active keys at any moment in time: one used for new
// signatures, and one being rotated out (but still valid for verification).
//
// The lifetime of the token indirectly depends on the lifetime of the signing
// key, which is 24h. So delegation tokens can't live longer than 24h.
SigningKeyId string `protobuf:"bytes,3,opt,name=signing_key_id,json=signingKeyId,proto3" json:"signing_key_id,omitempty"`
// The signature: PKCS1_v1_5+SHA256(serialized_subtoken, signing_key_id).
Pkcs1Sha256Sig []byte `protobuf:"bytes,4,opt,name=pkcs1_sha256_sig,json=pkcs1Sha256Sig,proto3" json:"pkcs1_sha256_sig,omitempty"`
// Serialized Subtoken message. It's signature is stored in pkcs1_sha256_sig.
SerializedSubtoken []byte `protobuf:"bytes,5,opt,name=serialized_subtoken,json=serializedSubtoken,proto3" json:"serialized_subtoken,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DelegationToken) Reset() { *m = DelegationToken{} }
func (m *DelegationToken) String() string { return proto.CompactTextString(m) }
func (*DelegationToken) ProtoMessage() {}
func (*DelegationToken) Descriptor() ([]byte, []int) {
return fileDescriptor_67dd1eacea24f38c, []int{0}
}
func (m *DelegationToken) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DelegationToken.Unmarshal(m, b)
}
func (m *DelegationToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DelegationToken.Marshal(b, m, deterministic)
}
func (m *DelegationToken) XXX_Merge(src proto.Message) {
xxx_messageInfo_DelegationToken.Merge(m, src)
}
func (m *DelegationToken) XXX_Size() int {
return xxx_messageInfo_DelegationToken.Size(m)
}
func (m *DelegationToken) XXX_DiscardUnknown() {
xxx_messageInfo_DelegationToken.DiscardUnknown(m)
}
var xxx_messageInfo_DelegationToken proto.InternalMessageInfo
func (m *DelegationToken) GetSignerId() string {
if m != nil {
return m.SignerId
}
return ""
}
func (m *DelegationToken) GetSigningKeyId() string {
if m != nil {
return m.SigningKeyId
}
return ""
}
func (m *DelegationToken) GetPkcs1Sha256Sig() []byte {
if m != nil {
return m.Pkcs1Sha256Sig
}
return nil
}
func (m *DelegationToken) GetSerializedSubtoken() []byte {
if m != nil {
return m.SerializedSubtoken
}
return nil
}
// Identifies who delegates what authority to whom where.
//
// Next ID: 10.
type Subtoken struct {
// What kind of token is this.
//
// Defines how it can be used. See comments for Kind enum.
Kind Subtoken_Kind `protobuf:"varint,8,opt,name=kind,proto3,enum=messages.Subtoken_Kind" json:"kind,omitempty"`
// Identifier of this subtoken as generated by the token server.
//
// Used for logging and tracking purposes.
SubtokenId int64 `protobuf:"varint,4,opt,name=subtoken_id,json=subtokenId,proto3" json:"subtoken_id,omitempty"`
// Identity whose authority is delegated.
//
// A string of the form "user:<email>".
DelegatedIdentity string `protobuf:"bytes,1,opt,name=delegated_identity,json=delegatedIdentity,proto3" json:"delegated_identity,omitempty"`
// Who requested this token.
//
// This can match delegated_identity if the user is delegating their own
// identity or it can be a different id if the token is actually
// an impersonation token.
RequestorIdentity string `protobuf:"bytes,7,opt,name=requestor_identity,json=requestorIdentity,proto3" json:"requestor_identity,omitempty"`
// When the token was generated (and when it becomes valid).
//
// Number of seconds since epoch (Unix timestamp).
CreationTime int64 `protobuf:"varint,2,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
// How long the token is considered valid (in seconds).
ValidityDuration int32 `protobuf:"varint,3,opt,name=validity_duration,json=validityDuration,proto3" json:"validity_duration,omitempty"`
// Who can present this token.
//
// Each item can be an identity string (e.g. "user:<email>"), a "group:<name>"
// string, or special "*" string which means "Any bearer can use the token".
Audience []string `protobuf:"bytes,5,rep,name=audience,proto3" json:"audience,omitempty"`
// What services should accept this token.
//
// List of services (specified as service identities, e.g. "service:app-id")
// that should accept this token. May also contain special "*" string, which
// means "All services".
Services []string `protobuf:"bytes,6,rep,name=services,proto3" json:"services,omitempty"`
// Arbitrary key:value pairs embedded into the token by whoever requested it.
// Convey circumstance of why the token is created.
//
// Services that accept the token may use them for additional authorization
// decisions. Please use extremely carefully, only when you control both sides
// of the delegation link and can guarantee that services involved understand
// the tags.
Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Subtoken) Reset() { *m = Subtoken{} }
func (m *Subtoken) String() string { return proto.CompactTextString(m) }
func (*Subtoken) ProtoMessage() {}
func (*Subtoken) Descriptor() ([]byte, []int) {
return fileDescriptor_67dd1eacea24f38c, []int{1}
}
func (m *Subtoken) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Subtoken.Unmarshal(m, b)
}
func (m *Subtoken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Subtoken.Marshal(b, m, deterministic)
}
func (m *Subtoken) XXX_Merge(src proto.Message) {
xxx_messageInfo_Subtoken.Merge(m, src)
}
func (m *Subtoken) XXX_Size() int {
return xxx_messageInfo_Subtoken.Size(m)
}
func (m *Subtoken) XXX_DiscardUnknown() {
xxx_messageInfo_Subtoken.DiscardUnknown(m)
}
var xxx_messageInfo_Subtoken proto.InternalMessageInfo
func (m *Subtoken) GetKind() Subtoken_Kind {
if m != nil {
return m.Kind
}
return Subtoken_UNKNOWN_KIND
}
func (m *Subtoken) GetSubtokenId() int64 {
if m != nil {
return m.SubtokenId
}
return 0
}
func (m *Subtoken) GetDelegatedIdentity() string {
if m != nil {
return m.DelegatedIdentity
}
return ""
}
func (m *Subtoken) GetRequestorIdentity() string {
if m != nil {
return m.RequestorIdentity
}
return ""
}
func (m *Subtoken) GetCreationTime() int64 {
if m != nil {
return m.CreationTime
}
return 0
}
func (m *Subtoken) GetValidityDuration() int32 {
if m != nil {
return m.ValidityDuration
}
return 0
}
func (m *Subtoken) GetAudience() []string {
if m != nil {
return m.Audience
}
return nil
}
func (m *Subtoken) GetServices() []string {
if m != nil {
return m.Services
}
return nil
}
func (m *Subtoken) GetTags() []string {
if m != nil {
return m.Tags
}
return nil
}
func init() {
proto.RegisterEnum("messages.Subtoken_Kind", Subtoken_Kind_name, Subtoken_Kind_value)
proto.RegisterType((*DelegationToken)(nil), "messages.DelegationToken")
proto.RegisterType((*Subtoken)(nil), "messages.Subtoken")
}
func init() {
proto.RegisterFile("github.com/TriggerMail/luci-go/server/auth/delegation/messages/delegation.proto", fileDescriptor_67dd1eacea24f38c)
}
var fileDescriptor_67dd1eacea24f38c = []byte{
// 439 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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