go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/buildbucket/proto/token.pb.go (about) 1 // Copyright 2022 The LUCI Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by protoc-gen-go. DO NOT EDIT. 16 // versions: 17 // protoc-gen-go v1.32.0 18 // protoc v3.21.7 19 // source: go.chromium.org/luci/buildbucket/proto/token.proto 20 21 package buildbucketpb 22 23 import ( 24 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 25 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 26 reflect "reflect" 27 sync "sync" 28 ) 29 30 const ( 31 // Verify that this generated code is sufficiently up-to-date. 32 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 33 // Verify that runtime/protoimpl is sufficiently up-to-date. 34 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 35 ) 36 37 // Possible purposes of the token. 38 type TokenBody_Purpose int32 39 40 const ( 41 // The default value. This value is used if purpose is omitted. 42 TokenBody_PURPOSE_UNSPECIFIED TokenBody_Purpose = 0 43 // The token is a token for updating a build. 44 TokenBody_BUILD TokenBody_Purpose = 1 45 // The token is a token for updating a backend task. DO NOT USE. DEPRECATED. 46 // 47 // Deprecated: Marked as deprecated in go.chromium.org/luci/buildbucket/proto/token.proto. 48 TokenBody_TASK TokenBody_Purpose = 2 49 // The token is a token for starting a build. 50 TokenBody_START_BUILD TokenBody_Purpose = 3 51 // The token is a token for starting and registering a backend task with the 52 // build it runs. 53 TokenBody_START_BUILD_TASK TokenBody_Purpose = 4 54 ) 55 56 // Enum value maps for TokenBody_Purpose. 57 var ( 58 TokenBody_Purpose_name = map[int32]string{ 59 0: "PURPOSE_UNSPECIFIED", 60 1: "BUILD", 61 2: "TASK", 62 3: "START_BUILD", 63 4: "START_BUILD_TASK", 64 } 65 TokenBody_Purpose_value = map[string]int32{ 66 "PURPOSE_UNSPECIFIED": 0, 67 "BUILD": 1, 68 "TASK": 2, 69 "START_BUILD": 3, 70 "START_BUILD_TASK": 4, 71 } 72 ) 73 74 func (x TokenBody_Purpose) Enum() *TokenBody_Purpose { 75 p := new(TokenBody_Purpose) 76 *p = x 77 return p 78 } 79 80 func (x TokenBody_Purpose) String() string { 81 return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 82 } 83 84 func (TokenBody_Purpose) Descriptor() protoreflect.EnumDescriptor { 85 return file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[0].Descriptor() 86 } 87 88 func (TokenBody_Purpose) Type() protoreflect.EnumType { 89 return &file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[0] 90 } 91 92 func (x TokenBody_Purpose) Number() protoreflect.EnumNumber { 93 return protoreflect.EnumNumber(x) 94 } 95 96 // Deprecated: Use TokenBody_Purpose.Descriptor instead. 97 func (TokenBody_Purpose) EnumDescriptor() ([]byte, []int) { 98 return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{0, 0} 99 } 100 101 // Possible version of the token. 102 type TokenEnvelope_Version int32 103 104 const ( 105 // The default value. This value is used if version is omitted. 106 TokenEnvelope_VERSION_UNSPECIFIED TokenEnvelope_Version = 0 107 // The token is saved in model.Build like a password. 108 TokenEnvelope_UNENCRYPTED_PASSWORD_LIKE TokenEnvelope_Version = 1 109 // The token is encrypted using go.chromium.org/luci/server/secrets. 110 TokenEnvelope_ENCRYPTED TokenEnvelope_Version = 2 111 ) 112 113 // Enum value maps for TokenEnvelope_Version. 114 var ( 115 TokenEnvelope_Version_name = map[int32]string{ 116 0: "VERSION_UNSPECIFIED", 117 1: "UNENCRYPTED_PASSWORD_LIKE", 118 2: "ENCRYPTED", 119 } 120 TokenEnvelope_Version_value = map[string]int32{ 121 "VERSION_UNSPECIFIED": 0, 122 "UNENCRYPTED_PASSWORD_LIKE": 1, 123 "ENCRYPTED": 2, 124 } 125 ) 126 127 func (x TokenEnvelope_Version) Enum() *TokenEnvelope_Version { 128 p := new(TokenEnvelope_Version) 129 *p = x 130 return p 131 } 132 133 func (x TokenEnvelope_Version) String() string { 134 return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 135 } 136 137 func (TokenEnvelope_Version) Descriptor() protoreflect.EnumDescriptor { 138 return file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[1].Descriptor() 139 } 140 141 func (TokenEnvelope_Version) Type() protoreflect.EnumType { 142 return &file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[1] 143 } 144 145 func (x TokenEnvelope_Version) Number() protoreflect.EnumNumber { 146 return protoreflect.EnumNumber(x) 147 } 148 149 // Deprecated: Use TokenEnvelope_Version.Descriptor instead. 150 func (TokenEnvelope_Version) EnumDescriptor() ([]byte, []int) { 151 return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{1, 0} 152 } 153 154 // TokenBody describes internal structure of the token. 155 type TokenBody struct { 156 state protoimpl.MessageState 157 sizeCache protoimpl.SizeCache 158 unknownFields protoimpl.UnknownFields 159 160 // Id of the build this token is generated for. 161 BuildId int64 `protobuf:"varint,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` 162 // Purpose of the token. 163 Purpose TokenBody_Purpose `protobuf:"varint,2,opt,name=purpose,proto3,enum=buildbucket.v2.TokenBody_Purpose" json:"purpose,omitempty"` 164 // An additional random byte slice to be used to generate the token. 165 State []byte `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` 166 } 167 168 func (x *TokenBody) Reset() { 169 *x = TokenBody{} 170 if protoimpl.UnsafeEnabled { 171 mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[0] 172 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 173 ms.StoreMessageInfo(mi) 174 } 175 } 176 177 func (x *TokenBody) String() string { 178 return protoimpl.X.MessageStringOf(x) 179 } 180 181 func (*TokenBody) ProtoMessage() {} 182 183 func (x *TokenBody) ProtoReflect() protoreflect.Message { 184 mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[0] 185 if protoimpl.UnsafeEnabled && x != nil { 186 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 187 if ms.LoadMessageInfo() == nil { 188 ms.StoreMessageInfo(mi) 189 } 190 return ms 191 } 192 return mi.MessageOf(x) 193 } 194 195 // Deprecated: Use TokenBody.ProtoReflect.Descriptor instead. 196 func (*TokenBody) Descriptor() ([]byte, []int) { 197 return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{0} 198 } 199 200 func (x *TokenBody) GetBuildId() int64 { 201 if x != nil { 202 return x.BuildId 203 } 204 return 0 205 } 206 207 func (x *TokenBody) GetPurpose() TokenBody_Purpose { 208 if x != nil { 209 return x.Purpose 210 } 211 return TokenBody_PURPOSE_UNSPECIFIED 212 } 213 214 func (x *TokenBody) GetState() []byte { 215 if x != nil { 216 return x.State 217 } 218 return nil 219 } 220 221 // TokenEnvelope is what is actually being serialized and represented 222 // as a token (after being encoded using base64 standard raw encoding). 223 type TokenEnvelope struct { 224 state protoimpl.MessageState 225 sizeCache protoimpl.SizeCache 226 unknownFields protoimpl.UnknownFields 227 228 // Version of the token. 229 Version TokenEnvelope_Version `protobuf:"varint,1,opt,name=version,proto3,enum=buildbucket.v2.TokenEnvelope_Version" json:"version,omitempty"` 230 // Serialized and potentially encrypted TokenBody. 231 Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` 232 } 233 234 func (x *TokenEnvelope) Reset() { 235 *x = TokenEnvelope{} 236 if protoimpl.UnsafeEnabled { 237 mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[1] 238 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 239 ms.StoreMessageInfo(mi) 240 } 241 } 242 243 func (x *TokenEnvelope) String() string { 244 return protoimpl.X.MessageStringOf(x) 245 } 246 247 func (*TokenEnvelope) ProtoMessage() {} 248 249 func (x *TokenEnvelope) ProtoReflect() protoreflect.Message { 250 mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[1] 251 if protoimpl.UnsafeEnabled && x != nil { 252 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 253 if ms.LoadMessageInfo() == nil { 254 ms.StoreMessageInfo(mi) 255 } 256 return ms 257 } 258 return mi.MessageOf(x) 259 } 260 261 // Deprecated: Use TokenEnvelope.ProtoReflect.Descriptor instead. 262 func (*TokenEnvelope) Descriptor() ([]byte, []int) { 263 return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{1} 264 } 265 266 func (x *TokenEnvelope) GetVersion() TokenEnvelope_Version { 267 if x != nil { 268 return x.Version 269 } 270 return TokenEnvelope_VERSION_UNSPECIFIED 271 } 272 273 func (x *TokenEnvelope) GetPayload() []byte { 274 if x != nil { 275 return x.Payload 276 } 277 return nil 278 } 279 280 var File_go_chromium_org_luci_buildbucket_proto_token_proto protoreflect.FileDescriptor 281 282 var file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc = []byte{ 283 0x0a, 0x32, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 284 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 285 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 286 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 287 0x74, 0x2e, 0x76, 0x32, 0x22, 0xdd, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x6f, 288 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 289 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x3b, 0x0a, 290 0x07, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 291 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x32, 0x2e, 292 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 293 0x65, 0x52, 0x07, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 294 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 295 0x22, 0x62, 0x0a, 0x07, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x50, 296 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 297 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x10, 0x01, 0x12, 298 0x0c, 0x0a, 0x04, 0x54, 0x41, 0x53, 0x4b, 0x10, 0x02, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x0f, 0x0a, 299 0x0b, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x10, 0x03, 0x12, 0x14, 300 0x0a, 0x10, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x41, 301 0x53, 0x4b, 0x10, 0x04, 0x22, 0xbc, 0x01, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x6e, 302 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 303 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 304 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x6e, 305 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 306 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 307 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 308 0x64, 0x22, 0x50, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 309 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 310 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x55, 0x4e, 0x45, 0x4e, 0x43, 0x52, 0x59, 311 0x50, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x5f, 0x4c, 0x49, 312 0x4b, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x45, 313 0x44, 0x10, 0x02, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 314 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x62, 0x75, 0x69, 0x6c, 315 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x62, 0x75, 316 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 317 0x74, 0x6f, 0x33, 318 } 319 320 var ( 321 file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescOnce sync.Once 322 file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData = file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc 323 ) 324 325 func file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP() []byte { 326 file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescOnce.Do(func() { 327 file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData) 328 }) 329 return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData 330 } 331 332 var file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes = make([]protoimpl.EnumInfo, 2) 333 var file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 334 var file_go_chromium_org_luci_buildbucket_proto_token_proto_goTypes = []interface{}{ 335 (TokenBody_Purpose)(0), // 0: buildbucket.v2.TokenBody.Purpose 336 (TokenEnvelope_Version)(0), // 1: buildbucket.v2.TokenEnvelope.Version 337 (*TokenBody)(nil), // 2: buildbucket.v2.TokenBody 338 (*TokenEnvelope)(nil), // 3: buildbucket.v2.TokenEnvelope 339 } 340 var file_go_chromium_org_luci_buildbucket_proto_token_proto_depIdxs = []int32{ 341 0, // 0: buildbucket.v2.TokenBody.purpose:type_name -> buildbucket.v2.TokenBody.Purpose 342 1, // 1: buildbucket.v2.TokenEnvelope.version:type_name -> buildbucket.v2.TokenEnvelope.Version 343 2, // [2:2] is the sub-list for method output_type 344 2, // [2:2] is the sub-list for method input_type 345 2, // [2:2] is the sub-list for extension type_name 346 2, // [2:2] is the sub-list for extension extendee 347 0, // [0:2] is the sub-list for field type_name 348 } 349 350 func init() { file_go_chromium_org_luci_buildbucket_proto_token_proto_init() } 351 func file_go_chromium_org_luci_buildbucket_proto_token_proto_init() { 352 if File_go_chromium_org_luci_buildbucket_proto_token_proto != nil { 353 return 354 } 355 if !protoimpl.UnsafeEnabled { 356 file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 357 switch v := v.(*TokenBody); i { 358 case 0: 359 return &v.state 360 case 1: 361 return &v.sizeCache 362 case 2: 363 return &v.unknownFields 364 default: 365 return nil 366 } 367 } 368 file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 369 switch v := v.(*TokenEnvelope); i { 370 case 0: 371 return &v.state 372 case 1: 373 return &v.sizeCache 374 case 2: 375 return &v.unknownFields 376 default: 377 return nil 378 } 379 } 380 } 381 type x struct{} 382 out := protoimpl.TypeBuilder{ 383 File: protoimpl.DescBuilder{ 384 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 385 RawDescriptor: file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc, 386 NumEnums: 2, 387 NumMessages: 2, 388 NumExtensions: 0, 389 NumServices: 0, 390 }, 391 GoTypes: file_go_chromium_org_luci_buildbucket_proto_token_proto_goTypes, 392 DependencyIndexes: file_go_chromium_org_luci_buildbucket_proto_token_proto_depIdxs, 393 EnumInfos: file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes, 394 MessageInfos: file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes, 395 }.Build() 396 File_go_chromium_org_luci_buildbucket_proto_token_proto = out.File 397 file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc = nil 398 file_go_chromium_org_luci_buildbucket_proto_token_proto_goTypes = nil 399 file_go_chromium_org_luci_buildbucket_proto_token_proto_depIdxs = nil 400 }