From a7760a4f71c7a0faeb05bb4f15cdc99f6e65107c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Cie=C5=9Blak?= Date: Mon, 27 Jun 2022 15:43:48 +0200 Subject: [PATCH] Teleport Connect: Add SetGatewayTargetSubresourceName RPC (#13476) * clusters.CreateGateway: Trim spaces when building a CLI command If cliCommand.Env is empty, the returned command has an empty space at the front. * Do not pass TargetSubresourceName when fetching certs for gateway Since we want to be able to freely specify the db name after the gateway creation, let's not pass the db name when creating the gateway to show the intent more clearly. * Make CLICommand a method on Gateway rather than a field * Extract getting cluster by resource URI to Storage --- lib/client/db/dbcmd/dbcmd.go | 61 +- lib/client/db/dbcmd/dbcmd_test.go | 6 +- lib/teleterm/api/proto/v1/service.proto | 20 +- .../api/protogen/golang/v1/service.pb.go | 724 +++++++++++------- .../api/protogen/js/v1/service_grpc_pb.d.ts | 85 +- .../api/protogen/js/v1/service_grpc_pb.js | 74 +- .../api/protogen/js/v1/service_pb.d.ts | 25 + lib/teleterm/api/protogen/js/v1/service_pb.js | 182 +++++ .../apiserver/handler/handler_gateways.go | 49 +- lib/teleterm/clusters/cluster_databases.go | 4 +- lib/teleterm/clusters/cluster_gateways.go | 48 +- .../clusters/dbcmd_cli_command_provider.go | 81 ++ .../dbcmd_cli_command_provider_test.go | 131 ++++ lib/teleterm/clusters/storage.go | 16 + lib/teleterm/daemon/daemon.go | 64 +- lib/teleterm/gateway/gateway.go | 34 +- lib/teleterm/gateway/gateway_test.go | 47 ++ 17 files changed, 1186 insertions(+), 465 deletions(-) create mode 100644 lib/teleterm/clusters/dbcmd_cli_command_provider.go create mode 100644 lib/teleterm/clusters/dbcmd_cli_command_provider_test.go create mode 100644 lib/teleterm/gateway/gateway_test.go diff --git a/lib/client/db/dbcmd/dbcmd.go b/lib/client/db/dbcmd/dbcmd.go index bb9a20a6781da..82f22aa5637b0 100644 --- a/lib/client/db/dbcmd/dbcmd.go +++ b/lib/client/db/dbcmd/dbcmd.go @@ -61,9 +61,9 @@ const ( snowsqlBin = "snowsql" ) -// execer is an abstraction of Go's exec module, as this one doesn't specify any interfaces. +// Execer is an abstraction of Go's exec module, as this one doesn't specify any interfaces. // This interface exists only to enable mocking. -type execer interface { +type Execer interface { // RunCommand runs a system command. RunCommand(name string, arg ...string) ([]byte, error) // LookPath returns a full path to a binary if this one is found in system PATH, @@ -73,21 +73,21 @@ type execer interface { Command(name string, arg ...string) *exec.Cmd } -// systemExecer implements execer interface by using Go exec module. -type systemExecer struct{} +// SystemExecer implements execer interface by using Go exec module. +type SystemExecer struct{} // RunCommand is a wrapper for exec.Command(...).Output() -func (s systemExecer) RunCommand(name string, arg ...string) ([]byte, error) { +func (s SystemExecer) RunCommand(name string, arg ...string) ([]byte, error) { return exec.Command(name, arg...).Output() } // LookPath is a wrapper for exec.LookPath(...) -func (s systemExecer) LookPath(file string) (string, error) { +func (s SystemExecer) LookPath(file string) (string, error) { return exec.LookPath(file) } // Command is a wrapper for exec.Command(...) -func (s systemExecer) Command(name string, arg ...string) *exec.Cmd { +func (s SystemExecer) Command(name string, arg ...string) *exec.Cmd { return exec.Command(name, arg...) } @@ -103,8 +103,6 @@ type CLICommandBuilder struct { port int options connectionCommandOpts uid utils.UID - - exe execer } func NewCmdBuilder(tc *client.TeleportClient, profile *client.ProfileStatus, @@ -126,6 +124,10 @@ func NewCmdBuilder(tc *client.TeleportClient, profile *client.ProfileStatus, options.log = logrus.NewEntry(logrus.StandardLogger()) } + if options.exe == nil { + options.exe = &SystemExecer{} + } + return &CLICommandBuilder{ tc: tc, profile: profile, @@ -135,8 +137,6 @@ func NewCmdBuilder(tc *client.TeleportClient, profile *client.ProfileStatus, options: options, rootCluster: rootClusterName, uid: utils.NewRealUID(), - - exe: &systemExecer{}, } } @@ -198,17 +198,17 @@ func (c *CLICommandBuilder) GetConnectCommandNoAbsPath() (*exec.Cmd, error) { } func (c *CLICommandBuilder) getPostgresCommand() *exec.Cmd { - return c.exe.Command(postgresBin, c.getPostgresConnString()) + return c.options.exe.Command(postgresBin, c.getPostgresConnString()) } func (c *CLICommandBuilder) getCockroachCommand() *exec.Cmd { // If cockroach CLI client is not available, fallback to psql. - if _, err := c.exe.LookPath(cockroachBin); err != nil { + if _, err := c.options.exe.LookPath(cockroachBin); err != nil { c.options.log.Debugf("Couldn't find %q client in PATH, falling back to %q: %v.", cockroachBin, postgresBin, err) return c.getPostgresCommand() } - return c.exe.Command(cockroachBin, "sql", "--url", c.getPostgresConnString()) + return c.options.exe.Command(cockroachBin, "sql", "--url", c.getPostgresConnString()) } // getPostgresConnString returns the connection string for postgres. @@ -274,7 +274,7 @@ func (c *CLICommandBuilder) getMySQLOracleCommand() *exec.Cmd { args := c.getMySQLCommonCmdOpts() if c.options.noTLS { - return c.exe.Command(mysqlBin, args...) + return c.options.exe.Command(mysqlBin, args...) } // defaults-group-suffix must be first. @@ -286,7 +286,7 @@ func (c *CLICommandBuilder) getMySQLOracleCommand() *exec.Cmd { args = append(args, fmt.Sprintf("--ssl-mode=%s", mysql.MySQLSSLModeVerifyCA)) } - return c.exe.Command(mysqlBin, args...) + return c.options.exe.Command(mysqlBin, args...) } // getMySQLCommand returns mariadb command if the binary is on the path. Otherwise, @@ -295,7 +295,7 @@ func (c *CLICommandBuilder) getMySQLCommand() (*exec.Cmd, error) { // Check if mariadb client is available. Prefer it over mysql client even if connecting to MySQL server. if c.isMariaDBBinAvailable() { args := c.getMariaDBArgs() - return c.exe.Command(mariadbBin, args...), nil + return c.options.exe.Command(mariadbBin, args...), nil } // Check for mysql binary. In case the caller doesn't tolerate a missing CLI client, return with @@ -313,7 +313,7 @@ func (c *CLICommandBuilder) getMySQLCommand() (*exec.Cmd, error) { mySQLMariaDBFlavor, err := c.isMySQLBinMariaDBFlavor() if mySQLMariaDBFlavor && err == nil { args := c.getMariaDBArgs() - return c.exe.Command(mysqlBin, args...), nil + return c.options.exe.Command(mysqlBin, args...), nil } // Either we failed to check the flavor or binary comes from Oracle. Regardless return mysql/Oracle command. @@ -322,19 +322,19 @@ func (c *CLICommandBuilder) getMySQLCommand() (*exec.Cmd, error) { // isMariaDBBinAvailable returns true if "mariadb" binary is found in the system PATH. func (c *CLICommandBuilder) isMariaDBBinAvailable() bool { - _, err := c.exe.LookPath(mariadbBin) + _, err := c.options.exe.LookPath(mariadbBin) return err == nil } // isMySQLBinAvailable returns true if "mysql" binary is found in the system PATH. func (c *CLICommandBuilder) isMySQLBinAvailable() bool { - _, err := c.exe.LookPath(mysqlBin) + _, err := c.options.exe.LookPath(mysqlBin) return err == nil } // isMongoshBinAvailable returns true if "mongosh" binary is found in the system PATH. func (c *CLICommandBuilder) isMongoshBinAvailable() bool { - _, err := c.exe.LookPath(mongoshBin) + _, err := c.options.exe.LookPath(mongoshBin) return err == nil } @@ -342,7 +342,7 @@ func (c *CLICommandBuilder) isMongoshBinAvailable() bool { // true is returned when binary comes from MariaDB, false when from Oracle. func (c *CLICommandBuilder) isMySQLBinMariaDBFlavor() (bool, error) { // Check if mysql comes from Oracle or MariaDB - mysqlVer, err := c.exe.RunCommand(mysqlBin, "--version") + mysqlVer, err := c.options.exe.RunCommand(mysqlBin, "--version") if err != nil { // Looks like incorrect mysql installation. return false, trace.Wrap(err) @@ -405,11 +405,11 @@ func (c *CLICommandBuilder) getMongoCommand() *exec.Cmd { // use `mongosh` if available if hasMongosh { - return c.exe.Command(mongoshBin, args...) + return c.options.exe.Command(mongoshBin, args...) } // fall back to `mongo` if `mongosh` isn't found - return c.exe.Command(mongoBin, args...) + return c.options.exe.Command(mongoBin, args...) } func (c *CLICommandBuilder) getMongoAddress() string { @@ -467,7 +467,7 @@ func (c *CLICommandBuilder) getRedisCommand() *exec.Cmd { args = append(args, []string{"-n", c.db.Database}...) } - return c.exe.Command(redisBin, args...) + return c.options.exe.Command(redisBin, args...) } func (c *CLICommandBuilder) getSQLServerCommand() *exec.Cmd { @@ -484,7 +484,7 @@ func (c *CLICommandBuilder) getSQLServerCommand() *exec.Cmd { args = append(args, "-d", c.db.Database) } - return c.exe.Command(mssqlBin, args...) + return c.options.exe.Command(mssqlBin, args...) } func (c *CLICommandBuilder) getSnowflakeCommand() *exec.Cmd { @@ -513,6 +513,7 @@ type connectionCommandOpts struct { printFormat bool tolerateMissingCLIClient bool log *logrus.Entry + exe Execer } // ConnectCommandFunc is a type for functions returned by the "With*" functions in this package. @@ -586,6 +587,14 @@ func WithTolerateMissingCLIClient() ConnectCommandFunc { } } +// WithExecer allows to provide a different Execer than the default SystemExecer. Useful in contexts +// where there's a place that wants to use dbcmd with the ability to mock out SystemExecer in tests. +func WithExecer(exe Execer) ConnectCommandFunc { + return func(opts *connectionCommandOpts) { + opts.exe = exe + } +} + const ( // envVarMongoServerSelectionTimeoutMS is the environment variable that // controls the server selection timeout used for MongoDB clients. diff --git a/lib/client/db/dbcmd/dbcmd_test.go b/lib/client/db/dbcmd/dbcmd_test.go index 03d525046e9f0..ebaae9ec41b1c 100644 --- a/lib/client/db/dbcmd/dbcmd_test.go +++ b/lib/client/db/dbcmd/dbcmd_test.go @@ -494,11 +494,11 @@ func TestCLICommandBuilderGetConnectCommand(t *testing.T) { opts := append([]ConnectCommandFunc{ WithLocalProxy("localhost", 12345, ""), + WithExecer(tt.execer), }, tt.opts...) c := NewCmdBuilder(tc, profile, database, "root", opts...) c.uid = utils.NewFakeUID() - c.exe = tt.execer got, err := c.GetConnectCommand() if tt.wantErr { if err == nil { @@ -541,11 +541,11 @@ func TestGetConnectCommandNoAbsPathConvertsAbsolutePathToRelative(t *testing.T) opts := []ConnectCommandFunc{ WithLocalProxy("localhost", 12345, ""), WithNoTLS(), + WithExecer(&fakeExec{commandPathBehavior: forceAbsolutePath}), } c := NewCmdBuilder(tc, profile, database, "root", opts...) c.uid = utils.NewFakeUID() - c.exe = &fakeExec{commandPathBehavior: forceAbsolutePath} got, err := c.GetConnectCommandNoAbsPath() require.NoError(t, err) @@ -580,11 +580,11 @@ func TestGetConnectCommandNoAbsPathIsNoopWhenGivenRelativePath(t *testing.T) { opts := []ConnectCommandFunc{ WithLocalProxy("localhost", 12345, ""), WithNoTLS(), + WithExecer(&fakeExec{commandPathBehavior: forceBasePath}), } c := NewCmdBuilder(tc, profile, database, "root", opts...) c.uid = utils.NewFakeUID() - c.exe = &fakeExec{commandPathBehavior: forceBasePath} got, err := c.GetConnectCommandNoAbsPath() require.NoError(t, err) diff --git a/lib/teleterm/api/proto/v1/service.proto b/lib/teleterm/api/proto/v1/service.proto index a0b798aa29204..7844cde045f9f 100644 --- a/lib/teleterm/api/proto/v1/service.proto +++ b/lib/teleterm/api/proto/v1/service.proto @@ -37,26 +37,33 @@ service TerminalService { rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse); // ListDatabaseUsers lists allowed users for the given database based on the role set. rpc ListDatabaseUsers(ListDatabaseUsersRequest) returns (ListDatabaseUsersResponse); - // ListGateways lists gateways - rpc ListGateways(ListGatewaysRequest) returns (ListGatewaysResponse); // ListServers lists servers rpc ListServers(ListServersRequest) returns (ListServersResponse); // ListKubes list kubes rpc ListKubes(ListKubesRequest) returns (ListKubesResponse); // ListApps list apps rpc ListApps(ListAppsRequest) returns (ListAppsResponse); - // CreateGateway creates a gateway - rpc CreateGateway(CreateGatewayRequest) returns (Gateway); // AddCluster adds a cluster to profile rpc AddCluster(AddClusterRequest) returns (Cluster); // RemoveCluster removes a cluster from profile rpc RemoveCluster(RemoveClusterRequest) returns (EmptyResponse); + + // ListGateways lists gateways + rpc ListGateways(ListGatewaysRequest) returns (ListGatewaysResponse); + // CreateGateway creates a gateway + rpc CreateGateway(CreateGatewayRequest) returns (Gateway); // RemoveGateway removes a gateway rpc RemoveGateway(RemoveGatewayRequest) returns (EmptyResponse); // RestartGateway stops a gateway and starts a new with identical parameters, keeping the // original URI. A temporary workaround until it's possible to refresh certs in a running // database proxy. rpc RestartGateway(RestartGatewayRequest) returns (EmptyResponse); + // SetGatewayTargetSubresourceName changes the TargetSubresourceName field of gateway.Gateway + // and returns the updated version of gateway.Gateway. + // + // In Connect this is used to update the db name of a db connection along with the CLI command. + rpc SetGatewayTargetSubresourceName(SetGatewayTargetSubresourceNameRequest) returns (Gateway); + // GetAuthSettings returns cluster auth settigns rpc GetAuthSettings(GetAuthSettingsRequest) returns (AuthSettings); // GetCluster returns a cluster @@ -142,6 +149,11 @@ message RemoveGatewayRequest { string gateway_uri = 1; } message RestartGatewayRequest { string gateway_uri = 1; } +message SetGatewayTargetSubresourceNameRequest { + string gateway_uri = 1; + string target_subresource_name = 2; +} + message ListServersRequest { string cluster_uri = 1; } message ListServersResponse { repeated Server servers = 1; } diff --git a/lib/teleterm/api/protogen/golang/v1/service.pb.go b/lib/teleterm/api/protogen/golang/v1/service.pb.go index 36b72a702659a..2503de2dda2ef 100644 --- a/lib/teleterm/api/protogen/golang/v1/service.pb.go +++ b/lib/teleterm/api/protogen/golang/v1/service.pb.go @@ -1000,6 +1000,61 @@ func (x *RestartGatewayRequest) GetGatewayUri() string { return "" } +type SetGatewayTargetSubresourceNameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GatewayUri string `protobuf:"bytes,1,opt,name=gateway_uri,json=gatewayUri,proto3" json:"gateway_uri,omitempty"` + TargetSubresourceName string `protobuf:"bytes,2,opt,name=target_subresource_name,json=targetSubresourceName,proto3" json:"target_subresource_name,omitempty"` +} + +func (x *SetGatewayTargetSubresourceNameRequest) Reset() { + *x = SetGatewayTargetSubresourceNameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetGatewayTargetSubresourceNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetGatewayTargetSubresourceNameRequest) ProtoMessage() {} + +func (x *SetGatewayTargetSubresourceNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[19] + 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 SetGatewayTargetSubresourceNameRequest.ProtoReflect.Descriptor instead. +func (*SetGatewayTargetSubresourceNameRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{19} +} + +func (x *SetGatewayTargetSubresourceNameRequest) GetGatewayUri() string { + if x != nil { + return x.GatewayUri + } + return "" +} + +func (x *SetGatewayTargetSubresourceNameRequest) GetTargetSubresourceName() string { + if x != nil { + return x.TargetSubresourceName + } + return "" +} + type ListServersRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1011,7 +1066,7 @@ type ListServersRequest struct { func (x *ListServersRequest) Reset() { *x = ListServersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[19] + mi := &file_v1_service_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1024,7 +1079,7 @@ func (x *ListServersRequest) String() string { func (*ListServersRequest) ProtoMessage() {} func (x *ListServersRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[19] + mi := &file_v1_service_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1037,7 +1092,7 @@ func (x *ListServersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListServersRequest.ProtoReflect.Descriptor instead. func (*ListServersRequest) Descriptor() ([]byte, []int) { - return file_v1_service_proto_rawDescGZIP(), []int{19} + return file_v1_service_proto_rawDescGZIP(), []int{20} } func (x *ListServersRequest) GetClusterUri() string { @@ -1058,7 +1113,7 @@ type ListServersResponse struct { func (x *ListServersResponse) Reset() { *x = ListServersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[20] + mi := &file_v1_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1071,7 +1126,7 @@ func (x *ListServersResponse) String() string { func (*ListServersResponse) ProtoMessage() {} func (x *ListServersResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[20] + mi := &file_v1_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1084,7 +1139,7 @@ func (x *ListServersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListServersResponse.ProtoReflect.Descriptor instead. func (*ListServersResponse) Descriptor() ([]byte, []int) { - return file_v1_service_proto_rawDescGZIP(), []int{20} + return file_v1_service_proto_rawDescGZIP(), []int{21} } func (x *ListServersResponse) GetServers() []*Server { @@ -1105,7 +1160,7 @@ type ListKubesResponse struct { func (x *ListKubesResponse) Reset() { *x = ListKubesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[21] + mi := &file_v1_service_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1118,7 +1173,7 @@ func (x *ListKubesResponse) String() string { func (*ListKubesResponse) ProtoMessage() {} func (x *ListKubesResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[21] + mi := &file_v1_service_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1131,7 +1186,7 @@ func (x *ListKubesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListKubesResponse.ProtoReflect.Descriptor instead. func (*ListKubesResponse) Descriptor() ([]byte, []int) { - return file_v1_service_proto_rawDescGZIP(), []int{21} + return file_v1_service_proto_rawDescGZIP(), []int{22} } func (x *ListKubesResponse) GetKubes() []*Kube { @@ -1152,7 +1207,7 @@ type ListAppsResponse struct { func (x *ListAppsResponse) Reset() { *x = ListAppsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[22] + mi := &file_v1_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1165,7 +1220,7 @@ func (x *ListAppsResponse) String() string { func (*ListAppsResponse) ProtoMessage() {} func (x *ListAppsResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[22] + mi := &file_v1_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1178,7 +1233,7 @@ func (x *ListAppsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAppsResponse.ProtoReflect.Descriptor instead. func (*ListAppsResponse) Descriptor() ([]byte, []int) { - return file_v1_service_proto_rawDescGZIP(), []int{22} + return file_v1_service_proto_rawDescGZIP(), []int{23} } func (x *ListAppsResponse) GetApps() []*App { @@ -1199,7 +1254,7 @@ type GetAuthSettingsRequest struct { func (x *GetAuthSettingsRequest) Reset() { *x = GetAuthSettingsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[23] + mi := &file_v1_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1212,7 +1267,7 @@ func (x *GetAuthSettingsRequest) String() string { func (*GetAuthSettingsRequest) ProtoMessage() {} func (x *GetAuthSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[23] + mi := &file_v1_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1225,7 +1280,7 @@ func (x *GetAuthSettingsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAuthSettingsRequest.ProtoReflect.Descriptor instead. func (*GetAuthSettingsRequest) Descriptor() ([]byte, []int) { - return file_v1_service_proto_rawDescGZIP(), []int{23} + return file_v1_service_proto_rawDescGZIP(), []int{24} } func (x *GetAuthSettingsRequest) GetClusterUri() string { @@ -1244,7 +1299,7 @@ type EmptyResponse struct { func (x *EmptyResponse) Reset() { *x = EmptyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[24] + mi := &file_v1_service_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1257,7 +1312,7 @@ func (x *EmptyResponse) String() string { func (*EmptyResponse) ProtoMessage() {} func (x *EmptyResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[24] + mi := &file_v1_service_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1270,7 +1325,7 @@ func (x *EmptyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead. func (*EmptyResponse) Descriptor() ([]byte, []int) { - return file_v1_service_proto_rawDescGZIP(), []int{24} + return file_v1_service_proto_rawDescGZIP(), []int{25} } // LocalParams describes parameters for local user logins @@ -1290,7 +1345,7 @@ type LoginRequest_LocalParams struct { func (x *LoginRequest_LocalParams) Reset() { *x = LoginRequest_LocalParams{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[25] + mi := &file_v1_service_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1303,7 +1358,7 @@ func (x *LoginRequest_LocalParams) String() string { func (*LoginRequest_LocalParams) ProtoMessage() {} func (x *LoginRequest_LocalParams) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[25] + mi := &file_v1_service_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1355,7 +1410,7 @@ type LoginRequest_SsoParams struct { func (x *LoginRequest_SsoParams) Reset() { *x = LoginRequest_SsoParams{} if protoimpl.UnsafeEnabled { - mi := &file_v1_service_proto_msgTypes[26] + mi := &file_v1_service_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1368,7 +1423,7 @@ func (x *LoginRequest_SsoParams) String() string { func (*LoginRequest_SsoParams) ProtoMessage() {} func (x *LoginRequest_SsoParams) ProtoReflect() protoreflect.Message { - mi := &file_v1_service_proto_msgTypes[26] + mi := &file_v1_service_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1508,137 +1563,153 @@ var file_v1_service_proto_rawDesc = []byte{ 0x72, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x72, - 0x69, 0x22, 0x35, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x55, 0x72, 0x69, 0x22, 0x4d, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x36, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x07, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x45, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4b, - 0x75, 0x62, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, - 0x6b, 0x75, 0x62, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, - 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x52, 0x05, 0x6b, 0x75, 0x62, 0x65, 0x73, 0x22, 0x41, - 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x61, 0x70, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x04, 0x61, 0x70, 0x70, - 0x73, 0x22, 0x39, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x69, 0x22, 0x81, 0x01, 0x0a, 0x26, 0x53, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x75, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x55, 0x72, 0x69, 0x12, 0x36, 0x0a, + 0x17, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x75, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x35, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x55, 0x72, 0x69, 0x22, 0x0f, 0x0a, 0x0d, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8a, 0x0d, - 0x0a, 0x0f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x69, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x10, - 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x65, 0x61, 0x66, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x12, 0x2d, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x65, 0x61, 0x66, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0d, 0x4c, - 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x74, + 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x55, 0x72, 0x69, 0x22, 0x4d, 0x0a, 0x13, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x45, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x30, 0x0a, 0x05, 0x6b, 0x75, 0x62, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x52, 0x05, 0x6b, 0x75, 0x62, + 0x65, 0x73, 0x22, 0x41, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x61, 0x70, 0x70, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x52, + 0x04, 0x61, 0x70, 0x70, 0x73, 0x22, 0x39, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x55, 0x72, 0x69, + 0x22, 0x0f, 0x0a, 0x0d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x8a, 0x0e, 0x0a, 0x0f, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6f, + 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6d, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x65, 0x61, 0x66, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x4c, 0x65, 0x61, 0x66, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x68, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, + 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, 0x11, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2e, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x62, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x28, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2e, 0x2e, 0x74, 0x65, 0x6c, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x74, 0x65, 0x6c, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x73, + 0x12, 0x26, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x59, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x12, 0x25, 0x2e, + 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x0a, + 0x41, 0x64, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x0c, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x12, 0x29, 0x2e, 0x74, 0x65, - 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x12, 0x28, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x65, - 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, - 0x62, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, - 0x75, 0x62, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x65, - 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, - 0x12, 0x25, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5a, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, + 0x31, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x60, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x73, 0x12, 0x29, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x54, 0x0a, 0x0a, 0x41, - 0x64, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x12, 0x60, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, - 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x60, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x2e, 0x74, - 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x65, 0x6c, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, - 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x74, - 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x22, 0x2e, - 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, - 0x12, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x52, 0x65, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2b, 0x2e, 0x74, 0x65, + 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7e, 0x0a, + 0x1f, 0x53, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x53, 0x75, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x3c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x75, 0x62, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x63, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x2c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, + 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x54, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x12, 0x27, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x22, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 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, - 0x6c, 0x69, 0x62, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x06, 0x4c, 0x6f, + 0x67, 0x6f, 0x75, 0x74, 0x12, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, + 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x6c, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, + 0x5a, 0x31, 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, 0x6c, 0x69, 0x62, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x72, 0x6d, + 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1653,88 +1724,91 @@ func file_v1_service_proto_rawDescGZIP() []byte { return file_v1_service_proto_rawDescData } -var file_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_v1_service_proto_goTypes = []interface{}{ - (*RemoveClusterRequest)(nil), // 0: teleport.terminal.v1.RemoveClusterRequest - (*GetClusterRequest)(nil), // 1: teleport.terminal.v1.GetClusterRequest - (*LogoutRequest)(nil), // 2: teleport.terminal.v1.LogoutRequest - (*LoginRequest)(nil), // 3: teleport.terminal.v1.LoginRequest - (*AddClusterRequest)(nil), // 4: teleport.terminal.v1.AddClusterRequest - (*ListKubesRequest)(nil), // 5: teleport.terminal.v1.ListKubesRequest - (*ListAppsRequest)(nil), // 6: teleport.terminal.v1.ListAppsRequest - (*ListClustersRequest)(nil), // 7: teleport.terminal.v1.ListClustersRequest - (*ListClustersResponse)(nil), // 8: teleport.terminal.v1.ListClustersResponse - (*ListDatabasesRequest)(nil), // 9: teleport.terminal.v1.ListDatabasesRequest - (*ListLeafClustersRequest)(nil), // 10: teleport.terminal.v1.ListLeafClustersRequest - (*ListDatabasesResponse)(nil), // 11: teleport.terminal.v1.ListDatabasesResponse - (*ListDatabaseUsersRequest)(nil), // 12: teleport.terminal.v1.ListDatabaseUsersRequest - (*ListDatabaseUsersResponse)(nil), // 13: teleport.terminal.v1.ListDatabaseUsersResponse - (*CreateGatewayRequest)(nil), // 14: teleport.terminal.v1.CreateGatewayRequest - (*ListGatewaysRequest)(nil), // 15: teleport.terminal.v1.ListGatewaysRequest - (*ListGatewaysResponse)(nil), // 16: teleport.terminal.v1.ListGatewaysResponse - (*RemoveGatewayRequest)(nil), // 17: teleport.terminal.v1.RemoveGatewayRequest - (*RestartGatewayRequest)(nil), // 18: teleport.terminal.v1.RestartGatewayRequest - (*ListServersRequest)(nil), // 19: teleport.terminal.v1.ListServersRequest - (*ListServersResponse)(nil), // 20: teleport.terminal.v1.ListServersResponse - (*ListKubesResponse)(nil), // 21: teleport.terminal.v1.ListKubesResponse - (*ListAppsResponse)(nil), // 22: teleport.terminal.v1.ListAppsResponse - (*GetAuthSettingsRequest)(nil), // 23: teleport.terminal.v1.GetAuthSettingsRequest - (*EmptyResponse)(nil), // 24: teleport.terminal.v1.EmptyResponse - (*LoginRequest_LocalParams)(nil), // 25: teleport.terminal.v1.LoginRequest.LocalParams - (*LoginRequest_SsoParams)(nil), // 26: teleport.terminal.v1.LoginRequest.SsoParams - (*Cluster)(nil), // 27: teleport.terminal.v1.Cluster - (*Database)(nil), // 28: teleport.terminal.v1.Database - (*Gateway)(nil), // 29: teleport.terminal.v1.Gateway - (*Server)(nil), // 30: teleport.terminal.v1.Server - (*Kube)(nil), // 31: teleport.terminal.v1.Kube - (*App)(nil), // 32: teleport.terminal.v1.App - (*AuthSettings)(nil), // 33: teleport.terminal.v1.AuthSettings + (*RemoveClusterRequest)(nil), // 0: teleport.terminal.v1.RemoveClusterRequest + (*GetClusterRequest)(nil), // 1: teleport.terminal.v1.GetClusterRequest + (*LogoutRequest)(nil), // 2: teleport.terminal.v1.LogoutRequest + (*LoginRequest)(nil), // 3: teleport.terminal.v1.LoginRequest + (*AddClusterRequest)(nil), // 4: teleport.terminal.v1.AddClusterRequest + (*ListKubesRequest)(nil), // 5: teleport.terminal.v1.ListKubesRequest + (*ListAppsRequest)(nil), // 6: teleport.terminal.v1.ListAppsRequest + (*ListClustersRequest)(nil), // 7: teleport.terminal.v1.ListClustersRequest + (*ListClustersResponse)(nil), // 8: teleport.terminal.v1.ListClustersResponse + (*ListDatabasesRequest)(nil), // 9: teleport.terminal.v1.ListDatabasesRequest + (*ListLeafClustersRequest)(nil), // 10: teleport.terminal.v1.ListLeafClustersRequest + (*ListDatabasesResponse)(nil), // 11: teleport.terminal.v1.ListDatabasesResponse + (*ListDatabaseUsersRequest)(nil), // 12: teleport.terminal.v1.ListDatabaseUsersRequest + (*ListDatabaseUsersResponse)(nil), // 13: teleport.terminal.v1.ListDatabaseUsersResponse + (*CreateGatewayRequest)(nil), // 14: teleport.terminal.v1.CreateGatewayRequest + (*ListGatewaysRequest)(nil), // 15: teleport.terminal.v1.ListGatewaysRequest + (*ListGatewaysResponse)(nil), // 16: teleport.terminal.v1.ListGatewaysResponse + (*RemoveGatewayRequest)(nil), // 17: teleport.terminal.v1.RemoveGatewayRequest + (*RestartGatewayRequest)(nil), // 18: teleport.terminal.v1.RestartGatewayRequest + (*SetGatewayTargetSubresourceNameRequest)(nil), // 19: teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest + (*ListServersRequest)(nil), // 20: teleport.terminal.v1.ListServersRequest + (*ListServersResponse)(nil), // 21: teleport.terminal.v1.ListServersResponse + (*ListKubesResponse)(nil), // 22: teleport.terminal.v1.ListKubesResponse + (*ListAppsResponse)(nil), // 23: teleport.terminal.v1.ListAppsResponse + (*GetAuthSettingsRequest)(nil), // 24: teleport.terminal.v1.GetAuthSettingsRequest + (*EmptyResponse)(nil), // 25: teleport.terminal.v1.EmptyResponse + (*LoginRequest_LocalParams)(nil), // 26: teleport.terminal.v1.LoginRequest.LocalParams + (*LoginRequest_SsoParams)(nil), // 27: teleport.terminal.v1.LoginRequest.SsoParams + (*Cluster)(nil), // 28: teleport.terminal.v1.Cluster + (*Database)(nil), // 29: teleport.terminal.v1.Database + (*Gateway)(nil), // 30: teleport.terminal.v1.Gateway + (*Server)(nil), // 31: teleport.terminal.v1.Server + (*Kube)(nil), // 32: teleport.terminal.v1.Kube + (*App)(nil), // 33: teleport.terminal.v1.App + (*AuthSettings)(nil), // 34: teleport.terminal.v1.AuthSettings } var file_v1_service_proto_depIdxs = []int32{ - 25, // 0: teleport.terminal.v1.LoginRequest.local:type_name -> teleport.terminal.v1.LoginRequest.LocalParams - 26, // 1: teleport.terminal.v1.LoginRequest.sso:type_name -> teleport.terminal.v1.LoginRequest.SsoParams - 27, // 2: teleport.terminal.v1.ListClustersResponse.clusters:type_name -> teleport.terminal.v1.Cluster - 28, // 3: teleport.terminal.v1.ListDatabasesResponse.databases:type_name -> teleport.terminal.v1.Database - 29, // 4: teleport.terminal.v1.ListGatewaysResponse.gateways:type_name -> teleport.terminal.v1.Gateway - 30, // 5: teleport.terminal.v1.ListServersResponse.servers:type_name -> teleport.terminal.v1.Server - 31, // 6: teleport.terminal.v1.ListKubesResponse.kubes:type_name -> teleport.terminal.v1.Kube - 32, // 7: teleport.terminal.v1.ListAppsResponse.apps:type_name -> teleport.terminal.v1.App + 26, // 0: teleport.terminal.v1.LoginRequest.local:type_name -> teleport.terminal.v1.LoginRequest.LocalParams + 27, // 1: teleport.terminal.v1.LoginRequest.sso:type_name -> teleport.terminal.v1.LoginRequest.SsoParams + 28, // 2: teleport.terminal.v1.ListClustersResponse.clusters:type_name -> teleport.terminal.v1.Cluster + 29, // 3: teleport.terminal.v1.ListDatabasesResponse.databases:type_name -> teleport.terminal.v1.Database + 30, // 4: teleport.terminal.v1.ListGatewaysResponse.gateways:type_name -> teleport.terminal.v1.Gateway + 31, // 5: teleport.terminal.v1.ListServersResponse.servers:type_name -> teleport.terminal.v1.Server + 32, // 6: teleport.terminal.v1.ListKubesResponse.kubes:type_name -> teleport.terminal.v1.Kube + 33, // 7: teleport.terminal.v1.ListAppsResponse.apps:type_name -> teleport.terminal.v1.App 7, // 8: teleport.terminal.v1.TerminalService.ListRootClusters:input_type -> teleport.terminal.v1.ListClustersRequest 10, // 9: teleport.terminal.v1.TerminalService.ListLeafClusters:input_type -> teleport.terminal.v1.ListLeafClustersRequest 9, // 10: teleport.terminal.v1.TerminalService.ListDatabases:input_type -> teleport.terminal.v1.ListDatabasesRequest 12, // 11: teleport.terminal.v1.TerminalService.ListDatabaseUsers:input_type -> teleport.terminal.v1.ListDatabaseUsersRequest - 15, // 12: teleport.terminal.v1.TerminalService.ListGateways:input_type -> teleport.terminal.v1.ListGatewaysRequest - 19, // 13: teleport.terminal.v1.TerminalService.ListServers:input_type -> teleport.terminal.v1.ListServersRequest - 5, // 14: teleport.terminal.v1.TerminalService.ListKubes:input_type -> teleport.terminal.v1.ListKubesRequest - 6, // 15: teleport.terminal.v1.TerminalService.ListApps:input_type -> teleport.terminal.v1.ListAppsRequest - 14, // 16: teleport.terminal.v1.TerminalService.CreateGateway:input_type -> teleport.terminal.v1.CreateGatewayRequest - 4, // 17: teleport.terminal.v1.TerminalService.AddCluster:input_type -> teleport.terminal.v1.AddClusterRequest - 0, // 18: teleport.terminal.v1.TerminalService.RemoveCluster:input_type -> teleport.terminal.v1.RemoveClusterRequest + 20, // 12: teleport.terminal.v1.TerminalService.ListServers:input_type -> teleport.terminal.v1.ListServersRequest + 5, // 13: teleport.terminal.v1.TerminalService.ListKubes:input_type -> teleport.terminal.v1.ListKubesRequest + 6, // 14: teleport.terminal.v1.TerminalService.ListApps:input_type -> teleport.terminal.v1.ListAppsRequest + 4, // 15: teleport.terminal.v1.TerminalService.AddCluster:input_type -> teleport.terminal.v1.AddClusterRequest + 0, // 16: teleport.terminal.v1.TerminalService.RemoveCluster:input_type -> teleport.terminal.v1.RemoveClusterRequest + 15, // 17: teleport.terminal.v1.TerminalService.ListGateways:input_type -> teleport.terminal.v1.ListGatewaysRequest + 14, // 18: teleport.terminal.v1.TerminalService.CreateGateway:input_type -> teleport.terminal.v1.CreateGatewayRequest 17, // 19: teleport.terminal.v1.TerminalService.RemoveGateway:input_type -> teleport.terminal.v1.RemoveGatewayRequest 18, // 20: teleport.terminal.v1.TerminalService.RestartGateway:input_type -> teleport.terminal.v1.RestartGatewayRequest - 23, // 21: teleport.terminal.v1.TerminalService.GetAuthSettings:input_type -> teleport.terminal.v1.GetAuthSettingsRequest - 1, // 22: teleport.terminal.v1.TerminalService.GetCluster:input_type -> teleport.terminal.v1.GetClusterRequest - 3, // 23: teleport.terminal.v1.TerminalService.Login:input_type -> teleport.terminal.v1.LoginRequest - 2, // 24: teleport.terminal.v1.TerminalService.Logout:input_type -> teleport.terminal.v1.LogoutRequest - 8, // 25: teleport.terminal.v1.TerminalService.ListRootClusters:output_type -> teleport.terminal.v1.ListClustersResponse - 8, // 26: teleport.terminal.v1.TerminalService.ListLeafClusters:output_type -> teleport.terminal.v1.ListClustersResponse - 11, // 27: teleport.terminal.v1.TerminalService.ListDatabases:output_type -> teleport.terminal.v1.ListDatabasesResponse - 13, // 28: teleport.terminal.v1.TerminalService.ListDatabaseUsers:output_type -> teleport.terminal.v1.ListDatabaseUsersResponse - 16, // 29: teleport.terminal.v1.TerminalService.ListGateways:output_type -> teleport.terminal.v1.ListGatewaysResponse - 20, // 30: teleport.terminal.v1.TerminalService.ListServers:output_type -> teleport.terminal.v1.ListServersResponse - 21, // 31: teleport.terminal.v1.TerminalService.ListKubes:output_type -> teleport.terminal.v1.ListKubesResponse - 22, // 32: teleport.terminal.v1.TerminalService.ListApps:output_type -> teleport.terminal.v1.ListAppsResponse - 29, // 33: teleport.terminal.v1.TerminalService.CreateGateway:output_type -> teleport.terminal.v1.Gateway - 27, // 34: teleport.terminal.v1.TerminalService.AddCluster:output_type -> teleport.terminal.v1.Cluster - 24, // 35: teleport.terminal.v1.TerminalService.RemoveCluster:output_type -> teleport.terminal.v1.EmptyResponse - 24, // 36: teleport.terminal.v1.TerminalService.RemoveGateway:output_type -> teleport.terminal.v1.EmptyResponse - 24, // 37: teleport.terminal.v1.TerminalService.RestartGateway:output_type -> teleport.terminal.v1.EmptyResponse - 33, // 38: teleport.terminal.v1.TerminalService.GetAuthSettings:output_type -> teleport.terminal.v1.AuthSettings - 27, // 39: teleport.terminal.v1.TerminalService.GetCluster:output_type -> teleport.terminal.v1.Cluster - 24, // 40: teleport.terminal.v1.TerminalService.Login:output_type -> teleport.terminal.v1.EmptyResponse - 24, // 41: teleport.terminal.v1.TerminalService.Logout:output_type -> teleport.terminal.v1.EmptyResponse - 25, // [25:42] is the sub-list for method output_type - 8, // [8:25] is the sub-list for method input_type + 19, // 21: teleport.terminal.v1.TerminalService.SetGatewayTargetSubresourceName:input_type -> teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest + 24, // 22: teleport.terminal.v1.TerminalService.GetAuthSettings:input_type -> teleport.terminal.v1.GetAuthSettingsRequest + 1, // 23: teleport.terminal.v1.TerminalService.GetCluster:input_type -> teleport.terminal.v1.GetClusterRequest + 3, // 24: teleport.terminal.v1.TerminalService.Login:input_type -> teleport.terminal.v1.LoginRequest + 2, // 25: teleport.terminal.v1.TerminalService.Logout:input_type -> teleport.terminal.v1.LogoutRequest + 8, // 26: teleport.terminal.v1.TerminalService.ListRootClusters:output_type -> teleport.terminal.v1.ListClustersResponse + 8, // 27: teleport.terminal.v1.TerminalService.ListLeafClusters:output_type -> teleport.terminal.v1.ListClustersResponse + 11, // 28: teleport.terminal.v1.TerminalService.ListDatabases:output_type -> teleport.terminal.v1.ListDatabasesResponse + 13, // 29: teleport.terminal.v1.TerminalService.ListDatabaseUsers:output_type -> teleport.terminal.v1.ListDatabaseUsersResponse + 21, // 30: teleport.terminal.v1.TerminalService.ListServers:output_type -> teleport.terminal.v1.ListServersResponse + 22, // 31: teleport.terminal.v1.TerminalService.ListKubes:output_type -> teleport.terminal.v1.ListKubesResponse + 23, // 32: teleport.terminal.v1.TerminalService.ListApps:output_type -> teleport.terminal.v1.ListAppsResponse + 28, // 33: teleport.terminal.v1.TerminalService.AddCluster:output_type -> teleport.terminal.v1.Cluster + 25, // 34: teleport.terminal.v1.TerminalService.RemoveCluster:output_type -> teleport.terminal.v1.EmptyResponse + 16, // 35: teleport.terminal.v1.TerminalService.ListGateways:output_type -> teleport.terminal.v1.ListGatewaysResponse + 30, // 36: teleport.terminal.v1.TerminalService.CreateGateway:output_type -> teleport.terminal.v1.Gateway + 25, // 37: teleport.terminal.v1.TerminalService.RemoveGateway:output_type -> teleport.terminal.v1.EmptyResponse + 25, // 38: teleport.terminal.v1.TerminalService.RestartGateway:output_type -> teleport.terminal.v1.EmptyResponse + 30, // 39: teleport.terminal.v1.TerminalService.SetGatewayTargetSubresourceName:output_type -> teleport.terminal.v1.Gateway + 34, // 40: teleport.terminal.v1.TerminalService.GetAuthSettings:output_type -> teleport.terminal.v1.AuthSettings + 28, // 41: teleport.terminal.v1.TerminalService.GetCluster:output_type -> teleport.terminal.v1.Cluster + 25, // 42: teleport.terminal.v1.TerminalService.Login:output_type -> teleport.terminal.v1.EmptyResponse + 25, // 43: teleport.terminal.v1.TerminalService.Logout:output_type -> teleport.terminal.v1.EmptyResponse + 26, // [26:44] is the sub-list for method output_type + 8, // [8:26] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name 8, // [8:8] is the sub-list for extension extendee 0, // [0:8] is the sub-list for field type_name @@ -1982,7 +2056,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListServersRequest); i { + switch v := v.(*SetGatewayTargetSubresourceNameRequest); i { case 0: return &v.state case 1: @@ -1994,7 +2068,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListServersResponse); i { + switch v := v.(*ListServersRequest); i { case 0: return &v.state case 1: @@ -2006,7 +2080,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKubesResponse); i { + switch v := v.(*ListServersResponse); i { case 0: return &v.state case 1: @@ -2018,7 +2092,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAppsResponse); i { + switch v := v.(*ListKubesResponse); i { case 0: return &v.state case 1: @@ -2030,7 +2104,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAuthSettingsRequest); i { + switch v := v.(*ListAppsResponse); i { case 0: return &v.state case 1: @@ -2042,7 +2116,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyResponse); i { + switch v := v.(*GetAuthSettingsRequest); i { case 0: return &v.state case 1: @@ -2054,7 +2128,7 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginRequest_LocalParams); i { + switch v := v.(*EmptyResponse); i { case 0: return &v.state case 1: @@ -2066,6 +2140,18 @@ func file_v1_service_proto_init() { } } file_v1_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest_LocalParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginRequest_SsoParams); i { case 0: return &v.state @@ -2088,7 +2174,7 @@ func file_v1_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_service_proto_rawDesc, NumEnums: 0, - NumMessages: 27, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, @@ -2122,26 +2208,31 @@ type TerminalServiceClient interface { ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) // ListDatabaseUsers lists allowed users for the given database based on the role set. ListDatabaseUsers(ctx context.Context, in *ListDatabaseUsersRequest, opts ...grpc.CallOption) (*ListDatabaseUsersResponse, error) - // ListGateways lists gateways - ListGateways(ctx context.Context, in *ListGatewaysRequest, opts ...grpc.CallOption) (*ListGatewaysResponse, error) // ListServers lists servers ListServers(ctx context.Context, in *ListServersRequest, opts ...grpc.CallOption) (*ListServersResponse, error) // ListKubes list kubes ListKubes(ctx context.Context, in *ListKubesRequest, opts ...grpc.CallOption) (*ListKubesResponse, error) // ListApps list apps ListApps(ctx context.Context, in *ListAppsRequest, opts ...grpc.CallOption) (*ListAppsResponse, error) - // CreateGateway creates a gateway - CreateGateway(ctx context.Context, in *CreateGatewayRequest, opts ...grpc.CallOption) (*Gateway, error) // AddCluster adds a cluster to profile AddCluster(ctx context.Context, in *AddClusterRequest, opts ...grpc.CallOption) (*Cluster, error) // RemoveCluster removes a cluster from profile RemoveCluster(ctx context.Context, in *RemoveClusterRequest, opts ...grpc.CallOption) (*EmptyResponse, error) + // ListGateways lists gateways + ListGateways(ctx context.Context, in *ListGatewaysRequest, opts ...grpc.CallOption) (*ListGatewaysResponse, error) + // CreateGateway creates a gateway + CreateGateway(ctx context.Context, in *CreateGatewayRequest, opts ...grpc.CallOption) (*Gateway, error) // RemoveGateway removes a gateway RemoveGateway(ctx context.Context, in *RemoveGatewayRequest, opts ...grpc.CallOption) (*EmptyResponse, error) // RestartGateway stops a gateway and starts a new with identical parameters, keeping the // original URI. A temporary workaround until it's possible to refresh certs in a running // database proxy. RestartGateway(ctx context.Context, in *RestartGatewayRequest, opts ...grpc.CallOption) (*EmptyResponse, error) + // SetGatewayTargetSubresourceName changes the TargetSubresourceName field of gateway.Gateway + // and returns the updated version of gateway.Gateway. + // + // In Connect this is used to update the db name of a db connection along with the CLI command. + SetGatewayTargetSubresourceName(ctx context.Context, in *SetGatewayTargetSubresourceNameRequest, opts ...grpc.CallOption) (*Gateway, error) // GetAuthSettings returns cluster auth settigns GetAuthSettings(ctx context.Context, in *GetAuthSettingsRequest, opts ...grpc.CallOption) (*AuthSettings, error) // GetCluster returns a cluster @@ -2196,15 +2287,6 @@ func (c *terminalServiceClient) ListDatabaseUsers(ctx context.Context, in *ListD return out, nil } -func (c *terminalServiceClient) ListGateways(ctx context.Context, in *ListGatewaysRequest, opts ...grpc.CallOption) (*ListGatewaysResponse, error) { - out := new(ListGatewaysResponse) - err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListGateways", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *terminalServiceClient) ListServers(ctx context.Context, in *ListServersRequest, opts ...grpc.CallOption) (*ListServersResponse, error) { out := new(ListServersResponse) err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListServers", in, out, opts...) @@ -2232,15 +2314,6 @@ func (c *terminalServiceClient) ListApps(ctx context.Context, in *ListAppsReques return out, nil } -func (c *terminalServiceClient) CreateGateway(ctx context.Context, in *CreateGatewayRequest, opts ...grpc.CallOption) (*Gateway, error) { - out := new(Gateway) - err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/CreateGateway", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *terminalServiceClient) AddCluster(ctx context.Context, in *AddClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { out := new(Cluster) err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/AddCluster", in, out, opts...) @@ -2259,6 +2332,24 @@ func (c *terminalServiceClient) RemoveCluster(ctx context.Context, in *RemoveClu return out, nil } +func (c *terminalServiceClient) ListGateways(ctx context.Context, in *ListGatewaysRequest, opts ...grpc.CallOption) (*ListGatewaysResponse, error) { + out := new(ListGatewaysResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListGateways", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) CreateGateway(ctx context.Context, in *CreateGatewayRequest, opts ...grpc.CallOption) (*Gateway, error) { + out := new(Gateway) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/CreateGateway", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *terminalServiceClient) RemoveGateway(ctx context.Context, in *RemoveGatewayRequest, opts ...grpc.CallOption) (*EmptyResponse, error) { out := new(EmptyResponse) err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/RemoveGateway", in, out, opts...) @@ -2277,6 +2368,15 @@ func (c *terminalServiceClient) RestartGateway(ctx context.Context, in *RestartG return out, nil } +func (c *terminalServiceClient) SetGatewayTargetSubresourceName(ctx context.Context, in *SetGatewayTargetSubresourceNameRequest, opts ...grpc.CallOption) (*Gateway, error) { + out := new(Gateway) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/SetGatewayTargetSubresourceName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *terminalServiceClient) GetAuthSettings(ctx context.Context, in *GetAuthSettingsRequest, opts ...grpc.CallOption) (*AuthSettings, error) { out := new(AuthSettings) err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/GetAuthSettings", in, out, opts...) @@ -2323,26 +2423,31 @@ type TerminalServiceServer interface { ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error) // ListDatabaseUsers lists allowed users for the given database based on the role set. ListDatabaseUsers(context.Context, *ListDatabaseUsersRequest) (*ListDatabaseUsersResponse, error) - // ListGateways lists gateways - ListGateways(context.Context, *ListGatewaysRequest) (*ListGatewaysResponse, error) // ListServers lists servers ListServers(context.Context, *ListServersRequest) (*ListServersResponse, error) // ListKubes list kubes ListKubes(context.Context, *ListKubesRequest) (*ListKubesResponse, error) // ListApps list apps ListApps(context.Context, *ListAppsRequest) (*ListAppsResponse, error) - // CreateGateway creates a gateway - CreateGateway(context.Context, *CreateGatewayRequest) (*Gateway, error) // AddCluster adds a cluster to profile AddCluster(context.Context, *AddClusterRequest) (*Cluster, error) // RemoveCluster removes a cluster from profile RemoveCluster(context.Context, *RemoveClusterRequest) (*EmptyResponse, error) + // ListGateways lists gateways + ListGateways(context.Context, *ListGatewaysRequest) (*ListGatewaysResponse, error) + // CreateGateway creates a gateway + CreateGateway(context.Context, *CreateGatewayRequest) (*Gateway, error) // RemoveGateway removes a gateway RemoveGateway(context.Context, *RemoveGatewayRequest) (*EmptyResponse, error) // RestartGateway stops a gateway and starts a new with identical parameters, keeping the // original URI. A temporary workaround until it's possible to refresh certs in a running // database proxy. RestartGateway(context.Context, *RestartGatewayRequest) (*EmptyResponse, error) + // SetGatewayTargetSubresourceName changes the TargetSubresourceName field of gateway.Gateway + // and returns the updated version of gateway.Gateway. + // + // In Connect this is used to update the db name of a db connection along with the CLI command. + SetGatewayTargetSubresourceName(context.Context, *SetGatewayTargetSubresourceNameRequest) (*Gateway, error) // GetAuthSettings returns cluster auth settigns GetAuthSettings(context.Context, *GetAuthSettingsRequest) (*AuthSettings, error) // GetCluster returns a cluster @@ -2369,9 +2474,6 @@ func (*UnimplementedTerminalServiceServer) ListDatabases(context.Context, *ListD func (*UnimplementedTerminalServiceServer) ListDatabaseUsers(context.Context, *ListDatabaseUsersRequest) (*ListDatabaseUsersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListDatabaseUsers not implemented") } -func (*UnimplementedTerminalServiceServer) ListGateways(context.Context, *ListGatewaysRequest) (*ListGatewaysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListGateways not implemented") -} func (*UnimplementedTerminalServiceServer) ListServers(context.Context, *ListServersRequest) (*ListServersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListServers not implemented") } @@ -2381,21 +2483,27 @@ func (*UnimplementedTerminalServiceServer) ListKubes(context.Context, *ListKubes func (*UnimplementedTerminalServiceServer) ListApps(context.Context, *ListAppsRequest) (*ListAppsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListApps not implemented") } -func (*UnimplementedTerminalServiceServer) CreateGateway(context.Context, *CreateGatewayRequest) (*Gateway, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateGateway not implemented") -} func (*UnimplementedTerminalServiceServer) AddCluster(context.Context, *AddClusterRequest) (*Cluster, error) { return nil, status.Errorf(codes.Unimplemented, "method AddCluster not implemented") } func (*UnimplementedTerminalServiceServer) RemoveCluster(context.Context, *RemoveClusterRequest) (*EmptyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveCluster not implemented") } +func (*UnimplementedTerminalServiceServer) ListGateways(context.Context, *ListGatewaysRequest) (*ListGatewaysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGateways not implemented") +} +func (*UnimplementedTerminalServiceServer) CreateGateway(context.Context, *CreateGatewayRequest) (*Gateway, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGateway not implemented") +} func (*UnimplementedTerminalServiceServer) RemoveGateway(context.Context, *RemoveGatewayRequest) (*EmptyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveGateway not implemented") } func (*UnimplementedTerminalServiceServer) RestartGateway(context.Context, *RestartGatewayRequest) (*EmptyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RestartGateway not implemented") } +func (*UnimplementedTerminalServiceServer) SetGatewayTargetSubresourceName(context.Context, *SetGatewayTargetSubresourceNameRequest) (*Gateway, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetGatewayTargetSubresourceName not implemented") +} func (*UnimplementedTerminalServiceServer) GetAuthSettings(context.Context, *GetAuthSettingsRequest) (*AuthSettings, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAuthSettings not implemented") } @@ -2485,24 +2593,6 @@ func _TerminalService_ListDatabaseUsers_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } -func _TerminalService_ListGateways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListGatewaysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TerminalServiceServer).ListGateways(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/teleport.terminal.v1.TerminalService/ListGateways", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TerminalServiceServer).ListGateways(ctx, req.(*ListGatewaysRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _TerminalService_ListServers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListServersRequest) if err := dec(in); err != nil { @@ -2557,56 +2647,74 @@ func _TerminalService_ListApps_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _TerminalService_CreateGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateGatewayRequest) +func _TerminalService_AddCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddClusterRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TerminalServiceServer).CreateGateway(ctx, in) + return srv.(TerminalServiceServer).AddCluster(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/teleport.terminal.v1.TerminalService/CreateGateway", + FullMethod: "/teleport.terminal.v1.TerminalService/AddCluster", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TerminalServiceServer).CreateGateway(ctx, req.(*CreateGatewayRequest)) + return srv.(TerminalServiceServer).AddCluster(ctx, req.(*AddClusterRequest)) } return interceptor(ctx, in, info, handler) } -func _TerminalService_AddCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddClusterRequest) +func _TerminalService_RemoveCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveClusterRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TerminalServiceServer).AddCluster(ctx, in) + return srv.(TerminalServiceServer).RemoveCluster(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/teleport.terminal.v1.TerminalService/AddCluster", + FullMethod: "/teleport.terminal.v1.TerminalService/RemoveCluster", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TerminalServiceServer).AddCluster(ctx, req.(*AddClusterRequest)) + return srv.(TerminalServiceServer).RemoveCluster(ctx, req.(*RemoveClusterRequest)) } return interceptor(ctx, in, info, handler) } -func _TerminalService_RemoveCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveClusterRequest) +func _TerminalService_ListGateways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGatewaysRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TerminalServiceServer).RemoveCluster(ctx, in) + return srv.(TerminalServiceServer).ListGateways(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/teleport.terminal.v1.TerminalService/RemoveCluster", + FullMethod: "/teleport.terminal.v1.TerminalService/ListGateways", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TerminalServiceServer).RemoveCluster(ctx, req.(*RemoveClusterRequest)) + return srv.(TerminalServiceServer).ListGateways(ctx, req.(*ListGatewaysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_CreateGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGatewayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).CreateGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/CreateGateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).CreateGateway(ctx, req.(*CreateGatewayRequest)) } return interceptor(ctx, in, info, handler) } @@ -2647,6 +2755,24 @@ func _TerminalService_RestartGateway_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _TerminalService_SetGatewayTargetSubresourceName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetGatewayTargetSubresourceNameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).SetGatewayTargetSubresourceName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/SetGatewayTargetSubresourceName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).SetGatewayTargetSubresourceName(ctx, req.(*SetGatewayTargetSubresourceNameRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TerminalService_GetAuthSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetAuthSettingsRequest) if err := dec(in); err != nil { @@ -2739,10 +2865,6 @@ var _TerminalService_serviceDesc = grpc.ServiceDesc{ MethodName: "ListDatabaseUsers", Handler: _TerminalService_ListDatabaseUsers_Handler, }, - { - MethodName: "ListGateways", - Handler: _TerminalService_ListGateways_Handler, - }, { MethodName: "ListServers", Handler: _TerminalService_ListServers_Handler, @@ -2755,10 +2877,6 @@ var _TerminalService_serviceDesc = grpc.ServiceDesc{ MethodName: "ListApps", Handler: _TerminalService_ListApps_Handler, }, - { - MethodName: "CreateGateway", - Handler: _TerminalService_CreateGateway_Handler, - }, { MethodName: "AddCluster", Handler: _TerminalService_AddCluster_Handler, @@ -2767,6 +2885,14 @@ var _TerminalService_serviceDesc = grpc.ServiceDesc{ MethodName: "RemoveCluster", Handler: _TerminalService_RemoveCluster_Handler, }, + { + MethodName: "ListGateways", + Handler: _TerminalService_ListGateways_Handler, + }, + { + MethodName: "CreateGateway", + Handler: _TerminalService_CreateGateway_Handler, + }, { MethodName: "RemoveGateway", Handler: _TerminalService_RemoveGateway_Handler, @@ -2775,6 +2901,10 @@ var _TerminalService_serviceDesc = grpc.ServiceDesc{ MethodName: "RestartGateway", Handler: _TerminalService_RestartGateway_Handler, }, + { + MethodName: "SetGatewayTargetSubresourceName", + Handler: _TerminalService_SetGatewayTargetSubresourceName_Handler, + }, { MethodName: "GetAuthSettings", Handler: _TerminalService_GetAuthSettings_Handler, diff --git a/lib/teleterm/api/protogen/js/v1/service_grpc_pb.d.ts b/lib/teleterm/api/protogen/js/v1/service_grpc_pb.d.ts index 3f2ee65b65896..bc264ec03f6fa 100644 --- a/lib/teleterm/api/protogen/js/v1/service_grpc_pb.d.ts +++ b/lib/teleterm/api/protogen/js/v1/service_grpc_pb.d.ts @@ -20,15 +20,16 @@ interface ITerminalServiceService extends grpc.ServiceDefinition; responseDeserialize: grpc.deserialize; } -interface ITerminalServiceService_IListGateways extends grpc.MethodDefinition { - path: "/teleport.terminal.v1.TerminalService/ListGateways"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} interface ITerminalServiceService_IListServers extends grpc.MethodDefinition { path: "/teleport.terminal.v1.TerminalService/ListServers"; requestStream: false; @@ -107,15 +99,6 @@ interface ITerminalServiceService_IListApps extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } -interface ITerminalServiceService_ICreateGateway extends grpc.MethodDefinition { - path: "/teleport.terminal.v1.TerminalService/CreateGateway"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} interface ITerminalServiceService_IAddCluster extends grpc.MethodDefinition { path: "/teleport.terminal.v1.TerminalService/AddCluster"; requestStream: false; @@ -134,6 +117,24 @@ interface ITerminalServiceService_IRemoveCluster extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } +interface ITerminalServiceService_IListGateways extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/ListGateways"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_ICreateGateway extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/CreateGateway"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} interface ITerminalServiceService_IRemoveGateway extends grpc.MethodDefinition { path: "/teleport.terminal.v1.TerminalService/RemoveGateway"; requestStream: false; @@ -152,6 +153,15 @@ interface ITerminalServiceService_IRestartGateway extends grpc.MethodDefinition< responseSerialize: grpc.serialize; responseDeserialize: grpc.deserialize; } +interface ITerminalServiceService_ISetGatewayTargetSubresourceName extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/SetGatewayTargetSubresourceName"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} interface ITerminalServiceService_IGetAuthSettings extends grpc.MethodDefinition { path: "/teleport.terminal.v1.TerminalService/GetAuthSettings"; requestStream: false; @@ -196,15 +206,16 @@ export interface ITerminalServiceServer { listLeafClusters: grpc.handleUnaryCall; listDatabases: grpc.handleUnaryCall; listDatabaseUsers: grpc.handleUnaryCall; - listGateways: grpc.handleUnaryCall; listServers: grpc.handleUnaryCall; listKubes: grpc.handleUnaryCall; listApps: grpc.handleUnaryCall; - createGateway: grpc.handleUnaryCall; addCluster: grpc.handleUnaryCall; removeCluster: grpc.handleUnaryCall; + listGateways: grpc.handleUnaryCall; + createGateway: grpc.handleUnaryCall; removeGateway: grpc.handleUnaryCall; restartGateway: grpc.handleUnaryCall; + setGatewayTargetSubresourceName: grpc.handleUnaryCall; getAuthSettings: grpc.handleUnaryCall; getCluster: grpc.handleUnaryCall; login: grpc.handleUnaryCall; @@ -224,9 +235,6 @@ export interface ITerminalServiceClient { listDatabaseUsers(request: v1_service_pb.ListDatabaseUsersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabaseUsersResponse) => void): grpc.ClientUnaryCall; listDatabaseUsers(request: v1_service_pb.ListDatabaseUsersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabaseUsersResponse) => void): grpc.ClientUnaryCall; listDatabaseUsers(request: v1_service_pb.ListDatabaseUsersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabaseUsersResponse) => void): grpc.ClientUnaryCall; - listGateways(request: v1_service_pb.ListGatewaysRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; - listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; - listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; listServers(request: v1_service_pb.ListServersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListServersResponse) => void): grpc.ClientUnaryCall; listServers(request: v1_service_pb.ListServersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListServersResponse) => void): grpc.ClientUnaryCall; listServers(request: v1_service_pb.ListServersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListServersResponse) => void): grpc.ClientUnaryCall; @@ -236,21 +244,27 @@ export interface ITerminalServiceClient { listApps(request: v1_service_pb.ListAppsRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListAppsResponse) => void): grpc.ClientUnaryCall; listApps(request: v1_service_pb.ListAppsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListAppsResponse) => void): grpc.ClientUnaryCall; listApps(request: v1_service_pb.ListAppsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListAppsResponse) => void): grpc.ClientUnaryCall; - createGateway(request: v1_service_pb.CreateGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; - createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; - createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; addCluster(request: v1_service_pb.AddClusterRequest, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; addCluster(request: v1_service_pb.AddClusterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; addCluster(request: v1_service_pb.AddClusterRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; removeCluster(request: v1_service_pb.RemoveClusterRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; removeCluster(request: v1_service_pb.RemoveClusterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; removeCluster(request: v1_service_pb.RemoveClusterRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + listGateways(request: v1_service_pb.ListGatewaysRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; + listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; + listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; + createGateway(request: v1_service_pb.CreateGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; removeGateway(request: v1_service_pb.RemoveGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; removeGateway(request: v1_service_pb.RemoveGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; removeGateway(request: v1_service_pb.RemoveGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; restartGateway(request: v1_service_pb.RestartGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; restartGateway(request: v1_service_pb.RestartGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; restartGateway(request: v1_service_pb.RestartGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + setGatewayTargetSubresourceName(request: v1_service_pb.SetGatewayTargetSubresourceNameRequest, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + setGatewayTargetSubresourceName(request: v1_service_pb.SetGatewayTargetSubresourceNameRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + setGatewayTargetSubresourceName(request: v1_service_pb.SetGatewayTargetSubresourceNameRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; getAuthSettings(request: v1_service_pb.GetAuthSettingsRequest, callback: (error: grpc.ServiceError | null, response: v1_auth_settings_pb.AuthSettings) => void): grpc.ClientUnaryCall; getAuthSettings(request: v1_service_pb.GetAuthSettingsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_auth_settings_pb.AuthSettings) => void): grpc.ClientUnaryCall; getAuthSettings(request: v1_service_pb.GetAuthSettingsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_auth_settings_pb.AuthSettings) => void): grpc.ClientUnaryCall; @@ -279,9 +293,6 @@ export class TerminalServiceClient extends grpc.Client implements ITerminalServi public listDatabaseUsers(request: v1_service_pb.ListDatabaseUsersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabaseUsersResponse) => void): grpc.ClientUnaryCall; public listDatabaseUsers(request: v1_service_pb.ListDatabaseUsersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabaseUsersResponse) => void): grpc.ClientUnaryCall; public listDatabaseUsers(request: v1_service_pb.ListDatabaseUsersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabaseUsersResponse) => void): grpc.ClientUnaryCall; - public listGateways(request: v1_service_pb.ListGatewaysRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; - public listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; - public listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; public listServers(request: v1_service_pb.ListServersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListServersResponse) => void): grpc.ClientUnaryCall; public listServers(request: v1_service_pb.ListServersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListServersResponse) => void): grpc.ClientUnaryCall; public listServers(request: v1_service_pb.ListServersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListServersResponse) => void): grpc.ClientUnaryCall; @@ -291,21 +302,27 @@ export class TerminalServiceClient extends grpc.Client implements ITerminalServi public listApps(request: v1_service_pb.ListAppsRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListAppsResponse) => void): grpc.ClientUnaryCall; public listApps(request: v1_service_pb.ListAppsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListAppsResponse) => void): grpc.ClientUnaryCall; public listApps(request: v1_service_pb.ListAppsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListAppsResponse) => void): grpc.ClientUnaryCall; - public createGateway(request: v1_service_pb.CreateGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; - public createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; - public createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; public addCluster(request: v1_service_pb.AddClusterRequest, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; public addCluster(request: v1_service_pb.AddClusterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; public addCluster(request: v1_service_pb.AddClusterRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; public removeCluster(request: v1_service_pb.RemoveClusterRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public removeCluster(request: v1_service_pb.RemoveClusterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public removeCluster(request: v1_service_pb.RemoveClusterRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public listGateways(request: v1_service_pb.ListGatewaysRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; + public listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; + public listGateways(request: v1_service_pb.ListGatewaysRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListGatewaysResponse) => void): grpc.ClientUnaryCall; + public createGateway(request: v1_service_pb.CreateGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + public createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + public createGateway(request: v1_service_pb.CreateGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; public removeGateway(request: v1_service_pb.RemoveGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public removeGateway(request: v1_service_pb.RemoveGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public removeGateway(request: v1_service_pb.RemoveGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public restartGateway(request: v1_service_pb.RestartGatewayRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public restartGateway(request: v1_service_pb.RestartGatewayRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; public restartGateway(request: v1_service_pb.RestartGatewayRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public setGatewayTargetSubresourceName(request: v1_service_pb.SetGatewayTargetSubresourceNameRequest, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + public setGatewayTargetSubresourceName(request: v1_service_pb.SetGatewayTargetSubresourceNameRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; + public setGatewayTargetSubresourceName(request: v1_service_pb.SetGatewayTargetSubresourceNameRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_gateway_pb.Gateway) => void): grpc.ClientUnaryCall; public getAuthSettings(request: v1_service_pb.GetAuthSettingsRequest, callback: (error: grpc.ServiceError | null, response: v1_auth_settings_pb.AuthSettings) => void): grpc.ClientUnaryCall; public getAuthSettings(request: v1_service_pb.GetAuthSettingsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_auth_settings_pb.AuthSettings) => void): grpc.ClientUnaryCall; public getAuthSettings(request: v1_service_pb.GetAuthSettingsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_auth_settings_pb.AuthSettings) => void): grpc.ClientUnaryCall; diff --git a/lib/teleterm/api/protogen/js/v1/service_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/service_grpc_pb.js index ac5ef73f5c242..90c9c4f06d1b4 100644 --- a/lib/teleterm/api/protogen/js/v1/service_grpc_pb.js +++ b/lib/teleterm/api/protogen/js/v1/service_grpc_pb.js @@ -335,6 +335,17 @@ function deserialize_teleport_terminal_v1_RestartGatewayRequest(buffer_arg) { return v1_service_pb.RestartGatewayRequest.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_teleport_terminal_v1_SetGatewayTargetSubresourceNameRequest(arg) { + if (!(arg instanceof v1_service_pb.SetGatewayTargetSubresourceNameRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_SetGatewayTargetSubresourceNameRequest(buffer_arg) { + return v1_service_pb.SetGatewayTargetSubresourceNameRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + // TerminalService describes Teleterm service var TerminalServiceService = exports.TerminalServiceService = { @@ -386,18 +397,6 @@ listDatabaseUsers: { responseSerialize: serialize_teleport_terminal_v1_ListDatabaseUsersResponse, responseDeserialize: deserialize_teleport_terminal_v1_ListDatabaseUsersResponse, }, - // ListGateways lists gateways -listGateways: { - path: '/teleport.terminal.v1.TerminalService/ListGateways', - requestStream: false, - responseStream: false, - requestType: v1_service_pb.ListGatewaysRequest, - responseType: v1_service_pb.ListGatewaysResponse, - requestSerialize: serialize_teleport_terminal_v1_ListGatewaysRequest, - requestDeserialize: deserialize_teleport_terminal_v1_ListGatewaysRequest, - responseSerialize: serialize_teleport_terminal_v1_ListGatewaysResponse, - responseDeserialize: deserialize_teleport_terminal_v1_ListGatewaysResponse, - }, // ListServers lists servers listServers: { path: '/teleport.terminal.v1.TerminalService/ListServers', @@ -434,18 +433,6 @@ listApps: { responseSerialize: serialize_teleport_terminal_v1_ListAppsResponse, responseDeserialize: deserialize_teleport_terminal_v1_ListAppsResponse, }, - // CreateGateway creates a gateway -createGateway: { - path: '/teleport.terminal.v1.TerminalService/CreateGateway', - requestStream: false, - responseStream: false, - requestType: v1_service_pb.CreateGatewayRequest, - responseType: v1_gateway_pb.Gateway, - requestSerialize: serialize_teleport_terminal_v1_CreateGatewayRequest, - requestDeserialize: deserialize_teleport_terminal_v1_CreateGatewayRequest, - responseSerialize: serialize_teleport_terminal_v1_Gateway, - responseDeserialize: deserialize_teleport_terminal_v1_Gateway, - }, // AddCluster adds a cluster to profile addCluster: { path: '/teleport.terminal.v1.TerminalService/AddCluster', @@ -470,6 +457,30 @@ removeCluster: { responseSerialize: serialize_teleport_terminal_v1_EmptyResponse, responseDeserialize: deserialize_teleport_terminal_v1_EmptyResponse, }, + // ListGateways lists gateways +listGateways: { + path: '/teleport.terminal.v1.TerminalService/ListGateways', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListGatewaysRequest, + responseType: v1_service_pb.ListGatewaysResponse, + requestSerialize: serialize_teleport_terminal_v1_ListGatewaysRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListGatewaysRequest, + responseSerialize: serialize_teleport_terminal_v1_ListGatewaysResponse, + responseDeserialize: deserialize_teleport_terminal_v1_ListGatewaysResponse, + }, + // CreateGateway creates a gateway +createGateway: { + path: '/teleport.terminal.v1.TerminalService/CreateGateway', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.CreateGatewayRequest, + responseType: v1_gateway_pb.Gateway, + requestSerialize: serialize_teleport_terminal_v1_CreateGatewayRequest, + requestDeserialize: deserialize_teleport_terminal_v1_CreateGatewayRequest, + responseSerialize: serialize_teleport_terminal_v1_Gateway, + responseDeserialize: deserialize_teleport_terminal_v1_Gateway, + }, // RemoveGateway removes a gateway removeGateway: { path: '/teleport.terminal.v1.TerminalService/RemoveGateway', @@ -496,6 +507,21 @@ restartGateway: { responseSerialize: serialize_teleport_terminal_v1_EmptyResponse, responseDeserialize: deserialize_teleport_terminal_v1_EmptyResponse, }, + // SetGatewayTargetSubresourceName changes the TargetSubresourceName field of gateway.Gateway +// and returns the updated version of gateway.Gateway. +// +// In Connect this is used to update the db name of a db connection along with the CLI command. +setGatewayTargetSubresourceName: { + path: '/teleport.terminal.v1.TerminalService/SetGatewayTargetSubresourceName', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.SetGatewayTargetSubresourceNameRequest, + responseType: v1_gateway_pb.Gateway, + requestSerialize: serialize_teleport_terminal_v1_SetGatewayTargetSubresourceNameRequest, + requestDeserialize: deserialize_teleport_terminal_v1_SetGatewayTargetSubresourceNameRequest, + responseSerialize: serialize_teleport_terminal_v1_Gateway, + responseDeserialize: deserialize_teleport_terminal_v1_Gateway, + }, // GetAuthSettings returns cluster auth settigns getAuthSettings: { path: '/teleport.terminal.v1.TerminalService/GetAuthSettings', diff --git a/lib/teleterm/api/protogen/js/v1/service_pb.d.ts b/lib/teleterm/api/protogen/js/v1/service_pb.d.ts index 227c69ab7e190..413cadb2d98a7 100644 --- a/lib/teleterm/api/protogen/js/v1/service_pb.d.ts +++ b/lib/teleterm/api/protogen/js/v1/service_pb.d.ts @@ -513,6 +513,31 @@ export namespace RestartGatewayRequest { } } +export class SetGatewayTargetSubresourceNameRequest extends jspb.Message { + getGatewayUri(): string; + setGatewayUri(value: string): SetGatewayTargetSubresourceNameRequest; + + getTargetSubresourceName(): string; + setTargetSubresourceName(value: string): SetGatewayTargetSubresourceNameRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SetGatewayTargetSubresourceNameRequest.AsObject; + static toObject(includeInstance: boolean, msg: SetGatewayTargetSubresourceNameRequest): SetGatewayTargetSubresourceNameRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SetGatewayTargetSubresourceNameRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SetGatewayTargetSubresourceNameRequest; + static deserializeBinaryFromReader(message: SetGatewayTargetSubresourceNameRequest, reader: jspb.BinaryReader): SetGatewayTargetSubresourceNameRequest; +} + +export namespace SetGatewayTargetSubresourceNameRequest { + export type AsObject = { + gatewayUri: string, + targetSubresourceName: string, + } +} + export class ListServersRequest extends jspb.Message { getClusterUri(): string; setClusterUri(value: string): ListServersRequest; diff --git a/lib/teleterm/api/protogen/js/v1/service_pb.js b/lib/teleterm/api/protogen/js/v1/service_pb.js index ec3d21259b0fd..6128e286abe66 100644 --- a/lib/teleterm/api/protogen/js/v1/service_pb.js +++ b/lib/teleterm/api/protogen/js/v1/service_pb.js @@ -56,6 +56,7 @@ goog.exportSymbol('proto.teleport.terminal.v1.LogoutRequest', null, global); goog.exportSymbol('proto.teleport.terminal.v1.RemoveClusterRequest', null, global); goog.exportSymbol('proto.teleport.terminal.v1.RemoveGatewayRequest', null, global); goog.exportSymbol('proto.teleport.terminal.v1.RestartGatewayRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -497,6 +498,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.teleport.terminal.v1.RestartGatewayRequest.displayName = 'proto.teleport.terminal.v1.RestartGatewayRequest'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.displayName = 'proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -3777,6 +3799,166 @@ proto.teleport.terminal.v1.RestartGatewayRequest.prototype.setGatewayUri = funct +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.toObject = function(includeInstance, msg) { + var f, obj = { + gatewayUri: jspb.Message.getFieldWithDefault(msg, 1, ""), + targetSubresourceName: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest; + return proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setGatewayUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTargetSubresourceName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGatewayUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTargetSubresourceName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string gateway_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.prototype.getGatewayUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} returns this + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.prototype.setGatewayUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string target_subresource_name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.prototype.getTargetSubresourceName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest} returns this + */ +proto.teleport.terminal.v1.SetGatewayTargetSubresourceNameRequest.prototype.setTargetSubresourceName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. diff --git a/lib/teleterm/apiserver/handler/handler_gateways.go b/lib/teleterm/apiserver/handler/handler_gateways.go index ee57892abb5a5..bad4961fd413b 100644 --- a/lib/teleterm/apiserver/handler/handler_gateways.go +++ b/lib/teleterm/apiserver/handler/handler_gateways.go @@ -18,7 +18,7 @@ import ( "context" api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" - "github.com/gravitational/teleport/lib/teleterm/clusters" + "github.com/gravitational/teleport/lib/teleterm/daemon" "github.com/gravitational/teleport/lib/teleterm/gateway" "github.com/gravitational/trace" @@ -26,7 +26,7 @@ import ( // CreateGateway creates a gateway func (s *Handler) CreateGateway(ctx context.Context, req *api.CreateGatewayRequest) (*api.Gateway, error) { - params := clusters.CreateGatewayParams{ + params := daemon.CreateGatewayParams{ TargetURI: req.TargetUri, TargetUser: req.TargetUser, TargetSubresourceName: req.TargetSubresourceName, @@ -38,7 +38,12 @@ func (s *Handler) CreateGateway(ctx context.Context, req *api.CreateGatewayReque return nil, trace.Wrap(err) } - return newAPIGateway(gateway), nil + apiGateway, err := newAPIGateway(gateway) + if err != nil { + return nil, trace.Wrap(err) + } + + return apiGateway, nil } // ListGateways lists all gateways @@ -48,9 +53,14 @@ func (s *Handler) ListGateways(ctx context.Context, req *api.ListGatewaysRequest return nil, trace.Wrap(err) } - apiGws := []*api.Gateway{} + apiGws := make([]*api.Gateway, 0, len(gws)) for _, gw := range gws { - apiGws = append(apiGws, newAPIGateway(gw)) + apiGateway, err := newAPIGateway(gw) + if err != nil { + return nil, trace.Wrap(err) + } + + apiGws = append(apiGws, apiGateway) } return &api.ListGatewaysResponse{ @@ -67,7 +77,12 @@ func (s *Handler) RemoveGateway(ctx context.Context, req *api.RemoveGatewayReque return &api.EmptyResponse{}, nil } -func newAPIGateway(gateway *gateway.Gateway) *api.Gateway { +func newAPIGateway(gateway *gateway.Gateway) (*api.Gateway, error) { + command, err := gateway.CLICommand() + if err != nil { + return nil, trace.Wrap(err) + } + return &api.Gateway{ Uri: gateway.URI.String(), TargetUri: gateway.TargetURI, @@ -77,8 +92,8 @@ func newAPIGateway(gateway *gateway.Gateway) *api.Gateway { Protocol: gateway.Protocol, LocalAddress: gateway.LocalAddress, LocalPort: gateway.LocalPort, - CliCommand: gateway.CLICommand, - } + CliCommand: command, + }, nil } // RestartGateway stops a gateway and starts a new with identical parameters, keeping the original @@ -90,3 +105,21 @@ func (s *Handler) RestartGateway(ctx context.Context, req *api.RestartGatewayReq return &api.EmptyResponse{}, nil } + +// SetGatewayTargetSubresourceName changes the TargetSubresourceName field of gateway.Gateway +// and returns the updated version of gateway.Gateway. +// +// In Connect this is used to update the db name of a db connection along with the CLI command. +func (s *Handler) SetGatewayTargetSubresourceName(ctx context.Context, req *api.SetGatewayTargetSubresourceNameRequest) (*api.Gateway, error) { + gateway, err := s.DaemonService.SetGatewayTargetSubresourceName(ctx, req.GatewayUri, req.TargetSubresourceName) + if err != nil { + return nil, trace.Wrap(err) + } + + apiGateway, err := newAPIGateway(gateway) + if err != nil { + return nil, trace.Wrap(err) + } + + return apiGateway, nil +} diff --git a/lib/teleterm/clusters/cluster_databases.go b/lib/teleterm/clusters/cluster_databases.go index 351bff2001ca7..543b5be86c39c 100644 --- a/lib/teleterm/clusters/cluster_databases.go +++ b/lib/teleterm/clusters/cluster_databases.go @@ -98,7 +98,7 @@ func (c *Cluster) GetDatabases(ctx context.Context) ([]Database, error) { } // ReissueDBCerts issues new certificates for specific DB access -func (c *Cluster) ReissueDBCerts(ctx context.Context, user, dbName string, db types.Database) error { +func (c *Cluster) ReissueDBCerts(ctx context.Context, user string, db types.Database) error { // When generating certificate for MongoDB access, database username must // be encoded into it. This is required to be able to tell which database // user to authenticate the connection as. @@ -123,7 +123,6 @@ func (c *Cluster) ReissueDBCerts(ctx context.Context, user, dbName string, db ty ServiceName: db.GetName(), Protocol: db.GetProtocol(), Username: user, - Database: dbName, }, AccessRequests: c.status.ActiveRequests.AccessRequests, }) @@ -142,7 +141,6 @@ func (c *Cluster) ReissueDBCerts(ctx context.Context, user, dbName string, db ty ServiceName: db.GetName(), Protocol: db.GetProtocol(), Username: user, - Database: dbName, }, c.status) if err != nil { return trace.Wrap(err) diff --git a/lib/teleterm/clusters/cluster_gateways.go b/lib/teleterm/clusters/cluster_gateways.go index baff64b028ed0..b195154fe0288 100644 --- a/lib/teleterm/clusters/cluster_gateways.go +++ b/lib/teleterm/clusters/cluster_gateways.go @@ -18,13 +18,8 @@ package clusters import ( "context" - "fmt" - "os/exec" - "strings" - "github.com/gravitational/teleport/lib/client/db/dbcmd" "github.com/gravitational/teleport/lib/teleterm/gateway" - "github.com/gravitational/teleport/lib/tlsca" "github.com/gravitational/trace" ) @@ -38,7 +33,8 @@ type CreateGatewayParams struct { // name on a database server. TargetSubresourceName string // LocalPort is the gateway local port - LocalPort string + LocalPort string + CLICommandProvider gateway.CLICommandProvider } // CreateGateway creates a gateway @@ -48,7 +44,7 @@ func (c *Cluster) CreateGateway(ctx context.Context, params CreateGatewayParams) return nil, trace.Wrap(err) } - if err := c.ReissueDBCerts(ctx, params.TargetUser, params.TargetSubresourceName, db); err != nil { + if err := c.ReissueDBCerts(ctx, params.TargetUser, db); err != nil { return nil, trace.Wrap(err) } @@ -64,46 +60,10 @@ func (c *Cluster) CreateGateway(ctx context.Context, params CreateGatewayParams) Insecure: c.clusterClient.InsecureSkipVerify, WebProxyAddr: c.clusterClient.WebProxyAddr, Log: c.Log.WithField("gateway", params.TargetURI), - }) + }, params.CLICommandProvider) if err != nil { return nil, trace.Wrap(err) } - cliCommand, err := buildCLICommand(c, gw) - if err != nil { - return nil, trace.Wrap(err) - } - gw.CLICommand = fmt.Sprintf("%s %s", strings.Join(cliCommand.Env, " "), cliCommand.String()) - return gw, nil } - -func buildCLICommand(c *Cluster, gw *gateway.Gateway) (*exec.Cmd, error) { - routeToDb := tlsca.RouteToDatabase{ - ServiceName: gw.TargetName, - Protocol: gw.Protocol, - Username: gw.TargetUser, - Database: gw.TargetSubresourceName, - } - - cmd, err := dbcmd.NewCmdBuilder(c.clusterClient, &c.status, &routeToDb, - // TODO(ravicious): Pass the root cluster name here. GetActualName returns leaf name for leaf - // clusters. - // - // At this point it doesn't matter though, because this argument is used only for - // generating correct CA paths. But we use dbcmd.WithNoTLS here, which doesn't include CA paths - // in the returned CLI command. - c.GetActualName(), - dbcmd.WithLogger(gw.Log), - dbcmd.WithLocalProxy(gw.LocalAddress, gw.LocalPortInt(), ""), - dbcmd.WithNoTLS(), - dbcmd.WithPrintFormat(), - dbcmd.WithTolerateMissingCLIClient(), - ).GetConnectCommandNoAbsPath() - - if err != nil { - return nil, trace.Wrap(err) - } - - return cmd, nil -} diff --git a/lib/teleterm/clusters/dbcmd_cli_command_provider.go b/lib/teleterm/clusters/dbcmd_cli_command_provider.go new file mode 100644 index 0000000000000..64e02e36b245c --- /dev/null +++ b/lib/teleterm/clusters/dbcmd_cli_command_provider.go @@ -0,0 +1,81 @@ +// Copyright 2022 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. + +package clusters + +import ( + "fmt" + "strings" + + "github.com/gravitational/teleport/lib/client/db/dbcmd" + "github.com/gravitational/teleport/lib/teleterm/gateway" + "github.com/gravitational/teleport/lib/tlsca" + + "github.com/gravitational/trace" +) + +// DbcmdCLICommandProvider provides CLI commands for database gateways. It needs Storage to read +// fresh profile state from the disk. +type DbcmdCLICommandProvider struct { + storage StorageByResourceURI + execer dbcmd.Execer +} + +type StorageByResourceURI interface { + GetByResourceURI(string) (*Cluster, error) +} + +func NewDbcmdCLICommandProvider(storage StorageByResourceURI, execer dbcmd.Execer) DbcmdCLICommandProvider { + return DbcmdCLICommandProvider{ + storage: storage, + execer: execer, + } +} + +func (d DbcmdCLICommandProvider) GetCommand(gateway *gateway.Gateway) (string, error) { + cluster, err := d.storage.GetByResourceURI(gateway.TargetURI) + if err != nil { + return "", trace.Wrap(err) + } + + routeToDb := tlsca.RouteToDatabase{ + ServiceName: gateway.TargetName, + Protocol: gateway.Protocol, + Username: gateway.TargetUser, + Database: gateway.TargetSubresourceName, + } + + cmd, err := dbcmd.NewCmdBuilder(cluster.clusterClient, &cluster.status, &routeToDb, + // TODO(ravicious): Pass the root cluster name here. GetActualName returns leaf name for leaf + // clusters. + // + // At this point it doesn't matter though because this argument is used only for + // generating correct CA paths. We use dbcmd.WithNoTLS here which means that the CA paths aren't + // included in the returned CLI command. + cluster.GetActualName(), + dbcmd.WithLogger(gateway.Log), + dbcmd.WithLocalProxy(gateway.LocalAddress, gateway.LocalPortInt(), ""), + dbcmd.WithNoTLS(), + dbcmd.WithPrintFormat(), + dbcmd.WithTolerateMissingCLIClient(), + dbcmd.WithExecer(d.execer), + ).GetConnectCommandNoAbsPath() + if err != nil { + return "", trace.Wrap(err) + } + + cmdString := strings.TrimSpace(fmt.Sprintf("%s %s", strings.Join(cmd.Env, " "), cmd.String())) + + return cmdString, nil +} diff --git a/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go b/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go new file mode 100644 index 0000000000000..ad642e8a03411 --- /dev/null +++ b/lib/teleterm/clusters/dbcmd_cli_command_provider_test.go @@ -0,0 +1,131 @@ +// Copyright 2022 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. + +package clusters + +import ( + "os/exec" + "path/filepath" + "strings" + "testing" + + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + "github.com/gravitational/teleport/lib/teleterm/gateway" + + "github.com/gravitational/trace" + + "github.com/stretchr/testify/require" +) + +type fakeExec struct{} + +func (f fakeExec) RunCommand(cmd string, _ ...string) ([]byte, error) { + return []byte(""), nil +} + +func (f fakeExec) LookPath(path string) (string, error) { + return "", nil +} + +func (f fakeExec) Command(name string, arg ...string) *exec.Cmd { + cmd := exec.Command(name, arg...) + cmd.Path = filepath.Base(cmd.Path) + return cmd +} + +type fakeStorage struct { + clusters []*Cluster +} + +func (f fakeStorage) GetByResourceURI(resourceURI string) (*Cluster, error) { + for _, cluster := range f.clusters { + if strings.HasPrefix(resourceURI, cluster.URI.String()) { + return cluster, nil + } + } + + return nil, trace.NotFound("not found") +} + +func TestDbcmdCLICommandProviderGetCommand(t *testing.T) { + testCases := []struct { + targetSubresourceName string + }{ + { + targetSubresourceName: "", + }, + { + targetSubresourceName: "bar", + }, + } + + for _, tc := range testCases { + t.Run(tc.targetSubresourceName, func(t *testing.T) { + cluster := Cluster{ + URI: uri.NewClusterURI("quux"), + Name: "quux", + clusterClient: &client.TeleportClient{ + Config: client.Config{ + SiteName: "", + }, + }, + } + localPort := "1337" + gateway := gateway.Gateway{ + Config: gateway.Config{ + TargetURI: cluster.URI.AppendDB("foo").String(), + TargetName: "foo", + TargetSubresourceName: tc.targetSubresourceName, + Protocol: defaults.ProtocolPostgres, + LocalAddress: "localhost", + LocalPort: localPort, + }, + } + fakeStorage := fakeStorage{ + clusters: []*Cluster{&cluster}, + } + dbcmdCLICommandProvider := NewDbcmdCLICommandProvider(fakeStorage, fakeExec{}) + + command, err := dbcmdCLICommandProvider.GetCommand(&gateway) + + require.NoError(t, err) + require.NotEmpty(t, command) + require.Contains(t, command, tc.targetSubresourceName) + require.Contains(t, command, localPort) + }) + } +} + +func TestDbcmdCLICommandProviderGetCommand_ReturnsErrorIfClusterIsNotFound(t *testing.T) { + gateway := gateway.Gateway{ + Config: gateway.Config{ + TargetURI: uri.NewClusterURI("quux").AppendDB("foo").String(), + TargetName: "foo", + TargetSubresourceName: "", + Protocol: defaults.ProtocolPostgres, + LocalAddress: "localhost", + LocalPort: "12345", + }, + } + fakeStorage := fakeStorage{ + clusters: []*Cluster{}, + } + dbcmdCLICommandProvider := NewDbcmdCLICommandProvider(fakeStorage, fakeExec{}) + + _, err := dbcmdCLICommandProvider.GetCommand(&gateway) + require.Error(t, err) + require.True(t, trace.IsNotFound(err), "err is not trace.NotFound") +} diff --git a/lib/teleterm/clusters/storage.go b/lib/teleterm/clusters/storage.go index bd1e59aecdbc3..8d16955295744 100644 --- a/lib/teleterm/clusters/storage.go +++ b/lib/teleterm/clusters/storage.go @@ -70,6 +70,22 @@ func (s *Storage) GetByURI(clusterURI string) (*Cluster, error) { return cluster, nil } +// GetByResourceURI returns a cluster by a URI of its resource. Accepts both root and leaf cluster +// resources and will return a root or leaf cluster accordingly. +func (s *Storage) GetByResourceURI(resourceURI string) (*Cluster, error) { + clusterURI, err := uri.ParseClusterURI(resourceURI) + if err != nil { + return nil, trace.Wrap(err) + } + + cluster, err := s.GetByURI(clusterURI.String()) + if err != nil { + return nil, trace.Wrap(err) + } + + return cluster, nil +} + // Remove removes a cluster func (s *Storage) Remove(ctx context.Context, clusterName string) error { if err := profile.RemoveProfile(s.Dir, clusterName); err != nil { diff --git a/lib/teleterm/daemon/daemon.go b/lib/teleterm/daemon/daemon.go index 41d405fd2ea11..b695fcd75e758 100644 --- a/lib/teleterm/daemon/daemon.go +++ b/lib/teleterm/daemon/daemon.go @@ -18,7 +18,7 @@ import ( "context" "sync" - apiuri "github.com/gravitational/teleport/lib/teleterm/api/uri" + "github.com/gravitational/teleport/lib/client/db/dbcmd" "github.com/gravitational/teleport/lib/teleterm/clusters" "github.com/gravitational/teleport/lib/teleterm/gateway" @@ -98,12 +98,7 @@ func (s *Service) RemoveCluster(ctx context.Context, uri string) error { // ResolveCluster resolves a cluster by URI func (s *Service) ResolveCluster(uri string) (*clusters.Cluster, error) { - clusterURI, err := apiuri.ParseClusterURI(uri) - if err != nil { - return nil, trace.Wrap(err) - } - - cluster, err := s.Storage.GetByURI(clusterURI.String()) + cluster, err := s.Storage.GetByResourceURI(uri) if err != nil { return nil, trace.Wrap(err) } @@ -126,7 +121,7 @@ func (s *Service) ClusterLogout(ctx context.Context, uri string) error { } // CreateGateway creates a gateway to given targetURI -func (s *Service) CreateGateway(ctx context.Context, params clusters.CreateGatewayParams) (*gateway.Gateway, error) { +func (s *Service) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error) { s.mu.Lock() defer s.mu.Unlock() @@ -139,13 +134,23 @@ func (s *Service) CreateGateway(ctx context.Context, params clusters.CreateGatew } // createGateway assumes that mu is already held by a public method. -func (s *Service) createGateway(ctx context.Context, params clusters.CreateGatewayParams) (*gateway.Gateway, error) { +func (s *Service) createGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error) { cluster, err := s.ResolveCluster(params.TargetURI) if err != nil { return nil, trace.Wrap(err) } - gateway, err := cluster.CreateGateway(ctx, params) + cliCommandProvider := clusters.NewDbcmdCLICommandProvider(s.Storage, dbcmd.SystemExecer{}) + + clusterCreateGatewayParams := clusters.CreateGatewayParams{ + TargetURI: params.TargetURI, + TargetUser: params.TargetUser, + TargetSubresourceName: params.TargetSubresourceName, + LocalPort: params.LocalPort, + CLICommandProvider: cliCommandProvider, + } + + gateway, err := cluster.CreateGateway(ctx, clusterCreateGatewayParams) if err != nil { return nil, trace.Wrap(err) } @@ -229,7 +234,7 @@ func (s *Service) RestartGateway(ctx context.Context, gatewayURI string) error { s.removeGateway(gateway) - newGateway, err := s.createGateway(ctx, clusters.CreateGatewayParams{ + newGateway, err := s.createGateway(ctx, CreateGatewayParams{ TargetURI: gateway.TargetURI, TargetUser: gateway.TargetUser, TargetSubresourceName: gateway.TargetSubresourceName, @@ -244,6 +249,22 @@ func (s *Service) RestartGateway(ctx context.Context, gatewayURI string) error { return nil } +// SetGatewayTargetSubresourceName updates the TargetSubresourceName field of a gateway stored in +// s.gateways. +func (s *Service) SetGatewayTargetSubresourceName(ctx context.Context, gatewayURI, targetSubresourceName string) (*gateway.Gateway, error) { + s.mu.Lock() + defer s.mu.Unlock() + + gateway, err := s.findGateway(gatewayURI) + if err != nil { + return nil, trace.Wrap(err) + } + + gateway.TargetSubresourceName = targetSubresourceName + + return gateway, nil +} + // ListKubes lists kubernetes clusters func (s *Service) ListKubes(ctx context.Context, uri string) ([]clusters.Kube, error) { cluster, err := s.ResolveCluster(uri) @@ -264,6 +285,16 @@ func (s *Service) FindGateway(gatewayURI string) (*gateway.Gateway, error) { s.mu.RLock() defer s.mu.RUnlock() + gateway, err := s.findGateway(gatewayURI) + if err != nil { + return nil, trace.Wrap(err) + } + + return gateway, nil +} + +// findGateway assumes that mu is already held by a public method. +func (s *Service) findGateway(gatewayURI string) (*gateway.Gateway, error) { for _, gateway := range s.gateways { if gateway.URI.String() == gatewayURI { return gateway, nil @@ -299,6 +330,15 @@ type Service struct { Config mu sync.RWMutex - // gateways is the cluster gateways + // gateways holds the long-running gateways for resources on different clusters. So far it's been + // used mostly for database gateways but it has potential to be used for app access as well. + // TODO(ravicious): Refactor this to `map[string]*gateway.Gateway`. gateways []*gateway.Gateway } + +type CreateGatewayParams struct { + TargetURI string + TargetUser string + TargetSubresourceName string + LocalPort string +} diff --git a/lib/teleterm/gateway/gateway.go b/lib/teleterm/gateway/gateway.go index d24066ec619e1..adea1e01183a0 100644 --- a/lib/teleterm/gateway/gateway.go +++ b/lib/teleterm/gateway/gateway.go @@ -31,7 +31,7 @@ import ( ) // New creates an instance of Gateway -func New(cfg Config) (*Gateway, error) { +func New(cfg Config, cliCommandProvider CLICommandProvider) (*Gateway, error) { if err := cfg.CheckAndSetDefaults(); err != nil { return nil, trace.Wrap(err) } @@ -92,10 +92,11 @@ func New(cfg Config) (*Gateway, error) { cfg.LocalPort = port gateway := &Gateway{ - Config: cfg, - closeContext: closeContext, - closeCancel: closeCancel, - localProxy: localProxy, + Config: cfg, + closeContext: closeContext, + closeCancel: closeCancel, + localProxy: localProxy, + cliCommandProvider: cliCommandProvider, } ok = true @@ -129,16 +130,29 @@ func (g *Gateway) LocalPortInt() int { return port } +// CLICommand returns a command which launches a CLI client pointed at the given gateway. +func (g *Gateway) CLICommand() (string, error) { + cliCommand, err := g.cliCommandProvider.GetCommand(g) + if err != nil { + return "", trace.Wrap(err) + } + + return cliCommand, nil +} + // Gateway describes local proxy that creates a gateway to the remote Teleport resource. type Gateway struct { Config - // Set by the cluster when running clusters.Cluster.CreateGateway. - // We can't set here inside New as dbcmd.NewCmdBuilder needs info from the cluster. - CLICommand string localProxy *alpn.LocalProxy // closeContext and closeCancel are used to signal to any waiting goroutines // that the local proxy is now closed and to release any resources. - closeContext context.Context - closeCancel context.CancelFunc + closeContext context.Context + closeCancel context.CancelFunc + cliCommandProvider CLICommandProvider +} + +// CLICommandProvider provides a CLI command for gateways which support CLI clients. +type CLICommandProvider interface { + GetCommand(gateway *Gateway) (string, error) } diff --git a/lib/teleterm/gateway/gateway_test.go b/lib/teleterm/gateway/gateway_test.go new file mode 100644 index 0000000000000..eb04c1b91f4e7 --- /dev/null +++ b/lib/teleterm/gateway/gateway_test.go @@ -0,0 +1,47 @@ +// Copyright 2022 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. + +package gateway + +import ( + "fmt" + "testing" + + "github.com/gravitational/teleport/lib/defaults" + + "github.com/stretchr/testify/require" +) + +type mockCLICommandProvider struct{} + +func (m mockCLICommandProvider) GetCommand(gateway *Gateway) (string, error) { + command := fmt.Sprintf("%s/%s", gateway.TargetName, gateway.TargetSubresourceName) + return command, nil +} + +func TestCLICommandUsesCLICommandProvider(t *testing.T) { + gateway := Gateway{ + Config: Config{ + TargetName: "foo", + TargetSubresourceName: "bar", + Protocol: defaults.ProtocolPostgres, + }, + cliCommandProvider: mockCLICommandProvider{}, + } + + command, err := gateway.CLICommand() + require.NoError(t, err) + + require.Equal(t, "foo/bar", command) +}