| // Copyright 2022 The LUCI Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // versions: |
| // protoc-gen-go v1.28.1 |
| // protoc v3.21.7 |
| // source: go.chromium.org/luci/buildbucket/proto/token.proto |
| |
| package buildbucketpb |
| |
| import ( |
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| reflect "reflect" |
| sync "sync" |
| ) |
| |
| const ( |
| // Verify that this generated code is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| // Verify that runtime/protoimpl is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| ) |
| |
| // Possible purposes of the token. |
| type TokenBody_Purpose int32 |
| |
| const ( |
| // The default value. This value is used if purpose is omitted. |
| TokenBody_PURPOSE_UNSPECIFIED TokenBody_Purpose = 0 |
| // The token is a build token. |
| TokenBody_BUILD TokenBody_Purpose = 1 |
| // The token is a task token. |
| TokenBody_TASK TokenBody_Purpose = 2 |
| ) |
| |
| // Enum value maps for TokenBody_Purpose. |
| var ( |
| TokenBody_Purpose_name = map[int32]string{ |
| 0: "PURPOSE_UNSPECIFIED", |
| 1: "BUILD", |
| 2: "TASK", |
| } |
| TokenBody_Purpose_value = map[string]int32{ |
| "PURPOSE_UNSPECIFIED": 0, |
| "BUILD": 1, |
| "TASK": 2, |
| } |
| ) |
| |
| func (x TokenBody_Purpose) Enum() *TokenBody_Purpose { |
| p := new(TokenBody_Purpose) |
| *p = x |
| return p |
| } |
| |
| func (x TokenBody_Purpose) String() string { |
| return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
| } |
| |
| func (TokenBody_Purpose) Descriptor() protoreflect.EnumDescriptor { |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[0].Descriptor() |
| } |
| |
| func (TokenBody_Purpose) Type() protoreflect.EnumType { |
| return &file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[0] |
| } |
| |
| func (x TokenBody_Purpose) Number() protoreflect.EnumNumber { |
| return protoreflect.EnumNumber(x) |
| } |
| |
| // Deprecated: Use TokenBody_Purpose.Descriptor instead. |
| func (TokenBody_Purpose) EnumDescriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{0, 0} |
| } |
| |
| // Possible version of the token. |
| type TokenEnvelope_Version int32 |
| |
| const ( |
| // The default value. This value is used if version is omitted. |
| TokenEnvelope_VERSION_UNSPECIFIED TokenEnvelope_Version = 0 |
| // The token is saved in model.Build like a password. |
| TokenEnvelope_UNENCRYPTED_PASSWORD_LIKE TokenEnvelope_Version = 1 |
| ) |
| |
| // Enum value maps for TokenEnvelope_Version. |
| var ( |
| TokenEnvelope_Version_name = map[int32]string{ |
| 0: "VERSION_UNSPECIFIED", |
| 1: "UNENCRYPTED_PASSWORD_LIKE", |
| } |
| TokenEnvelope_Version_value = map[string]int32{ |
| "VERSION_UNSPECIFIED": 0, |
| "UNENCRYPTED_PASSWORD_LIKE": 1, |
| } |
| ) |
| |
| func (x TokenEnvelope_Version) Enum() *TokenEnvelope_Version { |
| p := new(TokenEnvelope_Version) |
| *p = x |
| return p |
| } |
| |
| func (x TokenEnvelope_Version) String() string { |
| return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
| } |
| |
| func (TokenEnvelope_Version) Descriptor() protoreflect.EnumDescriptor { |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[1].Descriptor() |
| } |
| |
| func (TokenEnvelope_Version) Type() protoreflect.EnumType { |
| return &file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes[1] |
| } |
| |
| func (x TokenEnvelope_Version) Number() protoreflect.EnumNumber { |
| return protoreflect.EnumNumber(x) |
| } |
| |
| // Deprecated: Use TokenEnvelope_Version.Descriptor instead. |
| func (TokenEnvelope_Version) EnumDescriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{1, 0} |
| } |
| |
| // TokenBody describes internal structure of the token. |
| type TokenBody struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Id of the build this token is generated for. |
| BuildId int64 `protobuf:"varint,1,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` |
| // Purpose of the token. |
| Purpose TokenBody_Purpose `protobuf:"varint,2,opt,name=purpose,proto3,enum=buildbucket.v2.TokenBody_Purpose" json:"purpose,omitempty"` |
| // An additional random byte slice to be used to generate the token. |
| State []byte `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` |
| } |
| |
| func (x *TokenBody) Reset() { |
| *x = TokenBody{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[0] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *TokenBody) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*TokenBody) ProtoMessage() {} |
| |
| func (x *TokenBody) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[0] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use TokenBody.ProtoReflect.Descriptor instead. |
| func (*TokenBody) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{0} |
| } |
| |
| func (x *TokenBody) GetBuildId() int64 { |
| if x != nil { |
| return x.BuildId |
| } |
| return 0 |
| } |
| |
| func (x *TokenBody) GetPurpose() TokenBody_Purpose { |
| if x != nil { |
| return x.Purpose |
| } |
| return TokenBody_PURPOSE_UNSPECIFIED |
| } |
| |
| func (x *TokenBody) GetState() []byte { |
| if x != nil { |
| return x.State |
| } |
| return nil |
| } |
| |
| // TokenEnvelope is what is actually being serialized and represented |
| // as a token (after being encoded using base64 standard raw encoding). |
| type TokenEnvelope struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| |
| // Version of the token. |
| Version TokenEnvelope_Version `protobuf:"varint,1,opt,name=version,proto3,enum=buildbucket.v2.TokenEnvelope_Version" json:"version,omitempty"` |
| // Serialized and potentially encrypted TokenBody. |
| Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` |
| } |
| |
| func (x *TokenEnvelope) Reset() { |
| *x = TokenEnvelope{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[1] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *TokenEnvelope) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*TokenEnvelope) ProtoMessage() {} |
| |
| func (x *TokenEnvelope) ProtoReflect() protoreflect.Message { |
| mi := &file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[1] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use TokenEnvelope.ProtoReflect.Descriptor instead. |
| func (*TokenEnvelope) Descriptor() ([]byte, []int) { |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP(), []int{1} |
| } |
| |
| func (x *TokenEnvelope) GetVersion() TokenEnvelope_Version { |
| if x != nil { |
| return x.Version |
| } |
| return TokenEnvelope_VERSION_UNSPECIFIED |
| } |
| |
| func (x *TokenEnvelope) GetPayload() []byte { |
| if x != nil { |
| return x.Payload |
| } |
| return nil |
| } |
| |
| var File_go_chromium_org_luci_buildbucket_proto_token_proto protoreflect.FileDescriptor |
| |
| var file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc = []byte{ |
| 0x0a, 0x32, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, |
| 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, |
| 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, |
| 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, |
| 0x74, 0x2e, 0x76, 0x32, 0x22, 0xb2, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x6f, |
| 0x64, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, |
| 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x3b, 0x0a, |
| 0x07, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, |
| 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x32, 0x2e, |
| 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x2e, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, |
| 0x65, 0x52, 0x07, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, |
| 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, |
| 0x22, 0x37, 0x0a, 0x07, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x50, |
| 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, |
| 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x10, 0x01, 0x12, |
| 0x08, 0x0a, 0x04, 0x54, 0x41, 0x53, 0x4b, 0x10, 0x02, 0x22, 0xad, 0x01, 0x0a, 0x0d, 0x54, 0x6f, |
| 0x6b, 0x65, 0x6e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x76, |
| 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, |
| 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x6f, |
| 0x6b, 0x65, 0x6e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, |
| 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, |
| 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, |
| 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x41, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, |
| 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, |
| 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x55, 0x4e, |
| 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, |
| 0x52, 0x44, 0x5f, 0x4c, 0x49, 0x4b, 0x45, 0x10, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x6f, 0x2e, |
| 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, |
| 0x69, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2f, 0x70, 0x72, |
| 0x6f, 0x74, 0x6f, 0x3b, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x70, |
| 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
| } |
| |
| var ( |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescOnce sync.Once |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData = file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc |
| ) |
| |
| func file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescGZIP() []byte { |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescOnce.Do(func() { |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData) |
| }) |
| return file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDescData |
| } |
| |
| var file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes = make([]protoimpl.EnumInfo, 2) |
| var file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes = make([]protoimpl.MessageInfo, 2) |
| var file_go_chromium_org_luci_buildbucket_proto_token_proto_goTypes = []interface{}{ |
| (TokenBody_Purpose)(0), // 0: buildbucket.v2.TokenBody.Purpose |
| (TokenEnvelope_Version)(0), // 1: buildbucket.v2.TokenEnvelope.Version |
| (*TokenBody)(nil), // 2: buildbucket.v2.TokenBody |
| (*TokenEnvelope)(nil), // 3: buildbucket.v2.TokenEnvelope |
| } |
| var file_go_chromium_org_luci_buildbucket_proto_token_proto_depIdxs = []int32{ |
| 0, // 0: buildbucket.v2.TokenBody.purpose:type_name -> buildbucket.v2.TokenBody.Purpose |
| 1, // 1: buildbucket.v2.TokenEnvelope.version:type_name -> buildbucket.v2.TokenEnvelope.Version |
| 2, // [2:2] is the sub-list for method output_type |
| 2, // [2:2] is the sub-list for method input_type |
| 2, // [2:2] is the sub-list for extension type_name |
| 2, // [2:2] is the sub-list for extension extendee |
| 0, // [0:2] is the sub-list for field type_name |
| } |
| |
| func init() { file_go_chromium_org_luci_buildbucket_proto_token_proto_init() } |
| func file_go_chromium_org_luci_buildbucket_proto_token_proto_init() { |
| if File_go_chromium_org_luci_buildbucket_proto_token_proto != nil { |
| return |
| } |
| if !protoimpl.UnsafeEnabled { |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*TokenBody); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*TokenEnvelope); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| } |
| type x struct{} |
| out := protoimpl.TypeBuilder{ |
| File: protoimpl.DescBuilder{ |
| GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| RawDescriptor: file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc, |
| NumEnums: 2, |
| NumMessages: 2, |
| NumExtensions: 0, |
| NumServices: 0, |
| }, |
| GoTypes: file_go_chromium_org_luci_buildbucket_proto_token_proto_goTypes, |
| DependencyIndexes: file_go_chromium_org_luci_buildbucket_proto_token_proto_depIdxs, |
| EnumInfos: file_go_chromium_org_luci_buildbucket_proto_token_proto_enumTypes, |
| MessageInfos: file_go_chromium_org_luci_buildbucket_proto_token_proto_msgTypes, |
| }.Build() |
| File_go_chromium_org_luci_buildbucket_proto_token_proto = out.File |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_rawDesc = nil |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_goTypes = nil |
| file_go_chromium_org_luci_buildbucket_proto_token_proto_depIdxs = nil |
| } |