diff --git a/api/gen/proto/go/teleport/machineid/v1/bot.pb.go b/api/gen/proto/go/teleport/machineid/v1/bot.pb.go new file mode 100644 index 0000000000000..3e9a29dc9fdc6 --- /dev/null +++ b/api/gen/proto/go/teleport/machineid/v1/bot.pb.go @@ -0,0 +1,466 @@ +// Copyright 2023 Gravitational, Inc +// +// 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.31.0 +// protoc (unknown) +// source: teleport/machineid/v1/bot.proto + +package machineidv1 + +import ( + v1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/header/v1" + 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) +) + +// A Bot is a Teleport identity intended to be used by Machines. The Bot +// resource defines a Bot and configures its properties. +type Bot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The kind of resource represented. + Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` + // Differentiates variations of the same kind. All resources should + // contain one, even if it is never populated. + SubKind string `protobuf:"bytes,2,opt,name=sub_kind,json=subKind,proto3" json:"sub_kind,omitempty"` + // The version of the resource being represented. + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + // Common metadata that all resources share. + Metadata *v1.Metadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + // The configured properties of a Bot. + Spec *BotSpec `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` + // Fields that are set by the server as results of operations. These should + // not be modified by users. + Status *BotStatus `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *Bot) Reset() { + *x = Bot{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Bot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bot) ProtoMessage() {} + +func (x *Bot) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_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 Bot.ProtoReflect.Descriptor instead. +func (*Bot) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_proto_rawDescGZIP(), []int{0} +} + +func (x *Bot) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *Bot) GetSubKind() string { + if x != nil { + return x.SubKind + } + return "" +} + +func (x *Bot) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Bot) GetMetadata() *v1.Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Bot) GetSpec() *BotSpec { + if x != nil { + return x.Spec + } + return nil +} + +func (x *Bot) GetStatus() *BotStatus { + if x != nil { + return x.Status + } + return nil +} + +// Trait is an individual trait that will be applied to the bot user. +type Trait struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the trait. This is what allows the trait to be queried in + // role templates. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The values associated with the named trait. + Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"` +} + +func (x *Trait) Reset() { + *x = Trait{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Trait) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Trait) ProtoMessage() {} + +func (x *Trait) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_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 Trait.ProtoReflect.Descriptor instead. +func (*Trait) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_proto_rawDescGZIP(), []int{1} +} + +func (x *Trait) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Trait) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + +// The configured properties of a Bot. +type BotSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The roles that the bot should be able to impersonate. + Roles []string `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` + // The traits that will be associated with the bot for the purposes of role + // templating. + // + // Where multiple specified with the same name, these will be merged by the + // server. + Traits []*Trait `protobuf:"bytes,2,rep,name=traits,proto3" json:"traits,omitempty"` +} + +func (x *BotSpec) Reset() { + *x = BotSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotSpec) ProtoMessage() {} + +func (x *BotSpec) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_proto_msgTypes[2] + 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 BotSpec.ProtoReflect.Descriptor instead. +func (*BotSpec) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_proto_rawDescGZIP(), []int{2} +} + +func (x *BotSpec) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +func (x *BotSpec) GetTraits() []*Trait { + if x != nil { + return x.Traits + } + return nil +} + +// Fields that are set by the server as results of operations. These should not +// be modified by users. +type BotStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the user associated with the bot. + UserName string `protobuf:"bytes,1,opt,name=user_name,json=userName,proto3" json:"user_name,omitempty"` + // The name of the role associated with the bot. + RoleRole string `protobuf:"bytes,2,opt,name=role_role,json=roleRole,proto3" json:"role_role,omitempty"` +} + +func (x *BotStatus) Reset() { + *x = BotStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotStatus) ProtoMessage() {} + +func (x *BotStatus) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_proto_msgTypes[3] + 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 BotStatus.ProtoReflect.Descriptor instead. +func (*BotStatus) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_proto_rawDescGZIP(), []int{3} +} + +func (x *BotStatus) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *BotStatus) GetRoleRole() string { + if x != nil { + return x.RoleRole + } + return "" +} + +var File_teleport_machineid_v1_bot_proto protoreflect.FileDescriptor + +var file_teleport_machineid_v1_bot_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x15, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x21, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x01, 0x0a, 0x03, + 0x42, 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x5f, 0x6b, + 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x4b, 0x69, + 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6c, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x33, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x69, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x55, 0x0a, 0x07, 0x42, 0x6f, 0x74, + 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x06, 0x74, 0x72, + 0x61, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6c, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x74, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, + 0x22, 0x45, 0x0a, 0x09, 0x42, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, + 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, + 0x6f, 0x6c, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x65, + 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, + 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_teleport_machineid_v1_bot_proto_rawDescOnce sync.Once + file_teleport_machineid_v1_bot_proto_rawDescData = file_teleport_machineid_v1_bot_proto_rawDesc +) + +func file_teleport_machineid_v1_bot_proto_rawDescGZIP() []byte { + file_teleport_machineid_v1_bot_proto_rawDescOnce.Do(func() { + file_teleport_machineid_v1_bot_proto_rawDescData = protoimpl.X.CompressGZIP(file_teleport_machineid_v1_bot_proto_rawDescData) + }) + return file_teleport_machineid_v1_bot_proto_rawDescData +} + +var file_teleport_machineid_v1_bot_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_teleport_machineid_v1_bot_proto_goTypes = []interface{}{ + (*Bot)(nil), // 0: teleport.machineid.v1.Bot + (*Trait)(nil), // 1: teleport.machineid.v1.Trait + (*BotSpec)(nil), // 2: teleport.machineid.v1.BotSpec + (*BotStatus)(nil), // 3: teleport.machineid.v1.BotStatus + (*v1.Metadata)(nil), // 4: teleport.header.v1.Metadata +} +var file_teleport_machineid_v1_bot_proto_depIdxs = []int32{ + 4, // 0: teleport.machineid.v1.Bot.metadata:type_name -> teleport.header.v1.Metadata + 2, // 1: teleport.machineid.v1.Bot.spec:type_name -> teleport.machineid.v1.BotSpec + 3, // 2: teleport.machineid.v1.Bot.status:type_name -> teleport.machineid.v1.BotStatus + 1, // 3: teleport.machineid.v1.BotSpec.traits:type_name -> teleport.machineid.v1.Trait + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_teleport_machineid_v1_bot_proto_init() } +func file_teleport_machineid_v1_bot_proto_init() { + if File_teleport_machineid_v1_bot_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_teleport_machineid_v1_bot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Bot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Trait); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BotSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BotStatus); 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_teleport_machineid_v1_bot_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_teleport_machineid_v1_bot_proto_goTypes, + DependencyIndexes: file_teleport_machineid_v1_bot_proto_depIdxs, + MessageInfos: file_teleport_machineid_v1_bot_proto_msgTypes, + }.Build() + File_teleport_machineid_v1_bot_proto = out.File + file_teleport_machineid_v1_bot_proto_rawDesc = nil + file_teleport_machineid_v1_bot_proto_goTypes = nil + file_teleport_machineid_v1_bot_proto_depIdxs = nil +} diff --git a/api/gen/proto/go/teleport/machineid/v1/bot_service.pb.go b/api/gen/proto/go/teleport/machineid/v1/bot_service.pb.go new file mode 100644 index 0000000000000..9800063cdcdcc --- /dev/null +++ b/api/gen/proto/go/teleport/machineid/v1/bot_service.pb.go @@ -0,0 +1,659 @@ +// Copyright 2023 Gravitational, Inc +// +// 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.31.0 +// protoc (unknown) +// source: teleport/machineid/v1/bot_service.proto + +package machineidv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + 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) +) + +// The request for CreateBot. +type CreateBotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bot to create. + Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` +} + +func (x *CreateBotRequest) Reset() { + *x = CreateBotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBotRequest) ProtoMessage() {} + +func (x *CreateBotRequest) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_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 CreateBotRequest.ProtoReflect.Descriptor instead. +func (*CreateBotRequest) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateBotRequest) GetBot() *Bot { + if x != nil { + return x.Bot + } + return nil +} + +// The request for GetBot. +type GetBotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the bot to fetch. + BotName string `protobuf:"bytes,1,opt,name=bot_name,json=botName,proto3" json:"bot_name,omitempty"` +} + +func (x *GetBotRequest) Reset() { + *x = GetBotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBotRequest) ProtoMessage() {} + +func (x *GetBotRequest) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_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 GetBotRequest.ProtoReflect.Descriptor instead. +func (*GetBotRequest) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetBotRequest) GetBotName() string { + if x != nil { + return x.BotName + } + return "" +} + +// The request for ListBots. +type ListBotsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The maximum number of items to return. + // The server may impose a different page size at its discretion. + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // The next_page_token value returned from a previous List request, if any. + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` +} + +func (x *ListBotsRequest) Reset() { + *x = ListBotsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBotsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBotsRequest) ProtoMessage() {} + +func (x *ListBotsRequest) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[2] + 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 ListBotsRequest.ProtoReflect.Descriptor instead. +func (*ListBotsRequest) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ListBotsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListBotsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +// The response for ListBots. +type ListBotsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The page of Bots that matched the request. + Bots []*Bot `protobuf:"bytes,1,rep,name=bots,proto3" json:"bots,omitempty"` + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` +} + +func (x *ListBotsResponse) Reset() { + *x = ListBotsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBotsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBotsResponse) ProtoMessage() {} + +func (x *ListBotsResponse) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[3] + 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 ListBotsResponse.ProtoReflect.Descriptor instead. +func (*ListBotsResponse) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ListBotsResponse) GetBots() []*Bot { + if x != nil { + return x.Bots + } + return nil +} + +func (x *ListBotsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// The request for UpdateBot. +type UpdateBotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The values to apply based on the update mask. The name must be specified. + Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` + // The update mask applied to a Bot. + // Fields are masked according to their proto name. + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateBotRequest) Reset() { + *x = UpdateBotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateBotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBotRequest) ProtoMessage() {} + +func (x *UpdateBotRequest) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[4] + 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 UpdateBotRequest.ProtoReflect.Descriptor instead. +func (*UpdateBotRequest) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateBotRequest) GetBot() *Bot { + if x != nil { + return x.Bot + } + return nil +} + +func (x *UpdateBotRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +// The request for UpsertBot. +type UpsertBotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bot to create or replace. + Bot *Bot `protobuf:"bytes,1,opt,name=bot,proto3" json:"bot,omitempty"` +} + +func (x *UpsertBotRequest) Reset() { + *x = UpsertBotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpsertBotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpsertBotRequest) ProtoMessage() {} + +func (x *UpsertBotRequest) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[5] + 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 UpsertBotRequest.ProtoReflect.Descriptor instead. +func (*UpsertBotRequest) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{5} +} + +func (x *UpsertBotRequest) GetBot() *Bot { + if x != nil { + return x.Bot + } + return nil +} + +// The request for DeleteBot. +type DeleteBotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the bot to delete. + BotName string `protobuf:"bytes,1,opt,name=bot_name,json=botName,proto3" json:"bot_name,omitempty"` +} + +func (x *DeleteBotRequest) Reset() { + *x = DeleteBotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteBotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBotRequest) ProtoMessage() {} + +func (x *DeleteBotRequest) ProtoReflect() protoreflect.Message { + mi := &file_teleport_machineid_v1_bot_service_proto_msgTypes[6] + 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 DeleteBotRequest.ProtoReflect.Descriptor instead. +func (*DeleteBotRequest) Descriptor() ([]byte, []int) { + return file_teleport_machineid_v1_bot_service_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteBotRequest) GetBotName() string { + if x != nil { + return x.BotName + } + return "" +} + +var File_teleport_machineid_v1_bot_service_proto protoreflect.FileDescriptor + +var file_teleport_machineid_v1_bot_service_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x40, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x62, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x52, 0x03, 0x62, + 0x6f, 0x74, 0x22, 0x2a, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x4d, + 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x6a, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x62, 0x6f, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x52, 0x04, 0x62, 0x6f, 0x74, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, + 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7d, 0x0a, 0x10, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, + 0x03, 0x62, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6c, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x52, 0x03, 0x62, 0x6f, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x40, 0x0a, 0x10, 0x55, 0x70, 0x73, 0x65, + 0x72, 0x74, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x03, + 0x62, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x52, 0x03, 0x62, 0x6f, 0x74, 0x22, 0x2d, 0x0a, 0x10, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0xf9, 0x03, 0x0a, 0x0a, 0x42, 0x6f, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x42, + 0x6f, 0x74, 0x12, 0x24, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6f, 0x74, 0x12, 0x5b, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x74, 0x73, + 0x12, 0x26, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x50, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x74, 0x12, 0x27, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6f, 0x74, 0x12, 0x50, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x74, + 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, + 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x12, 0x50, 0x0a, 0x09, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x42, + 0x6f, 0x74, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, + 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x12, 0x4c, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x42, 0x6f, 0x74, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x42, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x2f, 0x76, + 0x31, 0x3b, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x69, 0x64, 0x76, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_teleport_machineid_v1_bot_service_proto_rawDescOnce sync.Once + file_teleport_machineid_v1_bot_service_proto_rawDescData = file_teleport_machineid_v1_bot_service_proto_rawDesc +) + +func file_teleport_machineid_v1_bot_service_proto_rawDescGZIP() []byte { + file_teleport_machineid_v1_bot_service_proto_rawDescOnce.Do(func() { + file_teleport_machineid_v1_bot_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_teleport_machineid_v1_bot_service_proto_rawDescData) + }) + return file_teleport_machineid_v1_bot_service_proto_rawDescData +} + +var file_teleport_machineid_v1_bot_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_teleport_machineid_v1_bot_service_proto_goTypes = []interface{}{ + (*CreateBotRequest)(nil), // 0: teleport.machineid.v1.CreateBotRequest + (*GetBotRequest)(nil), // 1: teleport.machineid.v1.GetBotRequest + (*ListBotsRequest)(nil), // 2: teleport.machineid.v1.ListBotsRequest + (*ListBotsResponse)(nil), // 3: teleport.machineid.v1.ListBotsResponse + (*UpdateBotRequest)(nil), // 4: teleport.machineid.v1.UpdateBotRequest + (*UpsertBotRequest)(nil), // 5: teleport.machineid.v1.UpsertBotRequest + (*DeleteBotRequest)(nil), // 6: teleport.machineid.v1.DeleteBotRequest + (*Bot)(nil), // 7: teleport.machineid.v1.Bot + (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask + (*emptypb.Empty)(nil), // 9: google.protobuf.Empty +} +var file_teleport_machineid_v1_bot_service_proto_depIdxs = []int32{ + 7, // 0: teleport.machineid.v1.CreateBotRequest.bot:type_name -> teleport.machineid.v1.Bot + 7, // 1: teleport.machineid.v1.ListBotsResponse.bots:type_name -> teleport.machineid.v1.Bot + 7, // 2: teleport.machineid.v1.UpdateBotRequest.bot:type_name -> teleport.machineid.v1.Bot + 8, // 3: teleport.machineid.v1.UpdateBotRequest.update_mask:type_name -> google.protobuf.FieldMask + 7, // 4: teleport.machineid.v1.UpsertBotRequest.bot:type_name -> teleport.machineid.v1.Bot + 1, // 5: teleport.machineid.v1.BotService.GetBot:input_type -> teleport.machineid.v1.GetBotRequest + 2, // 6: teleport.machineid.v1.BotService.ListBots:input_type -> teleport.machineid.v1.ListBotsRequest + 0, // 7: teleport.machineid.v1.BotService.CreateBot:input_type -> teleport.machineid.v1.CreateBotRequest + 4, // 8: teleport.machineid.v1.BotService.UpdateBot:input_type -> teleport.machineid.v1.UpdateBotRequest + 5, // 9: teleport.machineid.v1.BotService.UpsertBot:input_type -> teleport.machineid.v1.UpsertBotRequest + 6, // 10: teleport.machineid.v1.BotService.DeleteBot:input_type -> teleport.machineid.v1.DeleteBotRequest + 7, // 11: teleport.machineid.v1.BotService.GetBot:output_type -> teleport.machineid.v1.Bot + 3, // 12: teleport.machineid.v1.BotService.ListBots:output_type -> teleport.machineid.v1.ListBotsResponse + 7, // 13: teleport.machineid.v1.BotService.CreateBot:output_type -> teleport.machineid.v1.Bot + 7, // 14: teleport.machineid.v1.BotService.UpdateBot:output_type -> teleport.machineid.v1.Bot + 7, // 15: teleport.machineid.v1.BotService.UpsertBot:output_type -> teleport.machineid.v1.Bot + 9, // 16: teleport.machineid.v1.BotService.DeleteBot:output_type -> google.protobuf.Empty + 11, // [11:17] is the sub-list for method output_type + 5, // [5:11] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_teleport_machineid_v1_bot_service_proto_init() } +func file_teleport_machineid_v1_bot_service_proto_init() { + if File_teleport_machineid_v1_bot_service_proto != nil { + return + } + file_teleport_machineid_v1_bot_proto_init() + if !protoimpl.UnsafeEnabled { + file_teleport_machineid_v1_bot_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBotsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBotsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateBotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpsertBotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teleport_machineid_v1_bot_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteBotRequest); 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_teleport_machineid_v1_bot_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_teleport_machineid_v1_bot_service_proto_goTypes, + DependencyIndexes: file_teleport_machineid_v1_bot_service_proto_depIdxs, + MessageInfos: file_teleport_machineid_v1_bot_service_proto_msgTypes, + }.Build() + File_teleport_machineid_v1_bot_service_proto = out.File + file_teleport_machineid_v1_bot_service_proto_rawDesc = nil + file_teleport_machineid_v1_bot_service_proto_goTypes = nil + file_teleport_machineid_v1_bot_service_proto_depIdxs = nil +} diff --git a/api/gen/proto/go/teleport/machineid/v1/bot_service_grpc.pb.go b/api/gen/proto/go/teleport/machineid/v1/bot_service_grpc.pb.go new file mode 100644 index 0000000000000..c8830ad91e6eb --- /dev/null +++ b/api/gen/proto/go/teleport/machineid/v1/bot_service_grpc.pb.go @@ -0,0 +1,343 @@ +// Copyright 2023 Gravitational, Inc +// +// 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-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: teleport/machineid/v1/bot_service.proto + +package machineidv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + BotService_GetBot_FullMethodName = "/teleport.machineid.v1.BotService/GetBot" + BotService_ListBots_FullMethodName = "/teleport.machineid.v1.BotService/ListBots" + BotService_CreateBot_FullMethodName = "/teleport.machineid.v1.BotService/CreateBot" + BotService_UpdateBot_FullMethodName = "/teleport.machineid.v1.BotService/UpdateBot" + BotService_UpsertBot_FullMethodName = "/teleport.machineid.v1.BotService/UpsertBot" + BotService_DeleteBot_FullMethodName = "/teleport.machineid.v1.BotService/DeleteBot" +) + +// BotServiceClient is the client API for BotService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BotServiceClient interface { + // GetBot is used to query a Bot resource by its name. + // + // This will return a NotFound error if the specified Bot does not exist. + GetBot(ctx context.Context, in *GetBotRequest, opts ...grpc.CallOption) (*Bot, error) + // ListBots is used to query Bots. + // + // Follows the pagination semantics of + // https://cloud.google.com/apis/design/standard_methods#list. + ListBots(ctx context.Context, in *ListBotsRequest, opts ...grpc.CallOption) (*ListBotsResponse, error) + // CreateBot is used to create a Bot. + // + // This will return an error if a Bot by that name already exists. + CreateBot(ctx context.Context, in *CreateBotRequest, opts ...grpc.CallOption) (*Bot, error) + // UpdateBot is used to modify an existing Bot. + UpdateBot(ctx context.Context, in *UpdateBotRequest, opts ...grpc.CallOption) (*Bot, error) + // UpsertBot is used to create or replace an existing Bot. + // + // Prefer using CreateBot and UpdateBot. + UpsertBot(ctx context.Context, in *UpsertBotRequest, opts ...grpc.CallOption) (*Bot, error) + // DeleteBot is used to delete a specific Bot. + // + // This will return a NotFound error if the specified Bot does not exist. + DeleteBot(ctx context.Context, in *DeleteBotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type botServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBotServiceClient(cc grpc.ClientConnInterface) BotServiceClient { + return &botServiceClient{cc} +} + +func (c *botServiceClient) GetBot(ctx context.Context, in *GetBotRequest, opts ...grpc.CallOption) (*Bot, error) { + out := new(Bot) + err := c.cc.Invoke(ctx, BotService_GetBot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *botServiceClient) ListBots(ctx context.Context, in *ListBotsRequest, opts ...grpc.CallOption) (*ListBotsResponse, error) { + out := new(ListBotsResponse) + err := c.cc.Invoke(ctx, BotService_ListBots_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *botServiceClient) CreateBot(ctx context.Context, in *CreateBotRequest, opts ...grpc.CallOption) (*Bot, error) { + out := new(Bot) + err := c.cc.Invoke(ctx, BotService_CreateBot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *botServiceClient) UpdateBot(ctx context.Context, in *UpdateBotRequest, opts ...grpc.CallOption) (*Bot, error) { + out := new(Bot) + err := c.cc.Invoke(ctx, BotService_UpdateBot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *botServiceClient) UpsertBot(ctx context.Context, in *UpsertBotRequest, opts ...grpc.CallOption) (*Bot, error) { + out := new(Bot) + err := c.cc.Invoke(ctx, BotService_UpsertBot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *botServiceClient) DeleteBot(ctx context.Context, in *DeleteBotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, BotService_DeleteBot_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BotServiceServer is the server API for BotService service. +// All implementations must embed UnimplementedBotServiceServer +// for forward compatibility +type BotServiceServer interface { + // GetBot is used to query a Bot resource by its name. + // + // This will return a NotFound error if the specified Bot does not exist. + GetBot(context.Context, *GetBotRequest) (*Bot, error) + // ListBots is used to query Bots. + // + // Follows the pagination semantics of + // https://cloud.google.com/apis/design/standard_methods#list. + ListBots(context.Context, *ListBotsRequest) (*ListBotsResponse, error) + // CreateBot is used to create a Bot. + // + // This will return an error if a Bot by that name already exists. + CreateBot(context.Context, *CreateBotRequest) (*Bot, error) + // UpdateBot is used to modify an existing Bot. + UpdateBot(context.Context, *UpdateBotRequest) (*Bot, error) + // UpsertBot is used to create or replace an existing Bot. + // + // Prefer using CreateBot and UpdateBot. + UpsertBot(context.Context, *UpsertBotRequest) (*Bot, error) + // DeleteBot is used to delete a specific Bot. + // + // This will return a NotFound error if the specified Bot does not exist. + DeleteBot(context.Context, *DeleteBotRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedBotServiceServer() +} + +// UnimplementedBotServiceServer must be embedded to have forward compatible implementations. +type UnimplementedBotServiceServer struct { +} + +func (UnimplementedBotServiceServer) GetBot(context.Context, *GetBotRequest) (*Bot, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBot not implemented") +} +func (UnimplementedBotServiceServer) ListBots(context.Context, *ListBotsRequest) (*ListBotsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBots not implemented") +} +func (UnimplementedBotServiceServer) CreateBot(context.Context, *CreateBotRequest) (*Bot, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBot not implemented") +} +func (UnimplementedBotServiceServer) UpdateBot(context.Context, *UpdateBotRequest) (*Bot, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBot not implemented") +} +func (UnimplementedBotServiceServer) UpsertBot(context.Context, *UpsertBotRequest) (*Bot, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpsertBot not implemented") +} +func (UnimplementedBotServiceServer) DeleteBot(context.Context, *DeleteBotRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBot not implemented") +} +func (UnimplementedBotServiceServer) mustEmbedUnimplementedBotServiceServer() {} + +// UnsafeBotServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BotServiceServer will +// result in compilation errors. +type UnsafeBotServiceServer interface { + mustEmbedUnimplementedBotServiceServer() +} + +func RegisterBotServiceServer(s grpc.ServiceRegistrar, srv BotServiceServer) { + s.RegisterService(&BotService_ServiceDesc, srv) +} + +func _BotService_GetBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BotServiceServer).GetBot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BotService_GetBot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BotServiceServer).GetBot(ctx, req.(*GetBotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BotService_ListBots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBotsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BotServiceServer).ListBots(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BotService_ListBots_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BotServiceServer).ListBots(ctx, req.(*ListBotsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BotService_CreateBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BotServiceServer).CreateBot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BotService_CreateBot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BotServiceServer).CreateBot(ctx, req.(*CreateBotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BotService_UpdateBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BotServiceServer).UpdateBot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BotService_UpdateBot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BotServiceServer).UpdateBot(ctx, req.(*UpdateBotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BotService_UpsertBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpsertBotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BotServiceServer).UpsertBot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BotService_UpsertBot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BotServiceServer).UpsertBot(ctx, req.(*UpsertBotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BotService_DeleteBot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BotServiceServer).DeleteBot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BotService_DeleteBot_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BotServiceServer).DeleteBot(ctx, req.(*DeleteBotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BotService_ServiceDesc is the grpc.ServiceDesc for BotService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BotService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "teleport.machineid.v1.BotService", + HandlerType: (*BotServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetBot", + Handler: _BotService_GetBot_Handler, + }, + { + MethodName: "ListBots", + Handler: _BotService_ListBots_Handler, + }, + { + MethodName: "CreateBot", + Handler: _BotService_CreateBot_Handler, + }, + { + MethodName: "UpdateBot", + Handler: _BotService_UpdateBot_Handler, + }, + { + MethodName: "UpsertBot", + Handler: _BotService_UpsertBot_Handler, + }, + { + MethodName: "DeleteBot", + Handler: _BotService_DeleteBot_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "teleport/machineid/v1/bot_service.proto", +} diff --git a/api/proto/teleport/machineid/v1/bot.proto b/api/proto/teleport/machineid/v1/bot.proto new file mode 100644 index 0000000000000..bca6e1a77339e --- /dev/null +++ b/api/proto/teleport/machineid/v1/bot.proto @@ -0,0 +1,70 @@ +// Copyright 2023 Gravitational, Inc +// +// 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. + +syntax = "proto3"; + +package teleport.machineid.v1; + +import "teleport/header/v1/metadata.proto"; + +option go_package = "github.com/gravitational/teleport/api/gen/proto/go/teleport/machineid/v1;machineidv1"; + +// A Bot is a Teleport identity intended to be used by Machines. The Bot +// resource defines a Bot and configures its properties. +message Bot { + // The kind of resource represented. + string kind = 1; + // Differentiates variations of the same kind. All resources should + // contain one, even if it is never populated. + string sub_kind = 2; + // The version of the resource being represented. + string version = 3; + // Common metadata that all resources share. + teleport.header.v1.Metadata metadata = 4; + // The configured properties of a Bot. + BotSpec spec = 5; + // Fields that are set by the server as results of operations. These should + // not be modified by users. + BotStatus status = 6; +} + +// Trait is an individual trait that will be applied to the bot user. +message Trait { + // The name of the trait. This is what allows the trait to be queried in + // role templates. + string name = 1; + // The values associated with the named trait. + repeated string values = 2; +} + +// The configured properties of a Bot. +message BotSpec { + // The roles that the bot should be able to impersonate. + repeated string roles = 1; + // The traits that will be associated with the bot for the purposes of role + // templating. + // + // Where multiple specified with the same name, these will be merged by the + // server. + repeated Trait traits = 2; +} + +// Fields that are set by the server as results of operations. These should not +// be modified by users. +message BotStatus { + // The name of the user associated with the bot. + string user_name = 1; + // The name of the role associated with the bot. + string role_role = 2; +} diff --git a/api/proto/teleport/machineid/v1/bot_service.proto b/api/proto/teleport/machineid/v1/bot_service.proto new file mode 100644 index 0000000000000..f18e1c9f87614 --- /dev/null +++ b/api/proto/teleport/machineid/v1/bot_service.proto @@ -0,0 +1,101 @@ +// Copyright 2023 Gravitational, Inc +// +// 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. + +syntax = "proto3"; + +package teleport.machineid.v1; + +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "teleport/machineid/v1/bot.proto"; + +option go_package = "github.com/gravitational/teleport/api/gen/proto/go/teleport/machineid/v1;machineidv1"; + +// BotService provides methods to manage Teleport Bots +service BotService { + // GetBot is used to query a Bot resource by its name. + // + // This will return a NotFound error if the specified Bot does not exist. + rpc GetBot(GetBotRequest) returns (Bot); + // ListBots is used to query Bots. + // + // Follows the pagination semantics of + // https://cloud.google.com/apis/design/standard_methods#list. + rpc ListBots(ListBotsRequest) returns (ListBotsResponse); + // CreateBot is used to create a Bot. + // + // This will return an error if a Bot by that name already exists. + rpc CreateBot(CreateBotRequest) returns (Bot); + // UpdateBot is used to modify an existing Bot. + rpc UpdateBot(UpdateBotRequest) returns (Bot); + // UpsertBot is used to create or replace an existing Bot. + // + // Prefer using CreateBot and UpdateBot. + rpc UpsertBot(UpsertBotRequest) returns (Bot); + // DeleteBot is used to delete a specific Bot. + // + // This will return a NotFound error if the specified Bot does not exist. + rpc DeleteBot(DeleteBotRequest) returns (google.protobuf.Empty); +} + +// The request for CreateBot. +message CreateBotRequest { + // The bot to create. + Bot bot = 1; +} + +// The request for GetBot. +message GetBotRequest { + // The name of the bot to fetch. + string bot_name = 1; +} + +// The request for ListBots. +message ListBotsRequest { + // The maximum number of items to return. + // The server may impose a different page size at its discretion. + int32 page_size = 1; + // The next_page_token value returned from a previous List request, if any. + string page_token = 2; +} + +// The response for ListBots. +message ListBotsResponse { + // The page of Bots that matched the request. + repeated Bot bots = 1; + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for UpdateBot. +message UpdateBotRequest { + // The values to apply based on the update mask. The name must be specified. + Bot bot = 1; + // The update mask applied to a Bot. + // Fields are masked according to their proto name. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for UpsertBot. +message UpsertBotRequest { + // The bot to create or replace. + Bot bot = 1; +} + +// The request for DeleteBot. +message DeleteBotRequest { + // The name of the bot to delete. + string bot_name = 1; +}