diff --git a/Makefile b/Makefile index 78948303d4000..35201821d6c50 100644 --- a/Makefile +++ b/Makefile @@ -732,6 +732,7 @@ ADDLICENSE_ARGS := -c 'Gravitational, Inc' -l apache \ -ignore 'e/**' \ -ignore 'gitref.go' \ -ignore 'lib/web/build/**' \ + -ignore 'lib/teleterm/api/protogen/**' \ -ignore 'version.go' \ -ignore 'webassets/**' \ -ignore 'ignoreme' \ @@ -914,6 +915,7 @@ buildbox-grpc: --gogofast_out=plugins=grpc,$(GOGOPROTO_IMPORTMAP):. \ envelope.proto + cd lib/teleterm && buf generate .PHONY: goinstall goinstall: diff --git a/api/profile/profile.go b/api/profile/profile.go index 7b9b701d63c8b..7fef9b2cb0471 100644 --- a/api/profile/profile.go +++ b/api/profile/profile.go @@ -173,6 +173,16 @@ func SetCurrentProfileName(dir string, name string) error { return nil } +// RemoveProfile removes cluster profile file +func RemoveProfile(dir, name string) error { + profilePath := filepath.Join(dir, name+".yaml") + if err := os.Remove(profilePath); err != nil { + return trace.ConvertSystemError(err) + } + + return nil +} + // GetCurrentProfileName attempts to load the current profile name. func GetCurrentProfileName(dir string) (name string, err error) { if dir == "" { diff --git a/build.assets/Dockerfile b/build.assets/Dockerfile index 4befe80202cb7..c082234ff5e1f 100644 --- a/build.assets/Dockerfile +++ b/build.assets/Dockerfile @@ -189,5 +189,27 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --pr cargo install cbindgen USER root + +# Install buf +RUN BIN="/usr/local/bin" && \ + VERSION="1.0.0-rc1" && \ + BINARY_NAME="buf" && \ + curl -sSL \ + "https://github.com/bufbuild/buf/releases/download/v${VERSION}/${BINARY_NAME}-$(uname -s)-$(uname -m)" \ + -o "${BIN}/${BINARY_NAME}" && \ + chmod +x "${BIN}/${BINARY_NAME}" + +# Install node +ARG NODE_VERSION=v15.14.0 +ENV NODE_URL="https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.xz" +ENV NODE_PATH="/usr/local/lib/node-${NODE_VERSION}-linux-x64" +ENV PATH="$PATH:${NODE_PATH}/bin" +RUN (curl -o /tmp/nodejs.tar.xz -L ${NODE_URL} && tar -xJf /tmp/nodejs.tar.xz -C /usr/local/lib) + +# Install js proto tools +RUN (npm install --global grpc-tools@1.11.2) +RUN (npm install --global grpc_tools_node_protoc_ts@5.0.1) +RUN go install github.com/golang/protobuf/protoc-gen-go@v1.4.3 + VOLUME ["/go/src/github.com/gravitational/teleport"] -EXPOSE 6600 2379 2380 +EXPOSE 6600 2379 2380 \ No newline at end of file diff --git a/build.assets/Makefile b/build.assets/Makefile index b6f1659ef0f50..f275622887a7e 100644 --- a/build.assets/Makefile +++ b/build.assets/Makefile @@ -32,7 +32,7 @@ RUNTIME_ARCH_arm64 := arm64 RUNTIME_ARCH_aarch64 := arm64 RUNTIME_ARCH := $(RUNTIME_ARCH_$(HOST_ARCH)) -PROTOC_VER ?= 3.6.1 +PROTOC_VER ?= 3.13.0 GOGO_PROTO_TAG ?= v1.3.2 BUILDBOX=quay.io/gravitational/teleport-buildbox:$(BUILDBOX_VERSION) diff --git a/go.mod b/go.mod index 918749c894cbc..fcc1a6f988aba 100644 --- a/go.mod +++ b/go.mod @@ -229,6 +229,7 @@ require ( github.com/spf13/cobra v1.2.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/thales-e-security/pool v0.0.2 // indirect + github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.0.2 // indirect diff --git a/go.sum b/go.sum index 49f934991b772..4552baca6675d 100644 --- a/go.sum +++ b/go.sum @@ -892,6 +892,8 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tstranex/u2f v0.0.0-20160508205855-eb799ce68da4 h1:aR+lGR8m0zBjvDlHkHOCmdsk79ipIPeiP75GqUlywKM= github.com/tstranex/u2f v0.0.0-20160508205855-eb799ce68da4/go.mod h1:eahSLaqAS0zsIEv80+vXT7WanXs7MQQDg3j3wGBSayo= +github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb h1:Ywfo8sUltxogBpFuMOFRrrSifO788kAFxmvVw31PtQQ= +github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb/go.mod h1:ikPs9bRWicNw3S7XpJ8sK/smGwU9WcSVU3dy9qahYBM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= diff --git a/lib/client/api.go b/lib/client/api.go index 7f73a1957dc0d..aa615b7dfb715 100644 --- a/lib/client/api.go +++ b/lib/client/api.go @@ -571,10 +571,10 @@ func RetryWithRelogin(ctx context.Context, tc *TeleportClient, fn func() error) return fn() } -// readProfile reads in the profile as well as the associated certificate +// ReadProfileStatus reads in the profile as well as the associated certificate // and returns a *ProfileStatus which can be used to print the status of the // profile. -func readProfile(profileDir string, profileName string) (*ProfileStatus, error) { +func ReadProfileStatus(profileDir string, profileName string) (*ProfileStatus, error) { var err error if profileDir == "" { @@ -783,7 +783,7 @@ func Status(profileDir, proxyHost string) (*ProfileStatus, []*ProfileStatus, err // Read in the target profile first. If readProfile returns trace.NotFound, // that means the profile may have been corrupted (for example keys were // deleted but profile exists), treat this as the user not being logged in. - profileStatus, err = readProfile(profileDir, profileName) + profileStatus, err = ReadProfileStatus(profileDir, profileName) if err != nil { log.Debug(err) if !trace.IsNotFound(err) { @@ -804,7 +804,7 @@ func Status(profileDir, proxyHost string) (*ProfileStatus, []*ProfileStatus, err // already loaded this one continue } - ps, err := readProfile(profileDir, name) + ps, err := ReadProfileStatus(profileDir, name) if err != nil { log.Debug(err) // parts of profile are missing? @@ -2492,6 +2492,15 @@ func (tc *TeleportClient) PingAndShowMOTD(ctx context.Context) (*webclient.PingR return pr, nil } +// GetWebConfig retreives Teleport proxy web config +func (tc *TeleportClient) GetWebConfig(ctx context.Context) (*WebConfig, error) { + cfg, err := GetWebConfig(ctx, tc.WebProxyAddr, tc.InsecureSkipVerify) + if err != nil { + return nil, trace.Wrap(err) + } + return cfg, nil +} + // Login logs the user into a Teleport cluster by talking to a Teleport proxy. // // If tc.Passwordless is set, then the passwordless authentication flow is used. diff --git a/lib/client/keyagent.go b/lib/client/keyagent.go index 19cd3256d5126..3b48c08850948 100644 --- a/lib/client/keyagent.go +++ b/lib/client/keyagent.go @@ -175,6 +175,11 @@ func (a *LocalKeyAgent) UpdateProxyHost(proxyHost string) { a.proxyHost = proxyHost } +// UpdateUsername changes username that the local agent operates on. +func (a *LocalKeyAgent) UpdateUsername(username string) { + a.username = username +} + // LoadKeyForCluster fetches a cluster-specific SSH key and loads it into the // SSH agent. func (a *LocalKeyAgent) LoadKeyForCluster(clusterName string) (*agent.AddedKey, error) { @@ -182,6 +187,7 @@ func (a *LocalKeyAgent) LoadKeyForCluster(clusterName string) (*agent.AddedKey, if err != nil { return nil, trace.Wrap(err) } + return a.LoadKey(*key) } diff --git a/lib/client/weblogin.go b/lib/client/weblogin.go index 6148704369663..bd3b1b2b2a78d 100644 --- a/lib/client/weblogin.go +++ b/lib/client/weblogin.go @@ -17,10 +17,12 @@ limitations under the License. package client import ( + "bytes" "context" "crypto/x509" "encoding/json" "fmt" + "io" "net" "net/url" "os" @@ -35,6 +37,8 @@ import ( "github.com/gravitational/teleport/api/types" "github.com/gravitational/teleport/lib/auth" "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/web/ui" + "github.com/gravitational/trace" "github.com/sirupsen/logrus" @@ -436,3 +440,33 @@ func HostCredentials(ctx context.Context, proxyAddr string, insecure bool, req t return &certs, nil } + +// GetWebConfig is used by teleterm to fetch webconfig.js from proxies +func GetWebConfig(ctx context.Context, proxyAddr string, insecure bool) (*ui.WebConfig, error) { + clt, _, err := initClient(proxyAddr, insecure, nil) + if err != nil { + return nil, trace.Wrap(err) + } + + response, err := clt.Get(ctx, clt.Endpoint("web", "config.js"), url.Values{}) + if err != nil { + return nil, trace.Wrap(err) + } + + body, err := io.ReadAll(response.Reader()) + if err != nil { + return nil, trace.Wrap(err) + } + + // WebConfig is served as JS file where GRV_CONFIG is a global object name + text := bytes.TrimSuffix(bytes.Replace(body, []byte("var GRV_CONFIG = "), []byte(""), 1), []byte(";")) + + cfg := ui.WebConfig{} + if err := json.Unmarshal(text, &cfg); err != nil { + return nil, trace.Wrap(err) + } + + return &cfg, nil +} + +type WebConfig = ui.WebConfig diff --git a/lib/teleterm/api/proto/buf.yaml b/lib/teleterm/api/proto/buf.yaml new file mode 100644 index 0000000000000..4923234ee6ac8 --- /dev/null +++ b/lib/teleterm/api/proto/buf.yaml @@ -0,0 +1,9 @@ +version: v1 +lint: + use: + - DEFAULT + except: + - RPC_RESPONSE_STANDARD_NAME +breaking: + use: + - FILE diff --git a/lib/teleterm/api/proto/v1/app.proto b/lib/teleterm/api/proto/v1/app.proto new file mode 100644 index 0000000000000..96808cb2a06ec --- /dev/null +++ b/lib/teleterm/api/proto/v1/app.proto @@ -0,0 +1,50 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +import "v1/label.proto"; + +// App describes connected Application +message App { + // uri is the app resource URI + string uri = 1; + // name is the app name + string name = 2; + // description is the app description. + string description = 3; + // uri is the internal address the application is available at. + string app_uri = 4; + // public_addr is the public address the application is accessible at. + string public_addr = 5; + // fqdn is a fully qualified domain name of the application (app.example.com) + string fqdn = 6; + // labels is a map of static labels associated with an application. + repeated Label labels = 7; + // aws_console if true, indicates that the app represents AWS management console. + bool aws_console = 8; + // aws_roles is a list of AWS IAM roles for the application representing AWS console. + repeated AWSRole aws_roles = 9; + + message AWSRole { + // display is the role display name. + string display = 1; + // arn is the full role ARN. + string arn = 2; + } +} diff --git a/lib/teleterm/api/proto/v1/auth_settings.proto b/lib/teleterm/api/proto/v1/auth_settings.proto new file mode 100644 index 0000000000000..1cb47f23d316d --- /dev/null +++ b/lib/teleterm/api/proto/v1/auth_settings.proto @@ -0,0 +1,46 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +// AuthSettings contains the form of authentication the auth server supports. +message AuthSettings { + // local_auth_enabled is a flag that enables local authentication + bool local_auth_enabled = 1; + // second_factor is the type of second factor to use in authentication. + string second_factor = 2; + // preferred_mfa is the prefered mfa for local logins + string preferred_mfa = 3; + // auth_providers contains a list of auth providers + repeated AuthProvider auth_providers = 4; + // has_message_of_the_day is a flag indicating that the cluster has MOTD + // banner text that must be retrieved, displayed and acknowledged by + // the user. + bool has_message_of_the_day = 5; +} + +// AuthProvider describes a way of authentication that is supported by the server. Auth provider is +// referred to as "auth connector" on the backend. +message AuthProvider { + // Type is the auth provider type (github|oidc|etc) + string type = 1; + // Name is the internal name of the connector. + string name = 2; + // Display is the display name for the connector. + string display_name = 3; +} diff --git a/lib/teleterm/api/proto/v1/cluster.proto b/lib/teleterm/api/proto/v1/cluster.proto new file mode 100644 index 0000000000000..cbd3d4ea28335 --- /dev/null +++ b/lib/teleterm/api/proto/v1/cluster.proto @@ -0,0 +1,88 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +// Cluster describes cluster fields +message Cluster { + // uri is the cluster resource URI + string uri = 1; + // name is the cluster name + string name = 2; + // connected indicates if connection to the cluster can be established, that is if we have a + // cert for the cluster that hasn't expired + bool connected = 3; + // leaf indicates if this is a leaf cluster + bool leaf = 4; + // User is the cluster access control list of the logged-in user + LoggedInUser logged_in_user = 5; +} + +// LoggedInUser describes a logged-in user +message LoggedInUser { + // name is the user name + string name = 1; + // roles is the user roles + repeated string roles = 2; + // ssh_logins is the user ssh logins + repeated string ssh_logins = 3; + // acl is the user acl + ACL acl = 4; +} + +// ACL is the access control list of the user +message ACL { + // sessions defines access to recorded sessions + ResourceAccess sessions = 1; + // auth_connectors defines access to auth.connectors + ResourceAccess auth_connectors = 2; + // Roles defines access to roles + ResourceAccess roles = 3; + // Users defines access to users. + ResourceAccess users = 4; + // trusted_clusters defines access to trusted clusters + ResourceAccess trusted_clusters = 5; + // Events defines access to audit logs + ResourceAccess events = 6; + // Tokens defines access to tokens. + ResourceAccess tokens = 7; + // Servers defines access to servers. + ResourceAccess servers = 8; + // apps defines access to application servers + ResourceAccess apps = 9; + // dbs defines access to database servers. + ResourceAccess dbs = 10; + // kubeservers defines access to kubernetes servers. + ResourceAccess kubeservers = 11; + // access_requests defines access to access requests + ResourceAccess access_requests = 12; +} + +// ResourceAccess describes access verbs +message ResourceAccess { + // list determines "list" access + bool list = 1; + // read determines "read" access + bool read = 2; + // edit determines "edit" access + bool edit = 3; + // create determines "create" access + bool create = 4; + // delete determines "delete" access + bool delete = 5; +} diff --git a/lib/teleterm/api/proto/v1/database.proto b/lib/teleterm/api/proto/v1/database.proto new file mode 100644 index 0000000000000..13680388f572b --- /dev/null +++ b/lib/teleterm/api/proto/v1/database.proto @@ -0,0 +1,41 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +import "v1/label.proto"; + +// Database describes a database +message Database { + // uri is the cluster resource URI + string uri = 1; + // name is the name of the database + string name = 2; + // desc is the database description + string desc = 3; + // protocol is the protocol used by the database + string protocol = 4; + // type is the database type, self-hosted or cloud-hosted. + string type = 5; + // hostname is this database hostname + string hostname = 6; + // addr is this database ip address + string addr = 7; + // labels is a list of labels for this database + repeated Label labels = 8; +} diff --git a/lib/teleterm/api/proto/v1/gateway.proto b/lib/teleterm/api/proto/v1/gateway.proto new file mode 100644 index 0000000000000..8e8c079823751 --- /dev/null +++ b/lib/teleterm/api/proto/v1/gateway.proto @@ -0,0 +1,52 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +// Gateway is Teleterm's name for a connection to a resource like a database or a web app +// established through our ALPN proxy. +// +// The term "gateway" is used to avoid using the term "proxy" itself which could be confusing as +// "proxy" means a couple of different things depending on the context. But for Teleterm, a gateway +// is always an ALPN proxy connection. +// +// See RFD 39 for more info on ALPN. +message Gateway { + // uri is the gateway uri + string uri = 1; + // target_name is the target resource name + string target_name = 2; + // target_uri is the target uri + string target_uri = 3; + // target_user is the target user + string target_user = 4; + // local_address is the gateway address on localhost + string local_address = 5; + // local_port is the gateway address on localhost + string local_port = 6; + // protocol is the gateway protocol + string protocol = 7; + // insecure is whether to skip certificate validation + bool insecure = 8; + // ca_cert_path + string ca_cert_path = 9; + // cert_path + string cert_path = 10; + // key_path + string key_path = 11; +} diff --git a/lib/teleterm/api/proto/v1/kube.proto b/lib/teleterm/api/proto/v1/kube.proto new file mode 100644 index 0000000000000..3ca74f9da80d3 --- /dev/null +++ b/lib/teleterm/api/proto/v1/kube.proto @@ -0,0 +1,31 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +import "v1/label.proto"; + +// Kube describes connected Kubernetes cluster +message Kube { + // uri is the kube resource URI + string uri = 1; + // name is the kube name + string name = 2; + // labels is the kube labels + repeated Label labels = 3; +} \ No newline at end of file diff --git a/lib/teleterm/api/proto/v1/label.proto b/lib/teleterm/api/proto/v1/label.proto new file mode 100644 index 0000000000000..9f4070f0b9329 --- /dev/null +++ b/lib/teleterm/api/proto/v1/label.proto @@ -0,0 +1,27 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +// Label describes a label +message Label { + // name is this label name + string name = 1; + // value is this label value + string value = 2; +} diff --git a/lib/teleterm/api/proto/v1/server.proto b/lib/teleterm/api/proto/v1/server.proto new file mode 100644 index 0000000000000..660118c752913 --- /dev/null +++ b/lib/teleterm/api/proto/v1/server.proto @@ -0,0 +1,37 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +import "v1/label.proto"; + +// Server describes connected Server +message Server { + // uri is the server uri + string uri = 1; + // tunnel indicates if this server is connected over a reverse tunnel + bool tunnel = 2; + // name is the server name + string name = 3; + // hostname is this server hostname + string hostname = 4; + // addr is this server ip address + string addr = 5; + // labels is this server list of labels + repeated Label labels = 6; +} diff --git a/lib/teleterm/api/proto/v1/service.proto b/lib/teleterm/api/proto/v1/service.proto new file mode 100644 index 0000000000000..a73625109991a --- /dev/null +++ b/lib/teleterm/api/proto/v1/service.proto @@ -0,0 +1,139 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package teleport.terminal.v1; + +option go_package = "github.com/gravitational/teleport/lib/teleterm/v1"; + +import "google/protobuf/empty.proto"; +import "v1/cluster.proto"; +import "v1/database.proto"; +import "v1/gateway.proto"; +import "v1/kube.proto"; +import "v1/app.proto"; +import "v1/server.proto"; +import "v1/auth_settings.proto"; + +// TerminalService desribes teleterm service +service TerminalService { + // ListRootClusters lists root clusters + rpc ListRootClusters(ListClustersRequest) returns (ListClustersResponse); + // ListLeafClusters lists leaf clusters + rpc ListLeafClusters(ListLeafClustersRequest) returns (ListClustersResponse); + // ListDatabases lists databases + rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse); + // 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); + // RemoveGateway removes a gateway + rpc RemoveGateway(RemoveGatewayRequest) returns (EmptyResponse); + // GetAuthSettings returns cluster auth settigns + rpc GetAuthSettings(GetAuthSettingsRequest) returns (AuthSettings); + // GetCluster returns a cluster + rpc GetCluster(GetClusterRequest) returns (Cluster); + // Login logs in a user to a cluster + rpc Login(LoginRequest) returns (EmptyResponse); + // ClusterLogin logs out a user from cluster + rpc Logout(LogoutRequest) returns (EmptyResponse); +} + +// RemoveClusterRequest describes RemoveClusterRequest +message RemoveClusterRequest { string cluster_uri = 1; } + +// GetClusterRequest describes GetClusterRequest +message GetClusterRequest { string cluster_uri = 1; } + +// LogoutRequest describes LogoutRequest +message LogoutRequest { string cluster_uri = 1; } + +// LoginRequest describes cluster login request +message LoginRequest { + // cluster_uri is the cluster uri + string cluster_uri = 1; + // local holds parameters for local logins + LocalParams local = 2; + // sso holds parameters for sso logins + SsoParams sso = 3; + + // LocalParams describes parameters for local user logins + message LocalParams { + // user is the user name + string user = 1; + // password is the user password + string password = 2; + // token is the 2FA token + string token = 3; + } + + // SsoParams describes SSO parameters + message SsoParams { + // provider_type is the provider type + string provider_type = 1; + // provider_name is the provider name + string provider_name = 2; + } +} + +message AddClusterRequest { string name = 1; } + +message ListKubesRequest { string cluster_uri = 1; } + +message ListAppsRequest { string cluster_uri = 1; } + +message ListClustersRequest {} + +message ListClustersResponse { repeated Cluster clusters = 1; } + +message ListDatabasesRequest { string cluster_uri = 1; } + +message ListLeafClustersRequest { string cluster_uri = 1; } + +message ListDatabasesResponse { repeated Database databases = 1; } + +message CreateGatewayRequest { + string target_uri = 1; + string target_user = 2; + string local_port = 3; +} + +message ListGatewaysRequest { repeated string cluster_ids = 1; } + +message ListGatewaysResponse { repeated Gateway gateways = 1; } + +message RemoveGatewayRequest { string gateway_uri = 1; } + +message ListServersRequest { string cluster_uri = 1; } + +message ListServersResponse { repeated Server servers = 1; } + +message ListKubesResponse { repeated Kube kubes = 1; } + +message ListAppsResponse { repeated App apps = 1; } + +message GetAuthSettingsRequest { string cluster_uri = 1; } + +message EmptyResponse {} diff --git a/lib/teleterm/api/protogen/golang/v1/app.pb.go b/lib/teleterm/api/protogen/golang/v1/app.pb.go new file mode 100644 index 0000000000000..719e92b0d5b2e --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/app.pb.go @@ -0,0 +1,333 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/app.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// App describes connected Application +type App struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the app resource URI + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // name is the app name + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // description is the app description. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // uri is the internal address the application is available at. + AppUri string `protobuf:"bytes,4,opt,name=app_uri,json=appUri,proto3" json:"app_uri,omitempty"` + // public_addr is the public address the application is accessible at. + PublicAddr string `protobuf:"bytes,5,opt,name=public_addr,json=publicAddr,proto3" json:"public_addr,omitempty"` + // fqdn is a fully qualified domain name of the application (app.example.com) + Fqdn string `protobuf:"bytes,6,opt,name=fqdn,proto3" json:"fqdn,omitempty"` + // labels is a map of static labels associated with an application. + Labels []*Label `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty"` + // aws_console if true, indicates that the app represents AWS management console. + AwsConsole bool `protobuf:"varint,8,opt,name=aws_console,json=awsConsole,proto3" json:"aws_console,omitempty"` + // aws_roles is a list of AWS IAM roles for the application representing AWS console. + AwsRoles []*App_AWSRole `protobuf:"bytes,9,rep,name=aws_roles,json=awsRoles,proto3" json:"aws_roles,omitempty"` +} + +func (x *App) Reset() { + *x = App{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_app_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *App) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*App) ProtoMessage() {} + +func (x *App) ProtoReflect() protoreflect.Message { + mi := &file_v1_app_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use App.ProtoReflect.Descriptor instead. +func (*App) Descriptor() ([]byte, []int) { + return file_v1_app_proto_rawDescGZIP(), []int{0} +} + +func (x *App) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *App) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *App) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *App) GetAppUri() string { + if x != nil { + return x.AppUri + } + return "" +} + +func (x *App) GetPublicAddr() string { + if x != nil { + return x.PublicAddr + } + return "" +} + +func (x *App) GetFqdn() string { + if x != nil { + return x.Fqdn + } + return "" +} + +func (x *App) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +func (x *App) GetAwsConsole() bool { + if x != nil { + return x.AwsConsole + } + return false +} + +func (x *App) GetAwsRoles() []*App_AWSRole { + if x != nil { + return x.AwsRoles + } + return nil +} + +type App_AWSRole struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // display is the role display name. + Display string `protobuf:"bytes,1,opt,name=display,proto3" json:"display,omitempty"` + // arn is the full role ARN. + Arn string `protobuf:"bytes,2,opt,name=arn,proto3" json:"arn,omitempty"` +} + +func (x *App_AWSRole) Reset() { + *x = App_AWSRole{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_app_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *App_AWSRole) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*App_AWSRole) ProtoMessage() {} + +func (x *App_AWSRole) ProtoReflect() protoreflect.Message { + mi := &file_v1_app_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use App_AWSRole.ProtoReflect.Descriptor instead. +func (*App_AWSRole) Descriptor() ([]byte, []int) { + return file_v1_app_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *App_AWSRole) GetDisplay() string { + if x != nil { + return x.Display + } + return "" +} + +func (x *App_AWSRole) GetArn() string { + if x != nil { + return x.Arn + } + return "" +} + +var File_v1_app_proto protoreflect.FileDescriptor + +var file_v1_app_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, + 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, + 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x0e, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe8, 0x02, 0x0a, 0x03, 0x41, 0x70, 0x70, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x5f, 0x75, 0x72, 0x69, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x70, 0x55, 0x72, 0x69, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x71, 0x64, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, + 0x64, 0x6e, 0x12, 0x33, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x77, 0x73, 0x5f, 0x63, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x77, + 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x61, 0x77, 0x73, 0x5f, + 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 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, 0x2e, 0x41, 0x57, 0x53, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, + 0x61, 0x77, 0x73, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x1a, 0x35, 0x0a, 0x07, 0x41, 0x57, 0x53, 0x52, + 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x72, 0x6e, 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 ( + file_v1_app_proto_rawDescOnce sync.Once + file_v1_app_proto_rawDescData = file_v1_app_proto_rawDesc +) + +func file_v1_app_proto_rawDescGZIP() []byte { + file_v1_app_proto_rawDescOnce.Do(func() { + file_v1_app_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_app_proto_rawDescData) + }) + return file_v1_app_proto_rawDescData +} + +var file_v1_app_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_v1_app_proto_goTypes = []interface{}{ + (*App)(nil), // 0: teleport.terminal.v1.App + (*App_AWSRole)(nil), // 1: teleport.terminal.v1.App.AWSRole + (*Label)(nil), // 2: teleport.terminal.v1.Label +} +var file_v1_app_proto_depIdxs = []int32{ + 2, // 0: teleport.terminal.v1.App.labels:type_name -> teleport.terminal.v1.Label + 1, // 1: teleport.terminal.v1.App.aws_roles:type_name -> teleport.terminal.v1.App.AWSRole + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_v1_app_proto_init() } +func file_v1_app_proto_init() { + if File_v1_app_proto != nil { + return + } + file_v1_label_proto_init() + if !protoimpl.UnsafeEnabled { + file_v1_app_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*App); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_app_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*App_AWSRole); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_app_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_app_proto_goTypes, + DependencyIndexes: file_v1_app_proto_depIdxs, + MessageInfos: file_v1_app_proto_msgTypes, + }.Build() + File_v1_app_proto = out.File + file_v1_app_proto_rawDesc = nil + file_v1_app_proto_goTypes = nil + file_v1_app_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/auth_settings.pb.go b/lib/teleterm/api/protogen/golang/v1/auth_settings.pb.go new file mode 100644 index 0000000000000..a8540e7c4d967 --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/auth_settings.pb.go @@ -0,0 +1,306 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/auth_settings.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// AuthSettings contains the form of authentication the auth server supports. +type AuthSettings struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // local_auth_enabled is a flag that enables local authentication + LocalAuthEnabled bool `protobuf:"varint,1,opt,name=local_auth_enabled,json=localAuthEnabled,proto3" json:"local_auth_enabled,omitempty"` + // second_factor is the type of second factor to use in authentication. + SecondFactor string `protobuf:"bytes,2,opt,name=second_factor,json=secondFactor,proto3" json:"second_factor,omitempty"` + // preferred_mfa is the prefered mfa for local logins + PreferredMfa string `protobuf:"bytes,3,opt,name=preferred_mfa,json=preferredMfa,proto3" json:"preferred_mfa,omitempty"` + // auth_providers contains a list of auth providers + AuthProviders []*AuthProvider `protobuf:"bytes,4,rep,name=auth_providers,json=authProviders,proto3" json:"auth_providers,omitempty"` + // has_message_of_the_day is a flag indicating that the cluster has MOTD + // banner text that must be retrieved, displayed and acknowledged by + // the user. + HasMessageOfTheDay bool `protobuf:"varint,5,opt,name=has_message_of_the_day,json=hasMessageOfTheDay,proto3" json:"has_message_of_the_day,omitempty"` +} + +func (x *AuthSettings) Reset() { + *x = AuthSettings{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_auth_settings_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthSettings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthSettings) ProtoMessage() {} + +func (x *AuthSettings) ProtoReflect() protoreflect.Message { + mi := &file_v1_auth_settings_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthSettings.ProtoReflect.Descriptor instead. +func (*AuthSettings) Descriptor() ([]byte, []int) { + return file_v1_auth_settings_proto_rawDescGZIP(), []int{0} +} + +func (x *AuthSettings) GetLocalAuthEnabled() bool { + if x != nil { + return x.LocalAuthEnabled + } + return false +} + +func (x *AuthSettings) GetSecondFactor() string { + if x != nil { + return x.SecondFactor + } + return "" +} + +func (x *AuthSettings) GetPreferredMfa() string { + if x != nil { + return x.PreferredMfa + } + return "" +} + +func (x *AuthSettings) GetAuthProviders() []*AuthProvider { + if x != nil { + return x.AuthProviders + } + return nil +} + +func (x *AuthSettings) GetHasMessageOfTheDay() bool { + if x != nil { + return x.HasMessageOfTheDay + } + return false +} + +// AuthProvider describes a way of authentication that is supported by the server. Auth provider is +// referred to as "auth connector" on the backend. +type AuthProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Type is the auth provider type (github|oidc|etc) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Name is the internal name of the connector. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Display is the display name for the connector. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` +} + +func (x *AuthProvider) Reset() { + *x = AuthProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_auth_settings_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthProvider) ProtoMessage() {} + +func (x *AuthProvider) ProtoReflect() protoreflect.Message { + mi := &file_v1_auth_settings_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthProvider.ProtoReflect.Descriptor instead. +func (*AuthProvider) Descriptor() ([]byte, []int) { + return file_v1_auth_settings_proto_rawDescGZIP(), []int{1} +} + +func (x *AuthProvider) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *AuthProvider) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AuthProvider) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +var File_v1_auth_settings_proto protoreflect.FileDescriptor + +var file_v1_auth_settings_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0x85, + 0x02, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x2c, 0x0a, 0x12, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, + 0x0d, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x46, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, + 0x6d, 0x66, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x72, 0x65, 0x64, 0x4d, 0x66, 0x61, 0x12, 0x49, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x5f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 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, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x32, 0x0a, 0x16, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x68, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x12, 0x68, 0x61, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x66, + 0x54, 0x68, 0x65, 0x44, 0x61, 0x79, 0x22, 0x59, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, + 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 ( + file_v1_auth_settings_proto_rawDescOnce sync.Once + file_v1_auth_settings_proto_rawDescData = file_v1_auth_settings_proto_rawDesc +) + +func file_v1_auth_settings_proto_rawDescGZIP() []byte { + file_v1_auth_settings_proto_rawDescOnce.Do(func() { + file_v1_auth_settings_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_auth_settings_proto_rawDescData) + }) + return file_v1_auth_settings_proto_rawDescData +} + +var file_v1_auth_settings_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_v1_auth_settings_proto_goTypes = []interface{}{ + (*AuthSettings)(nil), // 0: teleport.terminal.v1.AuthSettings + (*AuthProvider)(nil), // 1: teleport.terminal.v1.AuthProvider +} +var file_v1_auth_settings_proto_depIdxs = []int32{ + 1, // 0: teleport.terminal.v1.AuthSettings.auth_providers:type_name -> teleport.terminal.v1.AuthProvider + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_v1_auth_settings_proto_init() } +func file_v1_auth_settings_proto_init() { + if File_v1_auth_settings_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_v1_auth_settings_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthSettings); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_auth_settings_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_auth_settings_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_auth_settings_proto_goTypes, + DependencyIndexes: file_v1_auth_settings_proto_depIdxs, + MessageInfos: file_v1_auth_settings_proto_msgTypes, + }.Build() + File_v1_auth_settings_proto = out.File + file_v1_auth_settings_proto_rawDesc = nil + file_v1_auth_settings_proto_goTypes = nil + file_v1_auth_settings_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/cluster.pb.go b/lib/teleterm/api/protogen/golang/v1/cluster.pb.go new file mode 100644 index 0000000000000..cc4ca18836cc4 --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/cluster.pb.go @@ -0,0 +1,640 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/cluster.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Cluster describes cluster fields +type Cluster struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the cluster resource URI + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // name is the cluster name + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // connected indicates if connection to the cluster can be established, that is if we have a + // cert for the cluster that hasn't expired + Connected bool `protobuf:"varint,3,opt,name=connected,proto3" json:"connected,omitempty"` + // leaf indicates if this is a leaf cluster + Leaf bool `protobuf:"varint,4,opt,name=leaf,proto3" json:"leaf,omitempty"` + // User is the cluster access control list of the logged-in user + LoggedInUser *LoggedInUser `protobuf:"bytes,5,opt,name=logged_in_user,json=loggedInUser,proto3" json:"logged_in_user,omitempty"` +} + +func (x *Cluster) Reset() { + *x = Cluster{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_cluster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Cluster) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cluster) ProtoMessage() {} + +func (x *Cluster) ProtoReflect() protoreflect.Message { + mi := &file_v1_cluster_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cluster.ProtoReflect.Descriptor instead. +func (*Cluster) Descriptor() ([]byte, []int) { + return file_v1_cluster_proto_rawDescGZIP(), []int{0} +} + +func (x *Cluster) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *Cluster) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Cluster) GetConnected() bool { + if x != nil { + return x.Connected + } + return false +} + +func (x *Cluster) GetLeaf() bool { + if x != nil { + return x.Leaf + } + return false +} + +func (x *Cluster) GetLoggedInUser() *LoggedInUser { + if x != nil { + return x.LoggedInUser + } + return nil +} + +// LoggedInUser describes a logged-in user +type LoggedInUser struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // name is the user name + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // roles is the user roles + Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` + // ssh_logins is the user ssh logins + SshLogins []string `protobuf:"bytes,3,rep,name=ssh_logins,json=sshLogins,proto3" json:"ssh_logins,omitempty"` + // acl is the user acl + Acl *ACL `protobuf:"bytes,4,opt,name=acl,proto3" json:"acl,omitempty"` +} + +func (x *LoggedInUser) Reset() { + *x = LoggedInUser{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_cluster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoggedInUser) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoggedInUser) ProtoMessage() {} + +func (x *LoggedInUser) ProtoReflect() protoreflect.Message { + mi := &file_v1_cluster_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoggedInUser.ProtoReflect.Descriptor instead. +func (*LoggedInUser) Descriptor() ([]byte, []int) { + return file_v1_cluster_proto_rawDescGZIP(), []int{1} +} + +func (x *LoggedInUser) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LoggedInUser) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +func (x *LoggedInUser) GetSshLogins() []string { + if x != nil { + return x.SshLogins + } + return nil +} + +func (x *LoggedInUser) GetAcl() *ACL { + if x != nil { + return x.Acl + } + return nil +} + +// ACL is the access control list of the user +type ACL struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // sessions defines access to recorded sessions + Sessions *ResourceAccess `protobuf:"bytes,1,opt,name=sessions,proto3" json:"sessions,omitempty"` + // auth_connectors defines access to auth.connectors + AuthConnectors *ResourceAccess `protobuf:"bytes,2,opt,name=auth_connectors,json=authConnectors,proto3" json:"auth_connectors,omitempty"` + // Roles defines access to roles + Roles *ResourceAccess `protobuf:"bytes,3,opt,name=roles,proto3" json:"roles,omitempty"` + // Users defines access to users. + Users *ResourceAccess `protobuf:"bytes,4,opt,name=users,proto3" json:"users,omitempty"` + // trusted_clusters defines access to trusted clusters + TrustedClusters *ResourceAccess `protobuf:"bytes,5,opt,name=trusted_clusters,json=trustedClusters,proto3" json:"trusted_clusters,omitempty"` + // Events defines access to audit logs + Events *ResourceAccess `protobuf:"bytes,6,opt,name=events,proto3" json:"events,omitempty"` + // Tokens defines access to tokens. + Tokens *ResourceAccess `protobuf:"bytes,7,opt,name=tokens,proto3" json:"tokens,omitempty"` + // Servers defines access to servers. + Servers *ResourceAccess `protobuf:"bytes,8,opt,name=servers,proto3" json:"servers,omitempty"` + // apps defines access to application servers + Apps *ResourceAccess `protobuf:"bytes,9,opt,name=apps,proto3" json:"apps,omitempty"` + // dbs defines access to database servers. + Dbs *ResourceAccess `protobuf:"bytes,10,opt,name=dbs,proto3" json:"dbs,omitempty"` + // kubeservers defines access to kubernetes servers. + Kubeservers *ResourceAccess `protobuf:"bytes,11,opt,name=kubeservers,proto3" json:"kubeservers,omitempty"` + // access_requests defines access to access requests + AccessRequests *ResourceAccess `protobuf:"bytes,12,opt,name=access_requests,json=accessRequests,proto3" json:"access_requests,omitempty"` +} + +func (x *ACL) Reset() { + *x = ACL{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_cluster_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ACL) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ACL) ProtoMessage() {} + +func (x *ACL) ProtoReflect() protoreflect.Message { + mi := &file_v1_cluster_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ACL.ProtoReflect.Descriptor instead. +func (*ACL) Descriptor() ([]byte, []int) { + return file_v1_cluster_proto_rawDescGZIP(), []int{2} +} + +func (x *ACL) GetSessions() *ResourceAccess { + if x != nil { + return x.Sessions + } + return nil +} + +func (x *ACL) GetAuthConnectors() *ResourceAccess { + if x != nil { + return x.AuthConnectors + } + return nil +} + +func (x *ACL) GetRoles() *ResourceAccess { + if x != nil { + return x.Roles + } + return nil +} + +func (x *ACL) GetUsers() *ResourceAccess { + if x != nil { + return x.Users + } + return nil +} + +func (x *ACL) GetTrustedClusters() *ResourceAccess { + if x != nil { + return x.TrustedClusters + } + return nil +} + +func (x *ACL) GetEvents() *ResourceAccess { + if x != nil { + return x.Events + } + return nil +} + +func (x *ACL) GetTokens() *ResourceAccess { + if x != nil { + return x.Tokens + } + return nil +} + +func (x *ACL) GetServers() *ResourceAccess { + if x != nil { + return x.Servers + } + return nil +} + +func (x *ACL) GetApps() *ResourceAccess { + if x != nil { + return x.Apps + } + return nil +} + +func (x *ACL) GetDbs() *ResourceAccess { + if x != nil { + return x.Dbs + } + return nil +} + +func (x *ACL) GetKubeservers() *ResourceAccess { + if x != nil { + return x.Kubeservers + } + return nil +} + +func (x *ACL) GetAccessRequests() *ResourceAccess { + if x != nil { + return x.AccessRequests + } + return nil +} + +// ResourceAccess describes access verbs +type ResourceAccess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // list determines "list" access + List bool `protobuf:"varint,1,opt,name=list,proto3" json:"list,omitempty"` + // read determines "read" access + Read bool `protobuf:"varint,2,opt,name=read,proto3" json:"read,omitempty"` + // edit determines "edit" access + Edit bool `protobuf:"varint,3,opt,name=edit,proto3" json:"edit,omitempty"` + // create determines "create" access + Create bool `protobuf:"varint,4,opt,name=create,proto3" json:"create,omitempty"` + // delete determines "delete" access + Delete bool `protobuf:"varint,5,opt,name=delete,proto3" json:"delete,omitempty"` +} + +func (x *ResourceAccess) Reset() { + *x = ResourceAccess{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_cluster_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceAccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceAccess) ProtoMessage() {} + +func (x *ResourceAccess) ProtoReflect() protoreflect.Message { + mi := &file_v1_cluster_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceAccess.ProtoReflect.Descriptor instead. +func (*ResourceAccess) Descriptor() ([]byte, []int) { + return file_v1_cluster_proto_rawDescGZIP(), []int{3} +} + +func (x *ResourceAccess) GetList() bool { + if x != nil { + return x.List + } + return false +} + +func (x *ResourceAccess) GetRead() bool { + if x != nil { + return x.Read + } + return false +} + +func (x *ResourceAccess) GetEdit() bool { + if x != nil { + return x.Edit + } + return false +} + +func (x *ResourceAccess) GetCreate() bool { + if x != nil { + return x.Create + } + return false +} + +func (x *ResourceAccess) GetDelete() bool { + if x != nil { + return x.Delete + } + return false +} + +var File_v1_cluster_proto protoreflect.FileDescriptor + +var file_v1_cluster_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0xab, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x12, 0x48, 0x0a, 0x0e, + 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 0x67, + 0x65, 0x64, 0x49, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0c, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x64, + 0x49, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x67, 0x65, + 0x64, 0x49, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, + 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, + 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x73, 0x68, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x73, 0x68, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x73, + 0x12, 0x2b, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x04, 0x20, 0x01, 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, 0x43, 0x4c, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x22, 0xa4, 0x06, + 0x0a, 0x03, 0x41, 0x43, 0x4c, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x08, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x05, 0x72, 0x6f, 0x6c, + 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x4f, + 0x0a, 0x10, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x0f, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, + 0x3c, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3c, 0x0a, + 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x04, 0x61, + 0x70, 0x70, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, + 0x04, 0x61, 0x70, 0x70, 0x73, 0x12, 0x36, 0x0a, 0x03, 0x64, 0x62, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x03, 0x64, 0x62, 0x73, 0x12, 0x46, 0x0a, + 0x0b, 0x6b, 0x75, 0x62, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 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, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x0b, 0x6b, 0x75, 0x62, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 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, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x22, 0x7c, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, + 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x72, 0x65, 0x61, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x65, 0x64, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x64, + 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, + 0x74, 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 ( + file_v1_cluster_proto_rawDescOnce sync.Once + file_v1_cluster_proto_rawDescData = file_v1_cluster_proto_rawDesc +) + +func file_v1_cluster_proto_rawDescGZIP() []byte { + file_v1_cluster_proto_rawDescOnce.Do(func() { + file_v1_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_cluster_proto_rawDescData) + }) + return file_v1_cluster_proto_rawDescData +} + +var file_v1_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_v1_cluster_proto_goTypes = []interface{}{ + (*Cluster)(nil), // 0: teleport.terminal.v1.Cluster + (*LoggedInUser)(nil), // 1: teleport.terminal.v1.LoggedInUser + (*ACL)(nil), // 2: teleport.terminal.v1.ACL + (*ResourceAccess)(nil), // 3: teleport.terminal.v1.ResourceAccess +} +var file_v1_cluster_proto_depIdxs = []int32{ + 1, // 0: teleport.terminal.v1.Cluster.logged_in_user:type_name -> teleport.terminal.v1.LoggedInUser + 2, // 1: teleport.terminal.v1.LoggedInUser.acl:type_name -> teleport.terminal.v1.ACL + 3, // 2: teleport.terminal.v1.ACL.sessions:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 3: teleport.terminal.v1.ACL.auth_connectors:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 4: teleport.terminal.v1.ACL.roles:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 5: teleport.terminal.v1.ACL.users:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 6: teleport.terminal.v1.ACL.trusted_clusters:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 7: teleport.terminal.v1.ACL.events:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 8: teleport.terminal.v1.ACL.tokens:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 9: teleport.terminal.v1.ACL.servers:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 10: teleport.terminal.v1.ACL.apps:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 11: teleport.terminal.v1.ACL.dbs:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 12: teleport.terminal.v1.ACL.kubeservers:type_name -> teleport.terminal.v1.ResourceAccess + 3, // 13: teleport.terminal.v1.ACL.access_requests:type_name -> teleport.terminal.v1.ResourceAccess + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_v1_cluster_proto_init() } +func file_v1_cluster_proto_init() { + if File_v1_cluster_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_v1_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Cluster); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_cluster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoggedInUser); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_cluster_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ACL); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_cluster_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceAccess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_cluster_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_cluster_proto_goTypes, + DependencyIndexes: file_v1_cluster_proto_depIdxs, + MessageInfos: file_v1_cluster_proto_msgTypes, + }.Build() + File_v1_cluster_proto = out.File + file_v1_cluster_proto_rawDesc = nil + file_v1_cluster_proto_goTypes = nil + file_v1_cluster_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/database.pb.go b/lib/teleterm/api/protogen/golang/v1/database.pb.go new file mode 100644 index 0000000000000..3e4321519023b --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/database.pb.go @@ -0,0 +1,245 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/database.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Database describes a database +type Database struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the cluster resource URI + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // name is the name of the database + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // desc is the database description + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + // protocol is the protocol used by the database + Protocol string `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"` + // type is the database type, self-hosted or cloud-hosted. + Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` + // hostname is this database hostname + Hostname string `protobuf:"bytes,6,opt,name=hostname,proto3" json:"hostname,omitempty"` + // addr is this database ip address + Addr string `protobuf:"bytes,7,opt,name=addr,proto3" json:"addr,omitempty"` + // labels is a list of labels for this database + Labels []*Label `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty"` +} + +func (x *Database) Reset() { + *x = Database{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_database_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Database) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Database) ProtoMessage() {} + +func (x *Database) ProtoReflect() protoreflect.Message { + mi := &file_v1_database_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Database.ProtoReflect.Descriptor instead. +func (*Database) Descriptor() ([]byte, []int) { + return file_v1_database_proto_rawDescGZIP(), []int{0} +} + +func (x *Database) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *Database) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Database) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *Database) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + +func (x *Database) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Database) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *Database) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Database) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +var File_v1_database_proto protoreflect.FileDescriptor + +var file_v1_database_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x0e, 0x76, 0x31, 0x2f, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x01, 0x0a, 0x08, 0x44, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x61, 0x64, 0x64, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x12, 0x33, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 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 ( + file_v1_database_proto_rawDescOnce sync.Once + file_v1_database_proto_rawDescData = file_v1_database_proto_rawDesc +) + +func file_v1_database_proto_rawDescGZIP() []byte { + file_v1_database_proto_rawDescOnce.Do(func() { + file_v1_database_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_database_proto_rawDescData) + }) + return file_v1_database_proto_rawDescData +} + +var file_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_v1_database_proto_goTypes = []interface{}{ + (*Database)(nil), // 0: teleport.terminal.v1.Database + (*Label)(nil), // 1: teleport.terminal.v1.Label +} +var file_v1_database_proto_depIdxs = []int32{ + 1, // 0: teleport.terminal.v1.Database.labels:type_name -> teleport.terminal.v1.Label + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_v1_database_proto_init() } +func file_v1_database_proto_init() { + if File_v1_database_proto != nil { + return + } + file_v1_label_proto_init() + if !protoimpl.UnsafeEnabled { + file_v1_database_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Database); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_database_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_database_proto_goTypes, + DependencyIndexes: file_v1_database_proto_depIdxs, + MessageInfos: file_v1_database_proto_msgTypes, + }.Build() + File_v1_database_proto = out.File + file_v1_database_proto_rawDesc = nil + file_v1_database_proto_goTypes = nil + file_v1_database_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/gateway.pb.go b/lib/teleterm/api/protogen/golang/v1/gateway.pb.go new file mode 100644 index 0000000000000..0fb29b0f9c8ae --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/gateway.pb.go @@ -0,0 +1,282 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/gateway.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Gateway is Teleterm's name for a connection to a resource like a database or a web app +// established through our ALPN proxy. +// +// The term "gateway" is used to avoid using the term "proxy" itself which could be confusing as +// "proxy" means a couple of different things depending on the context. But for Teleterm, a gateway +// is always an ALPN proxy connection. +// +// See RFD 39 for more info on ALPN. +type Gateway struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the gateway uri + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // target_name is the target resource name + TargetName string `protobuf:"bytes,2,opt,name=target_name,json=targetName,proto3" json:"target_name,omitempty"` + // target_uri is the target uri + TargetUri string `protobuf:"bytes,3,opt,name=target_uri,json=targetUri,proto3" json:"target_uri,omitempty"` + // target_user is the target user + TargetUser string `protobuf:"bytes,4,opt,name=target_user,json=targetUser,proto3" json:"target_user,omitempty"` + // local_address is the gateway address on localhost + LocalAddress string `protobuf:"bytes,5,opt,name=local_address,json=localAddress,proto3" json:"local_address,omitempty"` + // local_port is the gateway address on localhost + LocalPort string `protobuf:"bytes,6,opt,name=local_port,json=localPort,proto3" json:"local_port,omitempty"` + // protocol is the gateway protocol + Protocol string `protobuf:"bytes,7,opt,name=protocol,proto3" json:"protocol,omitempty"` + // insecure is whether to skip certificate validation + Insecure bool `protobuf:"varint,8,opt,name=insecure,proto3" json:"insecure,omitempty"` + // ca_cert_path + CaCertPath string `protobuf:"bytes,9,opt,name=ca_cert_path,json=caCertPath,proto3" json:"ca_cert_path,omitempty"` + // cert_path + CertPath string `protobuf:"bytes,10,opt,name=cert_path,json=certPath,proto3" json:"cert_path,omitempty"` + // key_path + KeyPath string `protobuf:"bytes,11,opt,name=key_path,json=keyPath,proto3" json:"key_path,omitempty"` +} + +func (x *Gateway) Reset() { + *x = Gateway{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_gateway_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Gateway) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Gateway) ProtoMessage() {} + +func (x *Gateway) ProtoReflect() protoreflect.Message { + mi := &file_v1_gateway_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Gateway.ProtoReflect.Descriptor instead. +func (*Gateway) Descriptor() ([]byte, []int) { + return file_v1_gateway_proto_rawDescGZIP(), []int{0} +} + +func (x *Gateway) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *Gateway) GetTargetName() string { + if x != nil { + return x.TargetName + } + return "" +} + +func (x *Gateway) GetTargetUri() string { + if x != nil { + return x.TargetUri + } + return "" +} + +func (x *Gateway) GetTargetUser() string { + if x != nil { + return x.TargetUser + } + return "" +} + +func (x *Gateway) GetLocalAddress() string { + if x != nil { + return x.LocalAddress + } + return "" +} + +func (x *Gateway) GetLocalPort() string { + if x != nil { + return x.LocalPort + } + return "" +} + +func (x *Gateway) GetProtocol() string { + if x != nil { + return x.Protocol + } + return "" +} + +func (x *Gateway) GetInsecure() bool { + if x != nil { + return x.Insecure + } + return false +} + +func (x *Gateway) GetCaCertPath() string { + if x != nil { + return x.CaCertPath + } + return "" +} + +func (x *Gateway) GetCertPath() string { + if x != nil { + return x.CertPath + } + return "" +} + +func (x *Gateway) GetKeyPath() string { + if x != nil { + return x.KeyPath + } + return "" +} + +var File_v1_gateway_proto protoreflect.FileDescriptor + +var file_v1_gateway_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x76, 0x31, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0xd2, 0x02, 0x0a, 0x07, 0x47, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x55, 0x72, 0x69, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x63, 0x61, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x43, 0x65, 0x72, + 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x65, 0x72, 0x74, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x74, 0x68, 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 ( + file_v1_gateway_proto_rawDescOnce sync.Once + file_v1_gateway_proto_rawDescData = file_v1_gateway_proto_rawDesc +) + +func file_v1_gateway_proto_rawDescGZIP() []byte { + file_v1_gateway_proto_rawDescOnce.Do(func() { + file_v1_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_gateway_proto_rawDescData) + }) + return file_v1_gateway_proto_rawDescData +} + +var file_v1_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_v1_gateway_proto_goTypes = []interface{}{ + (*Gateway)(nil), // 0: teleport.terminal.v1.Gateway +} +var file_v1_gateway_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_v1_gateway_proto_init() } +func file_v1_gateway_proto_init() { + if File_v1_gateway_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_v1_gateway_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Gateway); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_gateway_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_gateway_proto_goTypes, + DependencyIndexes: file_v1_gateway_proto_depIdxs, + MessageInfos: file_v1_gateway_proto_msgTypes, + }.Build() + File_v1_gateway_proto = out.File + file_v1_gateway_proto_rawDesc = nil + file_v1_gateway_proto_goTypes = nil + file_v1_gateway_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/kube.pb.go b/lib/teleterm/api/protogen/golang/v1/kube.pb.go new file mode 100644 index 0000000000000..b181b0ac4a8ab --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/kube.pb.go @@ -0,0 +1,192 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/kube.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Kube describes connected Kubernetes cluster +type Kube struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the kube resource URI + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // name is the kube name + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // labels is the kube labels + Labels []*Label `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` +} + +func (x *Kube) Reset() { + *x = Kube{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_kube_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Kube) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Kube) ProtoMessage() {} + +func (x *Kube) ProtoReflect() protoreflect.Message { + mi := &file_v1_kube_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Kube.ProtoReflect.Descriptor instead. +func (*Kube) Descriptor() ([]byte, []int) { + return file_v1_kube_proto_rawDescGZIP(), []int{0} +} + +func (x *Kube) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *Kube) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Kube) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +var File_v1_kube_proto protoreflect.FileDescriptor + +var file_v1_kube_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x76, 0x31, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x0e, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x61, 0x0a, 0x04, 0x4b, 0x75, 0x62, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 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 ( + file_v1_kube_proto_rawDescOnce sync.Once + file_v1_kube_proto_rawDescData = file_v1_kube_proto_rawDesc +) + +func file_v1_kube_proto_rawDescGZIP() []byte { + file_v1_kube_proto_rawDescOnce.Do(func() { + file_v1_kube_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_kube_proto_rawDescData) + }) + return file_v1_kube_proto_rawDescData +} + +var file_v1_kube_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_v1_kube_proto_goTypes = []interface{}{ + (*Kube)(nil), // 0: teleport.terminal.v1.Kube + (*Label)(nil), // 1: teleport.terminal.v1.Label +} +var file_v1_kube_proto_depIdxs = []int32{ + 1, // 0: teleport.terminal.v1.Kube.labels:type_name -> teleport.terminal.v1.Label + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_v1_kube_proto_init() } +func file_v1_kube_proto_init() { + if File_v1_kube_proto != nil { + return + } + file_v1_label_proto_init() + if !protoimpl.UnsafeEnabled { + file_v1_kube_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Kube); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_kube_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_kube_proto_goTypes, + DependencyIndexes: file_v1_kube_proto_depIdxs, + MessageInfos: file_v1_kube_proto_msgTypes, + }.Build() + File_v1_kube_proto = out.File + file_v1_kube_proto_rawDesc = nil + file_v1_kube_proto_goTypes = nil + file_v1_kube_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/label.pb.go b/lib/teleterm/api/protogen/golang/v1/label.pb.go new file mode 100644 index 0000000000000..f0f74c47bb0b8 --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/label.pb.go @@ -0,0 +1,176 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/label.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Label describes a label +type Label struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // name is this label name + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // value is this label value + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Label) Reset() { + *x = Label{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_label_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Label) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Label) ProtoMessage() {} + +func (x *Label) ProtoReflect() protoreflect.Message { + mi := &file_v1_label_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Label.ProtoReflect.Descriptor instead. +func (*Label) Descriptor() ([]byte, []int) { + return file_v1_label_proto_rawDescGZIP(), []int{0} +} + +func (x *Label) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Label) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_v1_label_proto protoreflect.FileDescriptor + +var file_v1_label_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0x31, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 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 ( + file_v1_label_proto_rawDescOnce sync.Once + file_v1_label_proto_rawDescData = file_v1_label_proto_rawDesc +) + +func file_v1_label_proto_rawDescGZIP() []byte { + file_v1_label_proto_rawDescOnce.Do(func() { + file_v1_label_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_label_proto_rawDescData) + }) + return file_v1_label_proto_rawDescData +} + +var file_v1_label_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_v1_label_proto_goTypes = []interface{}{ + (*Label)(nil), // 0: teleport.terminal.v1.Label +} +var file_v1_label_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_v1_label_proto_init() } +func file_v1_label_proto_init() { + if File_v1_label_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_v1_label_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Label); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_label_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_label_proto_goTypes, + DependencyIndexes: file_v1_label_proto_depIdxs, + MessageInfos: file_v1_label_proto_msgTypes, + }.Build() + File_v1_label_proto = out.File + file_v1_label_proto_rawDesc = nil + file_v1_label_proto_goTypes = nil + file_v1_label_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/server.pb.go b/lib/teleterm/api/protogen/golang/v1/server.pb.go new file mode 100644 index 0000000000000..12869948c732c --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/server.pb.go @@ -0,0 +1,224 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/server.proto + +package v1 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// Server describes connected Server +type Server struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // uri is the server uri + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // tunnel indicates if this server is connected over a reverse tunnel + Tunnel bool `protobuf:"varint,2,opt,name=tunnel,proto3" json:"tunnel,omitempty"` + // name is the server name + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // hostname is this server hostname + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + // addr is this server ip address + Addr string `protobuf:"bytes,5,opt,name=addr,proto3" json:"addr,omitempty"` + // labels is this server list of labels + Labels []*Label `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty"` +} + +func (x *Server) Reset() { + *x = Server{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_server_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Server) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Server) ProtoMessage() {} + +func (x *Server) ProtoReflect() protoreflect.Message { + mi := &file_v1_server_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Server.ProtoReflect.Descriptor instead. +func (*Server) Descriptor() ([]byte, []int) { + return file_v1_server_proto_rawDescGZIP(), []int{0} +} + +func (x *Server) GetUri() string { + if x != nil { + return x.Uri + } + return "" +} + +func (x *Server) GetTunnel() bool { + if x != nil { + return x.Tunnel + } + return false +} + +func (x *Server) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Server) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *Server) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Server) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +var File_v1_server_proto protoreflect.FileDescriptor + +var file_v1_server_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x0e, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xab, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x75, 0x72, 0x69, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x61, 0x64, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x12, 0x33, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, 0x6d, + 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 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 ( + file_v1_server_proto_rawDescOnce sync.Once + file_v1_server_proto_rawDescData = file_v1_server_proto_rawDesc +) + +func file_v1_server_proto_rawDescGZIP() []byte { + file_v1_server_proto_rawDescOnce.Do(func() { + file_v1_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_server_proto_rawDescData) + }) + return file_v1_server_proto_rawDescData +} + +var file_v1_server_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_v1_server_proto_goTypes = []interface{}{ + (*Server)(nil), // 0: teleport.terminal.v1.Server + (*Label)(nil), // 1: teleport.terminal.v1.Label +} +var file_v1_server_proto_depIdxs = []int32{ + 1, // 0: teleport.terminal.v1.Server.labels:type_name -> teleport.terminal.v1.Label + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_v1_server_proto_init() } +func file_v1_server_proto_init() { + if File_v1_server_proto != nil { + return + } + file_v1_label_proto_init() + if !protoimpl.UnsafeEnabled { + file_v1_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Server); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_server_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_v1_server_proto_goTypes, + DependencyIndexes: file_v1_server_proto_depIdxs, + MessageInfos: file_v1_server_proto_msgTypes, + }.Build() + File_v1_server_proto = out.File + file_v1_server_proto_rawDesc = nil + file_v1_server_proto_goTypes = nil + file_v1_server_proto_depIdxs = nil +} diff --git a/lib/teleterm/api/protogen/golang/v1/service.pb.go b/lib/teleterm/api/protogen/golang/v1/service.pb.go new file mode 100644 index 0000000000000..e3249a4b6de61 --- /dev/null +++ b/lib/teleterm/api/protogen/golang/v1/service.pb.go @@ -0,0 +1,2468 @@ +// Copyright 2021 Gravitational, Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.23.0 +// protoc v3.17.3 +// source: v1/service.proto + +package v1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// RemoveClusterRequest describes RemoveClusterRequest +type RemoveClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *RemoveClusterRequest) Reset() { + *x = RemoveClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveClusterRequest) ProtoMessage() {} + +func (x *RemoveClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveClusterRequest.ProtoReflect.Descriptor instead. +func (*RemoveClusterRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{0} +} + +func (x *RemoveClusterRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +// GetClusterRequest describes GetClusterRequest +type GetClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *GetClusterRequest) Reset() { + *x = GetClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterRequest) ProtoMessage() {} + +func (x *GetClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterRequest.ProtoReflect.Descriptor instead. +func (*GetClusterRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetClusterRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +// LogoutRequest describes LogoutRequest +type LogoutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *LogoutRequest) Reset() { + *x = LogoutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogoutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutRequest) ProtoMessage() {} + +func (x *LogoutRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. +func (*LogoutRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{2} +} + +func (x *LogoutRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +// LoginRequest describes cluster login request +type LoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // cluster_uri is the cluster uri + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` + // local holds parameters for local logins + Local *LoginRequest_LocalParams `protobuf:"bytes,2,opt,name=local,proto3" json:"local,omitempty"` + // sso holds parameters for sso logins + Sso *LoginRequest_SsoParams `protobuf:"bytes,3,opt,name=sso,proto3" json:"sso,omitempty"` +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{3} +} + +func (x *LoginRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +func (x *LoginRequest) GetLocal() *LoginRequest_LocalParams { + if x != nil { + return x.Local + } + return nil +} + +func (x *LoginRequest) GetSso() *LoginRequest_SsoParams { + if x != nil { + return x.Sso + } + return nil +} + +type AddClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *AddClusterRequest) Reset() { + *x = AddClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddClusterRequest) ProtoMessage() {} + +func (x *AddClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddClusterRequest.ProtoReflect.Descriptor instead. +func (*AddClusterRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{4} +} + +func (x *AddClusterRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ListKubesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *ListKubesRequest) Reset() { + *x = ListKubesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListKubesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKubesRequest) ProtoMessage() {} + +func (x *ListKubesRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKubesRequest.ProtoReflect.Descriptor instead. +func (*ListKubesRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{5} +} + +func (x *ListKubesRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +type ListAppsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *ListAppsRequest) Reset() { + *x = ListAppsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAppsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAppsRequest) ProtoMessage() {} + +func (x *ListAppsRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAppsRequest.ProtoReflect.Descriptor instead. +func (*ListAppsRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{6} +} + +func (x *ListAppsRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +type ListClustersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListClustersRequest) Reset() { + *x = ListClustersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClustersRequest) ProtoMessage() {} + +func (x *ListClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[7] + 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 ListClustersRequest.ProtoReflect.Descriptor instead. +func (*ListClustersRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{7} +} + +type ListClustersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clusters []*Cluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` +} + +func (x *ListClustersResponse) Reset() { + *x = ListClustersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListClustersResponse) ProtoMessage() {} + +func (x *ListClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[8] + 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 ListClustersResponse.ProtoReflect.Descriptor instead. +func (*ListClustersResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{8} +} + +func (x *ListClustersResponse) GetClusters() []*Cluster { + if x != nil { + return x.Clusters + } + return nil +} + +type ListDatabasesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *ListDatabasesRequest) Reset() { + *x = ListDatabasesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDatabasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDatabasesRequest) ProtoMessage() {} + +func (x *ListDatabasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[9] + 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 ListDatabasesRequest.ProtoReflect.Descriptor instead. +func (*ListDatabasesRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{9} +} + +func (x *ListDatabasesRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +type ListLeafClustersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *ListLeafClustersRequest) Reset() { + *x = ListLeafClustersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListLeafClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListLeafClustersRequest) ProtoMessage() {} + +func (x *ListLeafClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[10] + 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 ListLeafClustersRequest.ProtoReflect.Descriptor instead. +func (*ListLeafClustersRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{10} +} + +func (x *ListLeafClustersRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +type ListDatabasesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Databases []*Database `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` +} + +func (x *ListDatabasesResponse) Reset() { + *x = ListDatabasesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDatabasesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDatabasesResponse) ProtoMessage() {} + +func (x *ListDatabasesResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[11] + 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 ListDatabasesResponse.ProtoReflect.Descriptor instead. +func (*ListDatabasesResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{11} +} + +func (x *ListDatabasesResponse) GetDatabases() []*Database { + if x != nil { + return x.Databases + } + return nil +} + +type CreateGatewayRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetUri string `protobuf:"bytes,1,opt,name=target_uri,json=targetUri,proto3" json:"target_uri,omitempty"` + TargetUser string `protobuf:"bytes,2,opt,name=target_user,json=targetUser,proto3" json:"target_user,omitempty"` + LocalPort string `protobuf:"bytes,3,opt,name=local_port,json=localPort,proto3" json:"local_port,omitempty"` +} + +func (x *CreateGatewayRequest) Reset() { + *x = CreateGatewayRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateGatewayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGatewayRequest) ProtoMessage() {} + +func (x *CreateGatewayRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[12] + 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 CreateGatewayRequest.ProtoReflect.Descriptor instead. +func (*CreateGatewayRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{12} +} + +func (x *CreateGatewayRequest) GetTargetUri() string { + if x != nil { + return x.TargetUri + } + return "" +} + +func (x *CreateGatewayRequest) GetTargetUser() string { + if x != nil { + return x.TargetUser + } + return "" +} + +func (x *CreateGatewayRequest) GetLocalPort() string { + if x != nil { + return x.LocalPort + } + return "" +} + +type ListGatewaysRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterIds []string `protobuf:"bytes,1,rep,name=cluster_ids,json=clusterIds,proto3" json:"cluster_ids,omitempty"` +} + +func (x *ListGatewaysRequest) Reset() { + *x = ListGatewaysRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListGatewaysRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGatewaysRequest) ProtoMessage() {} + +func (x *ListGatewaysRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[13] + 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 ListGatewaysRequest.ProtoReflect.Descriptor instead. +func (*ListGatewaysRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{13} +} + +func (x *ListGatewaysRequest) GetClusterIds() []string { + if x != nil { + return x.ClusterIds + } + return nil +} + +type ListGatewaysResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Gateways []*Gateway `protobuf:"bytes,1,rep,name=gateways,proto3" json:"gateways,omitempty"` +} + +func (x *ListGatewaysResponse) Reset() { + *x = ListGatewaysResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListGatewaysResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGatewaysResponse) ProtoMessage() {} + +func (x *ListGatewaysResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[14] + 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 ListGatewaysResponse.ProtoReflect.Descriptor instead. +func (*ListGatewaysResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{14} +} + +func (x *ListGatewaysResponse) GetGateways() []*Gateway { + if x != nil { + return x.Gateways + } + return nil +} + +type RemoveGatewayRequest 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"` +} + +func (x *RemoveGatewayRequest) Reset() { + *x = RemoveGatewayRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveGatewayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveGatewayRequest) ProtoMessage() {} + +func (x *RemoveGatewayRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[15] + 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 RemoveGatewayRequest.ProtoReflect.Descriptor instead. +func (*RemoveGatewayRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{15} +} + +func (x *RemoveGatewayRequest) GetGatewayUri() string { + if x != nil { + return x.GatewayUri + } + return "" +} + +type ListServersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *ListServersRequest) Reset() { + *x = ListServersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListServersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListServersRequest) ProtoMessage() {} + +func (x *ListServersRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[16] + 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 ListServersRequest.ProtoReflect.Descriptor instead. +func (*ListServersRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{16} +} + +func (x *ListServersRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +type ListServersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Servers []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"` +} + +func (x *ListServersResponse) Reset() { + *x = ListServersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListServersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListServersResponse) ProtoMessage() {} + +func (x *ListServersResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[17] + 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 ListServersResponse.ProtoReflect.Descriptor instead. +func (*ListServersResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{17} +} + +func (x *ListServersResponse) GetServers() []*Server { + if x != nil { + return x.Servers + } + return nil +} + +type ListKubesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kubes []*Kube `protobuf:"bytes,1,rep,name=kubes,proto3" json:"kubes,omitempty"` +} + +func (x *ListKubesResponse) Reset() { + *x = ListKubesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListKubesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKubesResponse) ProtoMessage() {} + +func (x *ListKubesResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[18] + 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 ListKubesResponse.ProtoReflect.Descriptor instead. +func (*ListKubesResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{18} +} + +func (x *ListKubesResponse) GetKubes() []*Kube { + if x != nil { + return x.Kubes + } + return nil +} + +type ListAppsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Apps []*App `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps,omitempty"` +} + +func (x *ListAppsResponse) Reset() { + *x = ListAppsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAppsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAppsResponse) ProtoMessage() {} + +func (x *ListAppsResponse) 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 ListAppsResponse.ProtoReflect.Descriptor instead. +func (*ListAppsResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{19} +} + +func (x *ListAppsResponse) GetApps() []*App { + if x != nil { + return x.Apps + } + return nil +} + +type GetAuthSettingsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterUri string `protobuf:"bytes,1,opt,name=cluster_uri,json=clusterUri,proto3" json:"cluster_uri,omitempty"` +} + +func (x *GetAuthSettingsRequest) Reset() { + *x = GetAuthSettingsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAuthSettingsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAuthSettingsRequest) ProtoMessage() {} + +func (x *GetAuthSettingsRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[20] + 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 GetAuthSettingsRequest.ProtoReflect.Descriptor instead. +func (*GetAuthSettingsRequest) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{20} +} + +func (x *GetAuthSettingsRequest) GetClusterUri() string { + if x != nil { + return x.ClusterUri + } + return "" +} + +type EmptyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EmptyResponse) Reset() { + *x = EmptyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyResponse) ProtoMessage() {} + +func (x *EmptyResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[21] + 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 EmptyResponse.ProtoReflect.Descriptor instead. +func (*EmptyResponse) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{21} +} + +// LocalParams describes parameters for local user logins +type LoginRequest_LocalParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // user is the user name + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + // password is the user password + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + // token is the 2FA token + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *LoginRequest_LocalParams) Reset() { + *x = LoginRequest_LocalParams{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest_LocalParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest_LocalParams) ProtoMessage() {} + +func (x *LoginRequest_LocalParams) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[22] + 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 LoginRequest_LocalParams.ProtoReflect.Descriptor instead. +func (*LoginRequest_LocalParams) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *LoginRequest_LocalParams) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *LoginRequest_LocalParams) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *LoginRequest_LocalParams) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +// SsoParams describes SSO parameters +type LoginRequest_SsoParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // provider_type is the provider type + ProviderType string `protobuf:"bytes,1,opt,name=provider_type,json=providerType,proto3" json:"provider_type,omitempty"` + // provider_name is the provider name + ProviderName string `protobuf:"bytes,2,opt,name=provider_name,json=providerName,proto3" json:"provider_name,omitempty"` +} + +func (x *LoginRequest_SsoParams) Reset() { + *x = LoginRequest_SsoParams{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_service_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest_SsoParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest_SsoParams) ProtoMessage() {} + +func (x *LoginRequest_SsoParams) ProtoReflect() protoreflect.Message { + mi := &file_v1_service_proto_msgTypes[23] + 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 LoginRequest_SsoParams.ProtoReflect.Descriptor instead. +func (*LoginRequest_SsoParams) Descriptor() ([]byte, []int) { + return file_v1_service_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *LoginRequest_SsoParams) GetProviderType() string { + if x != nil { + return x.ProviderType + } + return "" +} + +func (x *LoginRequest_SsoParams) GetProviderName() string { + if x != nil { + return x.ProviderName + } + return "" +} + +var File_v1_service_proto protoreflect.FileDescriptor + +var file_v1_service_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x76, 0x31, 0x2f, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x76, 0x31, + 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x76, 0x31, 0x2f, + 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x76, 0x31, 0x2f, 0x61, + 0x75, 0x74, 0x68, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x37, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 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, 0x34, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 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, 0x30, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 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, 0xe1, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 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, 0x12, 0x44, 0x0a, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 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, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x3e, 0x0a, 0x03, 0x73, + 0x73, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 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, 0x2e, 0x53, 0x73, 0x6f, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x03, 0x73, 0x73, 0x6f, 0x1a, 0x53, 0x0a, 0x0b, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x1a, 0x55, 0x0a, 0x09, 0x53, 0x73, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x33, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x75, 0x62, 0x65, 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, 0x32, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, + 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, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x51, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 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, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x73, 0x22, 0x37, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 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, 0x3a, 0x0a, 0x17, + 0x4c, 0x69, 0x73, 0x74, 0x4c, 0x65, 0x61, 0x66, 0x43, 0x6c, 0x75, 0x73, 0x74, 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, 0x55, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x52, 0x09, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x22, + 0x75, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x55, 0x72, 0x69, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x36, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0x51, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 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, 0x52, 0x08, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x73, 0x22, 0x37, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 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, 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, 0xb0, 0x0b, 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, 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, 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, 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, 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 ( + file_v1_service_proto_rawDescOnce sync.Once + file_v1_service_proto_rawDescData = file_v1_service_proto_rawDesc +) + +func file_v1_service_proto_rawDescGZIP() []byte { + file_v1_service_proto_rawDescOnce.Do(func() { + file_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_service_proto_rawDescData) + }) + return file_v1_service_proto_rawDescData +} + +var file_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +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 + (*CreateGatewayRequest)(nil), // 12: teleport.terminal.v1.CreateGatewayRequest + (*ListGatewaysRequest)(nil), // 13: teleport.terminal.v1.ListGatewaysRequest + (*ListGatewaysResponse)(nil), // 14: teleport.terminal.v1.ListGatewaysResponse + (*RemoveGatewayRequest)(nil), // 15: teleport.terminal.v1.RemoveGatewayRequest + (*ListServersRequest)(nil), // 16: teleport.terminal.v1.ListServersRequest + (*ListServersResponse)(nil), // 17: teleport.terminal.v1.ListServersResponse + (*ListKubesResponse)(nil), // 18: teleport.terminal.v1.ListKubesResponse + (*ListAppsResponse)(nil), // 19: teleport.terminal.v1.ListAppsResponse + (*GetAuthSettingsRequest)(nil), // 20: teleport.terminal.v1.GetAuthSettingsRequest + (*EmptyResponse)(nil), // 21: teleport.terminal.v1.EmptyResponse + (*LoginRequest_LocalParams)(nil), // 22: teleport.terminal.v1.LoginRequest.LocalParams + (*LoginRequest_SsoParams)(nil), // 23: teleport.terminal.v1.LoginRequest.SsoParams + (*Cluster)(nil), // 24: teleport.terminal.v1.Cluster + (*Database)(nil), // 25: teleport.terminal.v1.Database + (*Gateway)(nil), // 26: teleport.terminal.v1.Gateway + (*Server)(nil), // 27: teleport.terminal.v1.Server + (*Kube)(nil), // 28: teleport.terminal.v1.Kube + (*App)(nil), // 29: teleport.terminal.v1.App + (*AuthSettings)(nil), // 30: teleport.terminal.v1.AuthSettings +} +var file_v1_service_proto_depIdxs = []int32{ + 22, // 0: teleport.terminal.v1.LoginRequest.local:type_name -> teleport.terminal.v1.LoginRequest.LocalParams + 23, // 1: teleport.terminal.v1.LoginRequest.sso:type_name -> teleport.terminal.v1.LoginRequest.SsoParams + 24, // 2: teleport.terminal.v1.ListClustersResponse.clusters:type_name -> teleport.terminal.v1.Cluster + 25, // 3: teleport.terminal.v1.ListDatabasesResponse.databases:type_name -> teleport.terminal.v1.Database + 26, // 4: teleport.terminal.v1.ListGatewaysResponse.gateways:type_name -> teleport.terminal.v1.Gateway + 27, // 5: teleport.terminal.v1.ListServersResponse.servers:type_name -> teleport.terminal.v1.Server + 28, // 6: teleport.terminal.v1.ListKubesResponse.kubes:type_name -> teleport.terminal.v1.Kube + 29, // 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 + 13, // 11: teleport.terminal.v1.TerminalService.ListGateways:input_type -> teleport.terminal.v1.ListGatewaysRequest + 16, // 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 + 12, // 15: teleport.terminal.v1.TerminalService.CreateGateway:input_type -> teleport.terminal.v1.CreateGatewayRequest + 4, // 16: teleport.terminal.v1.TerminalService.AddCluster:input_type -> teleport.terminal.v1.AddClusterRequest + 0, // 17: teleport.terminal.v1.TerminalService.RemoveCluster:input_type -> teleport.terminal.v1.RemoveClusterRequest + 15, // 18: teleport.terminal.v1.TerminalService.RemoveGateway:input_type -> teleport.terminal.v1.RemoveGatewayRequest + 20, // 19: teleport.terminal.v1.TerminalService.GetAuthSettings:input_type -> teleport.terminal.v1.GetAuthSettingsRequest + 1, // 20: teleport.terminal.v1.TerminalService.GetCluster:input_type -> teleport.terminal.v1.GetClusterRequest + 3, // 21: teleport.terminal.v1.TerminalService.Login:input_type -> teleport.terminal.v1.LoginRequest + 2, // 22: teleport.terminal.v1.TerminalService.Logout:input_type -> teleport.terminal.v1.LogoutRequest + 8, // 23: teleport.terminal.v1.TerminalService.ListRootClusters:output_type -> teleport.terminal.v1.ListClustersResponse + 8, // 24: teleport.terminal.v1.TerminalService.ListLeafClusters:output_type -> teleport.terminal.v1.ListClustersResponse + 11, // 25: teleport.terminal.v1.TerminalService.ListDatabases:output_type -> teleport.terminal.v1.ListDatabasesResponse + 14, // 26: teleport.terminal.v1.TerminalService.ListGateways:output_type -> teleport.terminal.v1.ListGatewaysResponse + 17, // 27: teleport.terminal.v1.TerminalService.ListServers:output_type -> teleport.terminal.v1.ListServersResponse + 18, // 28: teleport.terminal.v1.TerminalService.ListKubes:output_type -> teleport.terminal.v1.ListKubesResponse + 19, // 29: teleport.terminal.v1.TerminalService.ListApps:output_type -> teleport.terminal.v1.ListAppsResponse + 26, // 30: teleport.terminal.v1.TerminalService.CreateGateway:output_type -> teleport.terminal.v1.Gateway + 24, // 31: teleport.terminal.v1.TerminalService.AddCluster:output_type -> teleport.terminal.v1.Cluster + 21, // 32: teleport.terminal.v1.TerminalService.RemoveCluster:output_type -> teleport.terminal.v1.EmptyResponse + 21, // 33: teleport.terminal.v1.TerminalService.RemoveGateway:output_type -> teleport.terminal.v1.EmptyResponse + 30, // 34: teleport.terminal.v1.TerminalService.GetAuthSettings:output_type -> teleport.terminal.v1.AuthSettings + 24, // 35: teleport.terminal.v1.TerminalService.GetCluster:output_type -> teleport.terminal.v1.Cluster + 21, // 36: teleport.terminal.v1.TerminalService.Login:output_type -> teleport.terminal.v1.EmptyResponse + 21, // 37: teleport.terminal.v1.TerminalService.Logout:output_type -> teleport.terminal.v1.EmptyResponse + 23, // [23:38] is the sub-list for method output_type + 8, // [8:23] 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 +} + +func init() { file_v1_service_proto_init() } +func file_v1_service_proto_init() { + if File_v1_service_proto != nil { + return + } + file_v1_cluster_proto_init() + file_v1_database_proto_init() + file_v1_gateway_proto_init() + file_v1_kube_proto_init() + file_v1_app_proto_init() + file_v1_server_proto_init() + file_v1_auth_settings_proto_init() + if !protoimpl.UnsafeEnabled { + file_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogoutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKubesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListClustersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListClustersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDatabasesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListLeafClustersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDatabasesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateGatewayRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListGatewaysRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListGatewaysResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveGatewayRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListServersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListServersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKubesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAppsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAuthSettingsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_service_proto_msgTypes[22].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[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest_SsoParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_v1_service_proto_goTypes, + DependencyIndexes: file_v1_service_proto_depIdxs, + MessageInfos: file_v1_service_proto_msgTypes, + }.Build() + File_v1_service_proto = out.File + file_v1_service_proto_rawDesc = nil + file_v1_service_proto_goTypes = nil + file_v1_service_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// TerminalServiceClient is the client API for TerminalService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TerminalServiceClient interface { + // ListRootClusters lists root clusters + ListRootClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // ListLeafClusters lists leaf clusters + ListLeafClusters(ctx context.Context, in *ListLeafClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) + // ListDatabases lists databases + ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, 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) + // RemoveGateway removes a gateway + RemoveGateway(ctx context.Context, in *RemoveGatewayRequest, opts ...grpc.CallOption) (*EmptyResponse, error) + // GetAuthSettings returns cluster auth settigns + GetAuthSettings(ctx context.Context, in *GetAuthSettingsRequest, opts ...grpc.CallOption) (*AuthSettings, error) + // GetCluster returns a cluster + GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) + // Login logs in a user to a cluster + Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*EmptyResponse, error) + // ClusterLogin logs out a user from cluster + Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*EmptyResponse, error) +} + +type terminalServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTerminalServiceClient(cc grpc.ClientConnInterface) TerminalServiceClient { + return &terminalServiceClient{cc} +} + +func (c *terminalServiceClient) ListRootClusters(ctx context.Context, in *ListClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListRootClusters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) ListLeafClusters(ctx context.Context, in *ListLeafClustersRequest, opts ...grpc.CallOption) (*ListClustersResponse, error) { + out := new(ListClustersResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListLeafClusters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) { + out := new(ListDatabasesResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListDatabases", in, out, opts...) + if err != nil { + return nil, err + } + 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...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) ListKubes(ctx context.Context, in *ListKubesRequest, opts ...grpc.CallOption) (*ListKubesResponse, error) { + out := new(ListKubesResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListKubes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) ListApps(ctx context.Context, in *ListAppsRequest, opts ...grpc.CallOption) (*ListAppsResponse, error) { + out := new(ListAppsResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/ListApps", 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) 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...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) RemoveCluster(ctx context.Context, in *RemoveClusterRequest, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/RemoveCluster", 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...) + 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...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) GetCluster(ctx context.Context, in *GetClusterRequest, opts ...grpc.CallOption) (*Cluster, error) { + out := new(Cluster) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/GetCluster", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/Login", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *terminalServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/teleport.terminal.v1.TerminalService/Logout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TerminalServiceServer is the server API for TerminalService service. +type TerminalServiceServer interface { + // ListRootClusters lists root clusters + ListRootClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) + // ListLeafClusters lists leaf clusters + ListLeafClusters(context.Context, *ListLeafClustersRequest) (*ListClustersResponse, error) + // ListDatabases lists databases + ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, 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) + // RemoveGateway removes a gateway + RemoveGateway(context.Context, *RemoveGatewayRequest) (*EmptyResponse, error) + // GetAuthSettings returns cluster auth settigns + GetAuthSettings(context.Context, *GetAuthSettingsRequest) (*AuthSettings, error) + // GetCluster returns a cluster + GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) + // Login logs in a user to a cluster + Login(context.Context, *LoginRequest) (*EmptyResponse, error) + // ClusterLogin logs out a user from cluster + Logout(context.Context, *LogoutRequest) (*EmptyResponse, error) +} + +// UnimplementedTerminalServiceServer can be embedded to have forward compatible implementations. +type UnimplementedTerminalServiceServer struct { +} + +func (*UnimplementedTerminalServiceServer) ListRootClusters(context.Context, *ListClustersRequest) (*ListClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRootClusters not implemented") +} +func (*UnimplementedTerminalServiceServer) ListLeafClusters(context.Context, *ListLeafClustersRequest) (*ListClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListLeafClusters not implemented") +} +func (*UnimplementedTerminalServiceServer) ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListDatabases 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") +} +func (*UnimplementedTerminalServiceServer) ListKubes(context.Context, *ListKubesRequest) (*ListKubesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKubes not implemented") +} +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) RemoveGateway(context.Context, *RemoveGatewayRequest) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveGateway not implemented") +} +func (*UnimplementedTerminalServiceServer) GetAuthSettings(context.Context, *GetAuthSettingsRequest) (*AuthSettings, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAuthSettings not implemented") +} +func (*UnimplementedTerminalServiceServer) GetCluster(context.Context, *GetClusterRequest) (*Cluster, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCluster not implemented") +} +func (*UnimplementedTerminalServiceServer) Login(context.Context, *LoginRequest) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (*UnimplementedTerminalServiceServer) Logout(context.Context, *LogoutRequest) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") +} + +func RegisterTerminalServiceServer(s *grpc.Server, srv TerminalServiceServer) { + s.RegisterService(&_TerminalService_serviceDesc, srv) +} + +func _TerminalService_ListRootClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListClustersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).ListRootClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/ListRootClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).ListRootClusters(ctx, req.(*ListClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_ListLeafClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLeafClustersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).ListLeafClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/ListLeafClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).ListLeafClusters(ctx, req.(*ListLeafClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_ListDatabases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDatabasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).ListDatabases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/ListDatabases", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).ListDatabases(ctx, req.(*ListDatabasesRequest)) + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).ListServers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/ListServers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).ListServers(ctx, req.(*ListServersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_ListKubes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKubesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).ListKubes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/ListKubes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).ListKubes(ctx, req.(*ListKubesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_ListApps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAppsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).ListApps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/ListApps", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).ListApps(ctx, req.(*ListAppsRequest)) + } + 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) +} + +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).AddCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/AddCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).AddCluster(ctx, req.(*AddClusterRequest)) + } + 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) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).RemoveCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/RemoveCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).RemoveCluster(ctx, req.(*RemoveClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_RemoveGateway_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveGatewayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).RemoveGateway(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/RemoveGateway", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).RemoveGateway(ctx, req.(*RemoveGatewayRequest)) + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).GetAuthSettings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/GetAuthSettings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).GetAuthSettings(ctx, req.(*GetAuthSettingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_GetCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).GetCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/GetCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).GetCluster(ctx, req.(*GetClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/Login", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).Login(ctx, req.(*LoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TerminalService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TerminalServiceServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/teleport.terminal.v1.TerminalService/Logout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TerminalServiceServer).Logout(ctx, req.(*LogoutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _TerminalService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "teleport.terminal.v1.TerminalService", + HandlerType: (*TerminalServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListRootClusters", + Handler: _TerminalService_ListRootClusters_Handler, + }, + { + MethodName: "ListLeafClusters", + Handler: _TerminalService_ListLeafClusters_Handler, + }, + { + MethodName: "ListDatabases", + Handler: _TerminalService_ListDatabases_Handler, + }, + { + MethodName: "ListGateways", + Handler: _TerminalService_ListGateways_Handler, + }, + { + MethodName: "ListServers", + Handler: _TerminalService_ListServers_Handler, + }, + { + MethodName: "ListKubes", + Handler: _TerminalService_ListKubes_Handler, + }, + { + MethodName: "ListApps", + Handler: _TerminalService_ListApps_Handler, + }, + { + MethodName: "CreateGateway", + Handler: _TerminalService_CreateGateway_Handler, + }, + { + MethodName: "AddCluster", + Handler: _TerminalService_AddCluster_Handler, + }, + { + MethodName: "RemoveCluster", + Handler: _TerminalService_RemoveCluster_Handler, + }, + { + MethodName: "RemoveGateway", + Handler: _TerminalService_RemoveGateway_Handler, + }, + { + MethodName: "GetAuthSettings", + Handler: _TerminalService_GetAuthSettings_Handler, + }, + { + MethodName: "GetCluster", + Handler: _TerminalService_GetCluster_Handler, + }, + { + MethodName: "Login", + Handler: _TerminalService_Login_Handler, + }, + { + MethodName: "Logout", + Handler: _TerminalService_Logout_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "v1/service.proto", +} diff --git a/lib/teleterm/api/protogen/js/v1/app_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/app_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/app_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/app_pb.d.ts b/lib/teleterm/api/protogen/js/v1/app_pb.d.ts new file mode 100644 index 0000000000000..258a5bcc6e293 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/app_pb.d.ts @@ -0,0 +1,92 @@ +// package: teleport.terminal.v1 +// file: v1/app.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as v1_label_pb from "../v1/label_pb"; + +export class App extends jspb.Message { + getUri(): string; + setUri(value: string): App; + + getName(): string; + setName(value: string): App; + + getDescription(): string; + setDescription(value: string): App; + + getAppUri(): string; + setAppUri(value: string): App; + + getPublicAddr(): string; + setPublicAddr(value: string): App; + + getFqdn(): string; + setFqdn(value: string): App; + + clearLabelsList(): void; + getLabelsList(): Array; + setLabelsList(value: Array): App; + addLabels(value?: v1_label_pb.Label, index?: number): v1_label_pb.Label; + + getAwsConsole(): boolean; + setAwsConsole(value: boolean): App; + + clearAwsRolesList(): void; + getAwsRolesList(): Array; + setAwsRolesList(value: Array): App; + addAwsRoles(value?: App.AWSRole, index?: number): App.AWSRole; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): App.AsObject; + static toObject(includeInstance: boolean, msg: App): App.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: App, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): App; + static deserializeBinaryFromReader(message: App, reader: jspb.BinaryReader): App; +} + +export namespace App { + export type AsObject = { + uri: string, + name: string, + description: string, + appUri: string, + publicAddr: string, + fqdn: string, + labelsList: Array, + awsConsole: boolean, + awsRolesList: Array, + } + + + export class AWSRole extends jspb.Message { + getDisplay(): string; + setDisplay(value: string): AWSRole; + + getArn(): string; + setArn(value: string): AWSRole; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AWSRole.AsObject; + static toObject(includeInstance: boolean, msg: AWSRole): AWSRole.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AWSRole, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AWSRole; + static deserializeBinaryFromReader(message: AWSRole, reader: jspb.BinaryReader): AWSRole; + } + + export namespace AWSRole { + export type AsObject = { + display: string, + arn: string, + } + } + +} diff --git a/lib/teleterm/api/protogen/js/v1/app_pb.js b/lib/teleterm/api/protogen/js/v1/app_pb.js new file mode 100644 index 0000000000000..8a34bcd4000d0 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/app_pb.js @@ -0,0 +1,644 @@ +// source: v1/app.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var v1_label_pb = require('../v1/label_pb.js'); +goog.object.extend(proto, v1_label_pb); +goog.exportSymbol('proto.teleport.terminal.v1.App', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.App.AWSRole', null, global); +/** + * 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.App = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.App.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.App, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.App.displayName = 'proto.teleport.terminal.v1.App'; +} +/** + * 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.App.AWSRole = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.App.AWSRole, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.App.AWSRole.displayName = 'proto.teleport.terminal.v1.App.AWSRole'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.App.repeatedFields_ = [7,9]; + + + +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.App.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.App.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.App} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.App.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + description: jspb.Message.getFieldWithDefault(msg, 3, ""), + appUri: jspb.Message.getFieldWithDefault(msg, 4, ""), + publicAddr: jspb.Message.getFieldWithDefault(msg, 5, ""), + fqdn: jspb.Message.getFieldWithDefault(msg, 6, ""), + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + v1_label_pb.Label.toObject, includeInstance), + awsConsole: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + awsRolesList: jspb.Message.toObjectList(msg.getAwsRolesList(), + proto.teleport.terminal.v1.App.AWSRole.toObject, includeInstance) + }; + + 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.App} + */ +proto.teleport.terminal.v1.App.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.App; + return proto.teleport.terminal.v1.App.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.App} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.App} + */ +proto.teleport.terminal.v1.App.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.setUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setAppUri(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setPublicAddr(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setFqdn(value); + break; + case 7: + var value = new v1_label_pb.Label; + reader.readMessage(value,v1_label_pb.Label.deserializeBinaryFromReader); + msg.addLabels(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAwsConsole(value); + break; + case 9: + var value = new proto.teleport.terminal.v1.App.AWSRole; + reader.readMessage(value,proto.teleport.terminal.v1.App.AWSRole.deserializeBinaryFromReader); + msg.addAwsRoles(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.App.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.App.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.App} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.App.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getAppUri(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getPublicAddr(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getFqdn(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + v1_label_pb.Label.serializeBinaryToWriter + ); + } + f = message.getAwsConsole(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getAwsRolesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 9, + f, + proto.teleport.terminal.v1.App.AWSRole.serializeBinaryToWriter + ); + } +}; + + + + + +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.App.AWSRole.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.App.AWSRole.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.App.AWSRole} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.App.AWSRole.toObject = function(includeInstance, msg) { + var f, obj = { + display: jspb.Message.getFieldWithDefault(msg, 1, ""), + arn: 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.App.AWSRole} + */ +proto.teleport.terminal.v1.App.AWSRole.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.App.AWSRole; + return proto.teleport.terminal.v1.App.AWSRole.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.App.AWSRole} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.App.AWSRole} + */ +proto.teleport.terminal.v1.App.AWSRole.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.setDisplay(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setArn(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.App.AWSRole.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.App.AWSRole.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.App.AWSRole} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.App.AWSRole.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDisplay(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getArn(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string display = 1; + * @return {string} + */ +proto.teleport.terminal.v1.App.AWSRole.prototype.getDisplay = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App.AWSRole} returns this + */ +proto.teleport.terminal.v1.App.AWSRole.prototype.setDisplay = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string arn = 2; + * @return {string} + */ +proto.teleport.terminal.v1.App.AWSRole.prototype.getArn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App.AWSRole} returns this + */ +proto.teleport.terminal.v1.App.AWSRole.prototype.setArn = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.App.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.App.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string description = 3; + * @return {string} + */ +proto.teleport.terminal.v1.App.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setDescription = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string app_uri = 4; + * @return {string} + */ +proto.teleport.terminal.v1.App.prototype.getAppUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setAppUri = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string public_addr = 5; + * @return {string} + */ +proto.teleport.terminal.v1.App.prototype.getPublicAddr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setPublicAddr = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string fqdn = 6; + * @return {string} + */ +proto.teleport.terminal.v1.App.prototype.getFqdn = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setFqdn = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * repeated Label labels = 7; + * @return {!Array} + */ +proto.teleport.terminal.v1.App.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_label_pb.Label, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.App} returns this +*/ +proto.teleport.terminal.v1.App.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Label=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Label} + */ +proto.teleport.terminal.v1.App.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.teleport.terminal.v1.Label, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + +/** + * optional bool aws_console = 8; + * @return {boolean} + */ +proto.teleport.terminal.v1.App.prototype.getAwsConsole = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.setAwsConsole = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); +}; + + +/** + * repeated AWSRole aws_roles = 9; + * @return {!Array} + */ +proto.teleport.terminal.v1.App.prototype.getAwsRolesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.teleport.terminal.v1.App.AWSRole, 9)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.App} returns this +*/ +proto.teleport.terminal.v1.App.prototype.setAwsRolesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 9, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.App.AWSRole=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.App.AWSRole} + */ +proto.teleport.terminal.v1.App.prototype.addAwsRoles = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.teleport.terminal.v1.App.AWSRole, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.App} returns this + */ +proto.teleport.terminal.v1.App.prototype.clearAwsRolesList = function() { + return this.setAwsRolesList([]); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/auth_settings_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/auth_settings_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/auth_settings_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/auth_settings_pb.d.ts b/lib/teleterm/api/protogen/js/v1/auth_settings_pb.d.ts new file mode 100644 index 0000000000000..c31496ca3aae3 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/auth_settings_pb.d.ts @@ -0,0 +1,75 @@ +// package: teleport.terminal.v1 +// file: v1/auth_settings.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class AuthSettings extends jspb.Message { + getLocalAuthEnabled(): boolean; + setLocalAuthEnabled(value: boolean): AuthSettings; + + getSecondFactor(): string; + setSecondFactor(value: string): AuthSettings; + + getPreferredMfa(): string; + setPreferredMfa(value: string): AuthSettings; + + clearAuthProvidersList(): void; + getAuthProvidersList(): Array; + setAuthProvidersList(value: Array): AuthSettings; + addAuthProviders(value?: AuthProvider, index?: number): AuthProvider; + + getHasMessageOfTheDay(): boolean; + setHasMessageOfTheDay(value: boolean): AuthSettings; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AuthSettings.AsObject; + static toObject(includeInstance: boolean, msg: AuthSettings): AuthSettings.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AuthSettings, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AuthSettings; + static deserializeBinaryFromReader(message: AuthSettings, reader: jspb.BinaryReader): AuthSettings; +} + +export namespace AuthSettings { + export type AsObject = { + localAuthEnabled: boolean, + secondFactor: string, + preferredMfa: string, + authProvidersList: Array, + hasMessageOfTheDay: boolean, + } +} + +export class AuthProvider extends jspb.Message { + getType(): string; + setType(value: string): AuthProvider; + + getName(): string; + setName(value: string): AuthProvider; + + getDisplayName(): string; + setDisplayName(value: string): AuthProvider; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AuthProvider.AsObject; + static toObject(includeInstance: boolean, msg: AuthProvider): AuthProvider.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AuthProvider, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AuthProvider; + static deserializeBinaryFromReader(message: AuthProvider, reader: jspb.BinaryReader): AuthProvider; +} + +export namespace AuthProvider { + export type AsObject = { + type: string, + name: string, + displayName: string, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/auth_settings_pb.js b/lib/teleterm/api/protogen/js/v1/auth_settings_pb.js new file mode 100644 index 0000000000000..159bf20a95dfa --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/auth_settings_pb.js @@ -0,0 +1,529 @@ +// source: v1/auth_settings.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.teleport.terminal.v1.AuthProvider', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.AuthSettings', null, global); +/** + * 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.AuthSettings = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.AuthSettings.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.AuthSettings, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.AuthSettings.displayName = 'proto.teleport.terminal.v1.AuthSettings'; +} +/** + * 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.AuthProvider = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.AuthProvider, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.AuthProvider.displayName = 'proto.teleport.terminal.v1.AuthProvider'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.AuthSettings.repeatedFields_ = [4]; + + + +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.AuthSettings.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.AuthSettings.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.AuthSettings} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.AuthSettings.toObject = function(includeInstance, msg) { + var f, obj = { + localAuthEnabled: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + secondFactor: jspb.Message.getFieldWithDefault(msg, 2, ""), + preferredMfa: jspb.Message.getFieldWithDefault(msg, 3, ""), + authProvidersList: jspb.Message.toObjectList(msg.getAuthProvidersList(), + proto.teleport.terminal.v1.AuthProvider.toObject, includeInstance), + hasMessageOfTheDay: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + 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.AuthSettings} + */ +proto.teleport.terminal.v1.AuthSettings.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.AuthSettings; + return proto.teleport.terminal.v1.AuthSettings.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.AuthSettings} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.AuthSettings} + */ +proto.teleport.terminal.v1.AuthSettings.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setLocalAuthEnabled(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSecondFactor(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setPreferredMfa(value); + break; + case 4: + var value = new proto.teleport.terminal.v1.AuthProvider; + reader.readMessage(value,proto.teleport.terminal.v1.AuthProvider.deserializeBinaryFromReader); + msg.addAuthProviders(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasMessageOfTheDay(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.AuthSettings.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.AuthSettings} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.AuthSettings.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLocalAuthEnabled(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getSecondFactor(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getPreferredMfa(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getAuthProvidersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.teleport.terminal.v1.AuthProvider.serializeBinaryToWriter + ); + } + f = message.getHasMessageOfTheDay(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional bool local_auth_enabled = 1; + * @return {boolean} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.getLocalAuthEnabled = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.AuthSettings} returns this + */ +proto.teleport.terminal.v1.AuthSettings.prototype.setLocalAuthEnabled = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * optional string second_factor = 2; + * @return {string} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.getSecondFactor = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.AuthSettings} returns this + */ +proto.teleport.terminal.v1.AuthSettings.prototype.setSecondFactor = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string preferred_mfa = 3; + * @return {string} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.getPreferredMfa = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.AuthSettings} returns this + */ +proto.teleport.terminal.v1.AuthSettings.prototype.setPreferredMfa = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * repeated AuthProvider auth_providers = 4; + * @return {!Array} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.getAuthProvidersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.teleport.terminal.v1.AuthProvider, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.AuthSettings} returns this +*/ +proto.teleport.terminal.v1.AuthSettings.prototype.setAuthProvidersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.AuthProvider=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.AuthProvider} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.addAuthProviders = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.teleport.terminal.v1.AuthProvider, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.AuthSettings} returns this + */ +proto.teleport.terminal.v1.AuthSettings.prototype.clearAuthProvidersList = function() { + return this.setAuthProvidersList([]); +}; + + +/** + * optional bool has_message_of_the_day = 5; + * @return {boolean} + */ +proto.teleport.terminal.v1.AuthSettings.prototype.getHasMessageOfTheDay = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.AuthSettings} returns this + */ +proto.teleport.terminal.v1.AuthSettings.prototype.setHasMessageOfTheDay = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + + + +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.AuthProvider.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.AuthProvider.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.AuthProvider} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.AuthProvider.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + displayName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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.AuthProvider} + */ +proto.teleport.terminal.v1.AuthProvider.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.AuthProvider; + return proto.teleport.terminal.v1.AuthProvider.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.AuthProvider} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.AuthProvider} + */ +proto.teleport.terminal.v1.AuthProvider.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.setType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDisplayName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.AuthProvider.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.AuthProvider.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.AuthProvider} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.AuthProvider.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDisplayName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string type = 1; + * @return {string} + */ +proto.teleport.terminal.v1.AuthProvider.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.AuthProvider} returns this + */ +proto.teleport.terminal.v1.AuthProvider.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.AuthProvider.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.AuthProvider} returns this + */ +proto.teleport.terminal.v1.AuthProvider.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string display_name = 3; + * @return {string} + */ +proto.teleport.terminal.v1.AuthProvider.prototype.getDisplayName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.AuthProvider} returns this + */ +proto.teleport.terminal.v1.AuthProvider.prototype.setDisplayName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/cluster_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/cluster_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/cluster_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/cluster_pb.d.ts b/lib/teleterm/api/protogen/js/v1/cluster_pb.d.ts new file mode 100644 index 0000000000000..099dba4fb006a --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/cluster_pb.d.ts @@ -0,0 +1,225 @@ +// package: teleport.terminal.v1 +// file: v1/cluster.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Cluster extends jspb.Message { + getUri(): string; + setUri(value: string): Cluster; + + getName(): string; + setName(value: string): Cluster; + + getConnected(): boolean; + setConnected(value: boolean): Cluster; + + getLeaf(): boolean; + setLeaf(value: boolean): Cluster; + + + hasLoggedInUser(): boolean; + clearLoggedInUser(): void; + getLoggedInUser(): LoggedInUser | undefined; + setLoggedInUser(value?: LoggedInUser): Cluster; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Cluster.AsObject; + static toObject(includeInstance: boolean, msg: Cluster): Cluster.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Cluster, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Cluster; + static deserializeBinaryFromReader(message: Cluster, reader: jspb.BinaryReader): Cluster; +} + +export namespace Cluster { + export type AsObject = { + uri: string, + name: string, + connected: boolean, + leaf: boolean, + loggedInUser?: LoggedInUser.AsObject, + } +} + +export class LoggedInUser extends jspb.Message { + getName(): string; + setName(value: string): LoggedInUser; + + clearRolesList(): void; + getRolesList(): Array; + setRolesList(value: Array): LoggedInUser; + addRoles(value: string, index?: number): string; + + clearSshLoginsList(): void; + getSshLoginsList(): Array; + setSshLoginsList(value: Array): LoggedInUser; + addSshLogins(value: string, index?: number): string; + + + hasAcl(): boolean; + clearAcl(): void; + getAcl(): ACL | undefined; + setAcl(value?: ACL): LoggedInUser; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LoggedInUser.AsObject; + static toObject(includeInstance: boolean, msg: LoggedInUser): LoggedInUser.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LoggedInUser, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LoggedInUser; + static deserializeBinaryFromReader(message: LoggedInUser, reader: jspb.BinaryReader): LoggedInUser; +} + +export namespace LoggedInUser { + export type AsObject = { + name: string, + rolesList: Array, + sshLoginsList: Array, + acl?: ACL.AsObject, + } +} + +export class ACL extends jspb.Message { + + hasSessions(): boolean; + clearSessions(): void; + getSessions(): ResourceAccess | undefined; + setSessions(value?: ResourceAccess): ACL; + + + hasAuthConnectors(): boolean; + clearAuthConnectors(): void; + getAuthConnectors(): ResourceAccess | undefined; + setAuthConnectors(value?: ResourceAccess): ACL; + + + hasRoles(): boolean; + clearRoles(): void; + getRoles(): ResourceAccess | undefined; + setRoles(value?: ResourceAccess): ACL; + + + hasUsers(): boolean; + clearUsers(): void; + getUsers(): ResourceAccess | undefined; + setUsers(value?: ResourceAccess): ACL; + + + hasTrustedClusters(): boolean; + clearTrustedClusters(): void; + getTrustedClusters(): ResourceAccess | undefined; + setTrustedClusters(value?: ResourceAccess): ACL; + + + hasEvents(): boolean; + clearEvents(): void; + getEvents(): ResourceAccess | undefined; + setEvents(value?: ResourceAccess): ACL; + + + hasTokens(): boolean; + clearTokens(): void; + getTokens(): ResourceAccess | undefined; + setTokens(value?: ResourceAccess): ACL; + + + hasServers(): boolean; + clearServers(): void; + getServers(): ResourceAccess | undefined; + setServers(value?: ResourceAccess): ACL; + + + hasApps(): boolean; + clearApps(): void; + getApps(): ResourceAccess | undefined; + setApps(value?: ResourceAccess): ACL; + + + hasDbs(): boolean; + clearDbs(): void; + getDbs(): ResourceAccess | undefined; + setDbs(value?: ResourceAccess): ACL; + + + hasKubeservers(): boolean; + clearKubeservers(): void; + getKubeservers(): ResourceAccess | undefined; + setKubeservers(value?: ResourceAccess): ACL; + + + hasAccessRequests(): boolean; + clearAccessRequests(): void; + getAccessRequests(): ResourceAccess | undefined; + setAccessRequests(value?: ResourceAccess): ACL; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ACL.AsObject; + static toObject(includeInstance: boolean, msg: ACL): ACL.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ACL, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ACL; + static deserializeBinaryFromReader(message: ACL, reader: jspb.BinaryReader): ACL; +} + +export namespace ACL { + export type AsObject = { + sessions?: ResourceAccess.AsObject, + authConnectors?: ResourceAccess.AsObject, + roles?: ResourceAccess.AsObject, + users?: ResourceAccess.AsObject, + trustedClusters?: ResourceAccess.AsObject, + events?: ResourceAccess.AsObject, + tokens?: ResourceAccess.AsObject, + servers?: ResourceAccess.AsObject, + apps?: ResourceAccess.AsObject, + dbs?: ResourceAccess.AsObject, + kubeservers?: ResourceAccess.AsObject, + accessRequests?: ResourceAccess.AsObject, + } +} + +export class ResourceAccess extends jspb.Message { + getList(): boolean; + setList(value: boolean): ResourceAccess; + + getRead(): boolean; + setRead(value: boolean): ResourceAccess; + + getEdit(): boolean; + setEdit(value: boolean): ResourceAccess; + + getCreate(): boolean; + setCreate(value: boolean): ResourceAccess; + + getDelete(): boolean; + setDelete(value: boolean): ResourceAccess; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ResourceAccess.AsObject; + static toObject(includeInstance: boolean, msg: ResourceAccess): ResourceAccess.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ResourceAccess, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ResourceAccess; + static deserializeBinaryFromReader(message: ResourceAccess, reader: jspb.BinaryReader): ResourceAccess; +} + +export namespace ResourceAccess { + export type AsObject = { + list: boolean, + read: boolean, + edit: boolean, + create: boolean, + pb_delete: boolean, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/cluster_pb.js b/lib/teleterm/api/protogen/js/v1/cluster_pb.js new file mode 100644 index 0000000000000..3e023f7f07710 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/cluster_pb.js @@ -0,0 +1,1622 @@ +// source: v1/cluster.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.teleport.terminal.v1.ACL', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.Cluster', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.LoggedInUser', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ResourceAccess', null, global); +/** + * 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.Cluster = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.Cluster, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.Cluster.displayName = 'proto.teleport.terminal.v1.Cluster'; +} +/** + * 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.LoggedInUser = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.LoggedInUser.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.LoggedInUser, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.LoggedInUser.displayName = 'proto.teleport.terminal.v1.LoggedInUser'; +} +/** + * 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.ACL = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ACL, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ACL.displayName = 'proto.teleport.terminal.v1.ACL'; +} +/** + * 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.ResourceAccess = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ResourceAccess, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ResourceAccess.displayName = 'proto.teleport.terminal.v1.ResourceAccess'; +} + + + +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.Cluster.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.Cluster.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.Cluster} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Cluster.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + connected: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + leaf: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + loggedInUser: (f = msg.getLoggedInUser()) && proto.teleport.terminal.v1.LoggedInUser.toObject(includeInstance, f) + }; + + 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.Cluster} + */ +proto.teleport.terminal.v1.Cluster.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.Cluster; + return proto.teleport.terminal.v1.Cluster.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.Cluster} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.Cluster} + */ +proto.teleport.terminal.v1.Cluster.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.setUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setConnected(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setLeaf(value); + break; + case 5: + var value = new proto.teleport.terminal.v1.LoggedInUser; + reader.readMessage(value,proto.teleport.terminal.v1.LoggedInUser.deserializeBinaryFromReader); + msg.setLoggedInUser(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.Cluster.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.Cluster.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.Cluster} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Cluster.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getConnected(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getLeaf(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getLoggedInUser(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.teleport.terminal.v1.LoggedInUser.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.Cluster.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Cluster} returns this + */ +proto.teleport.terminal.v1.Cluster.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.Cluster.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Cluster} returns this + */ +proto.teleport.terminal.v1.Cluster.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bool connected = 3; + * @return {boolean} + */ +proto.teleport.terminal.v1.Cluster.prototype.getConnected = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.Cluster} returns this + */ +proto.teleport.terminal.v1.Cluster.prototype.setConnected = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional bool leaf = 4; + * @return {boolean} + */ +proto.teleport.terminal.v1.Cluster.prototype.getLeaf = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.Cluster} returns this + */ +proto.teleport.terminal.v1.Cluster.prototype.setLeaf = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional LoggedInUser logged_in_user = 5; + * @return {?proto.teleport.terminal.v1.LoggedInUser} + */ +proto.teleport.terminal.v1.Cluster.prototype.getLoggedInUser = function() { + return /** @type{?proto.teleport.terminal.v1.LoggedInUser} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.LoggedInUser, 5)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.LoggedInUser|undefined} value + * @return {!proto.teleport.terminal.v1.Cluster} returns this +*/ +proto.teleport.terminal.v1.Cluster.prototype.setLoggedInUser = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.Cluster} returns this + */ +proto.teleport.terminal.v1.Cluster.prototype.clearLoggedInUser = function() { + return this.setLoggedInUser(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.Cluster.prototype.hasLoggedInUser = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.LoggedInUser.repeatedFields_ = [2,3]; + + + +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.LoggedInUser.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.LoggedInUser.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.LoggedInUser} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoggedInUser.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + rolesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + sshLoginsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + acl: (f = msg.getAcl()) && proto.teleport.terminal.v1.ACL.toObject(includeInstance, f) + }; + + 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.LoggedInUser} + */ +proto.teleport.terminal.v1.LoggedInUser.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.LoggedInUser; + return proto.teleport.terminal.v1.LoggedInUser.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.LoggedInUser} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.LoggedInUser} + */ +proto.teleport.terminal.v1.LoggedInUser.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.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addRoles(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addSshLogins(value); + break; + case 4: + var value = new proto.teleport.terminal.v1.ACL; + reader.readMessage(value,proto.teleport.terminal.v1.ACL.deserializeBinaryFromReader); + msg.setAcl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.LoggedInUser.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.LoggedInUser} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoggedInUser.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getRolesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getSshLoginsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getAcl(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.teleport.terminal.v1.ACL.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated string roles = 2; + * @return {!Array} + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.getRolesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.setRolesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.addRoles = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.clearRolesList = function() { + return this.setRolesList([]); +}; + + +/** + * repeated string ssh_logins = 3; + * @return {!Array} + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.getSshLoginsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.setSshLoginsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.addSshLogins = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.clearSshLoginsList = function() { + return this.setSshLoginsList([]); +}; + + +/** + * optional ACL acl = 4; + * @return {?proto.teleport.terminal.v1.ACL} + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.getAcl = function() { + return /** @type{?proto.teleport.terminal.v1.ACL} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ACL, 4)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ACL|undefined} value + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this +*/ +proto.teleport.terminal.v1.LoggedInUser.prototype.setAcl = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.LoggedInUser} returns this + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.clearAcl = function() { + return this.setAcl(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.LoggedInUser.prototype.hasAcl = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + + + +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.ACL.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ACL.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.ACL} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ACL.toObject = function(includeInstance, msg) { + var f, obj = { + sessions: (f = msg.getSessions()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + authConnectors: (f = msg.getAuthConnectors()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + roles: (f = msg.getRoles()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + users: (f = msg.getUsers()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + trustedClusters: (f = msg.getTrustedClusters()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + events: (f = msg.getEvents()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + tokens: (f = msg.getTokens()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + servers: (f = msg.getServers()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + apps: (f = msg.getApps()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + dbs: (f = msg.getDbs()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + kubeservers: (f = msg.getKubeservers()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f), + accessRequests: (f = msg.getAccessRequests()) && proto.teleport.terminal.v1.ResourceAccess.toObject(includeInstance, f) + }; + + 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.ACL} + */ +proto.teleport.terminal.v1.ACL.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ACL; + return proto.teleport.terminal.v1.ACL.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ACL} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ACL} + */ +proto.teleport.terminal.v1.ACL.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setSessions(value); + break; + case 2: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setAuthConnectors(value); + break; + case 3: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setRoles(value); + break; + case 4: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setUsers(value); + break; + case 5: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setTrustedClusters(value); + break; + case 6: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setEvents(value); + break; + case 7: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setTokens(value); + break; + case 8: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setServers(value); + break; + case 9: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setApps(value); + break; + case 10: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setDbs(value); + break; + case 11: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setKubeservers(value); + break; + case 12: + var value = new proto.teleport.terminal.v1.ResourceAccess; + reader.readMessage(value,proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader); + msg.setAccessRequests(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ACL.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ACL.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.ACL} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ACL.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSessions(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getAuthConnectors(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getRoles(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getUsers(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getTrustedClusters(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getEvents(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getTokens(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getServers(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getApps(); + if (f != null) { + writer.writeMessage( + 9, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getDbs(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getKubeservers(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } + f = message.getAccessRequests(); + if (f != null) { + writer.writeMessage( + 12, + f, + proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ResourceAccess sessions = 1; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getSessions = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 1)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setSessions = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearSessions = function() { + return this.setSessions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasSessions = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional ResourceAccess auth_connectors = 2; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getAuthConnectors = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 2)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setAuthConnectors = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearAuthConnectors = function() { + return this.setAuthConnectors(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasAuthConnectors = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResourceAccess roles = 3; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getRoles = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 3)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setRoles = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearRoles = function() { + return this.setRoles(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasRoles = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional ResourceAccess users = 4; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getUsers = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 4)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setUsers = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearUsers = function() { + return this.setUsers(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasUsers = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional ResourceAccess trusted_clusters = 5; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getTrustedClusters = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 5)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setTrustedClusters = function(value) { + return jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearTrustedClusters = function() { + return this.setTrustedClusters(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasTrustedClusters = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional ResourceAccess events = 6; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getEvents = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 6)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setEvents = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearEvents = function() { + return this.setEvents(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasEvents = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional ResourceAccess tokens = 7; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getTokens = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 7)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setTokens = function(value) { + return jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearTokens = function() { + return this.setTokens(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasTokens = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional ResourceAccess servers = 8; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getServers = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 8)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setServers = function(value) { + return jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearServers = function() { + return this.setServers(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasServers = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional ResourceAccess apps = 9; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getApps = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 9)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setApps = function(value) { + return jspb.Message.setWrapperField(this, 9, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearApps = function() { + return this.setApps(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasApps = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional ResourceAccess dbs = 10; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getDbs = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 10)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setDbs = function(value) { + return jspb.Message.setWrapperField(this, 10, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearDbs = function() { + return this.setDbs(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasDbs = function() { + return jspb.Message.getField(this, 10) != null; +}; + + +/** + * optional ResourceAccess kubeservers = 11; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getKubeservers = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 11)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setKubeservers = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearKubeservers = function() { + return this.setKubeservers(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasKubeservers = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional ResourceAccess access_requests = 12; + * @return {?proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ACL.prototype.getAccessRequests = function() { + return /** @type{?proto.teleport.terminal.v1.ResourceAccess} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.ResourceAccess, 12)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.ResourceAccess|undefined} value + * @return {!proto.teleport.terminal.v1.ACL} returns this +*/ +proto.teleport.terminal.v1.ACL.prototype.setAccessRequests = function(value) { + return jspb.Message.setWrapperField(this, 12, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.ACL} returns this + */ +proto.teleport.terminal.v1.ACL.prototype.clearAccessRequests = function() { + return this.setAccessRequests(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.ACL.prototype.hasAccessRequests = function() { + return jspb.Message.getField(this, 12) != null; +}; + + + + + +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.ResourceAccess.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ResourceAccess.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.ResourceAccess} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ResourceAccess.toObject = function(includeInstance, msg) { + var f, obj = { + list: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), + read: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + edit: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), + create: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), + pb_delete: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + 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.ResourceAccess} + */ +proto.teleport.terminal.v1.ResourceAccess.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ResourceAccess; + return proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ResourceAccess} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ResourceAccess} + */ +proto.teleport.terminal.v1.ResourceAccess.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setList(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setRead(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setEdit(value); + break; + case 4: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setCreate(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setDelete(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ResourceAccess.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.ResourceAccess} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ResourceAccess.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getList(); + if (f) { + writer.writeBool( + 1, + f + ); + } + f = message.getRead(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getEdit(); + if (f) { + writer.writeBool( + 3, + f + ); + } + f = message.getCreate(); + if (f) { + writer.writeBool( + 4, + f + ); + } + f = message.getDelete(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional bool list = 1; + * @return {boolean} + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.getList = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.ResourceAccess} returns this + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.setList = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +/** + * optional bool read = 2; + * @return {boolean} + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.getRead = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.ResourceAccess} returns this + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.setRead = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional bool edit = 3; + * @return {boolean} + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.getEdit = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.ResourceAccess} returns this + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.setEdit = function(value) { + return jspb.Message.setProto3BooleanField(this, 3, value); +}; + + +/** + * optional bool create = 4; + * @return {boolean} + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.getCreate = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.ResourceAccess} returns this + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.setCreate = function(value) { + return jspb.Message.setProto3BooleanField(this, 4, value); +}; + + +/** + * optional bool delete = 5; + * @return {boolean} + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.getDelete = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.ResourceAccess} returns this + */ +proto.teleport.terminal.v1.ResourceAccess.prototype.setDelete = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/database_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/database_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/database_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/database_pb.d.ts b/lib/teleterm/api/protogen/js/v1/database_pb.d.ts new file mode 100644 index 0000000000000..63b5f81dfa365 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/database_pb.d.ts @@ -0,0 +1,59 @@ +// package: teleport.terminal.v1 +// file: v1/database.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as v1_label_pb from "../v1/label_pb"; + +export class Database extends jspb.Message { + getUri(): string; + setUri(value: string): Database; + + getName(): string; + setName(value: string): Database; + + getDesc(): string; + setDesc(value: string): Database; + + getProtocol(): string; + setProtocol(value: string): Database; + + getType(): string; + setType(value: string): Database; + + getHostname(): string; + setHostname(value: string): Database; + + getAddr(): string; + setAddr(value: string): Database; + + clearLabelsList(): void; + getLabelsList(): Array; + setLabelsList(value: Array): Database; + addLabels(value?: v1_label_pb.Label, index?: number): v1_label_pb.Label; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Database.AsObject; + static toObject(includeInstance: boolean, msg: Database): Database.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Database, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Database; + static deserializeBinaryFromReader(message: Database, reader: jspb.BinaryReader): Database; +} + +export namespace Database { + export type AsObject = { + uri: string, + name: string, + desc: string, + protocol: string, + type: string, + hostname: string, + addr: string, + labelsList: Array, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/database_pb.js b/lib/teleterm/api/protogen/js/v1/database_pb.js new file mode 100644 index 0000000000000..72af235d9f713 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/database_pb.js @@ -0,0 +1,409 @@ +// source: v1/database.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var v1_label_pb = require('../v1/label_pb.js'); +goog.object.extend(proto, v1_label_pb); +goog.exportSymbol('proto.teleport.terminal.v1.Database', null, global); +/** + * 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.Database = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.Database.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.Database, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.Database.displayName = 'proto.teleport.terminal.v1.Database'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.Database.repeatedFields_ = [8]; + + + +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.Database.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.Database.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.Database} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Database.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + desc: jspb.Message.getFieldWithDefault(msg, 3, ""), + protocol: jspb.Message.getFieldWithDefault(msg, 4, ""), + type: jspb.Message.getFieldWithDefault(msg, 5, ""), + hostname: jspb.Message.getFieldWithDefault(msg, 6, ""), + addr: jspb.Message.getFieldWithDefault(msg, 7, ""), + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + v1_label_pb.Label.toObject, includeInstance) + }; + + 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.Database} + */ +proto.teleport.terminal.v1.Database.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.Database; + return proto.teleport.terminal.v1.Database.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.Database} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.Database} + */ +proto.teleport.terminal.v1.Database.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.setUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDesc(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setProtocol(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setHostname(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setAddr(value); + break; + case 8: + var value = new v1_label_pb.Label; + reader.readMessage(value,v1_label_pb.Label.deserializeBinaryFromReader); + msg.addLabels(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.Database.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.Database.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.Database} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Database.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDesc(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getProtocol(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getHostname(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getAddr(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 8, + f, + v1_label_pb.Label.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string desc = 3; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getDesc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setDesc = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string protocol = 4; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string type = 5; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setType = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string hostname = 6; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getHostname = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setHostname = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string addr = 7; + * @return {string} + */ +proto.teleport.terminal.v1.Database.prototype.getAddr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.setAddr = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * repeated Label labels = 8; + * @return {!Array} + */ +proto.teleport.terminal.v1.Database.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_label_pb.Label, 8)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.Database} returns this +*/ +proto.teleport.terminal.v1.Database.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 8, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Label=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Label} + */ +proto.teleport.terminal.v1.Database.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.teleport.terminal.v1.Label, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.Database} returns this + */ +proto.teleport.terminal.v1.Database.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/gateway_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/gateway_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/gateway_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/gateway_pb.d.ts b/lib/teleterm/api/protogen/js/v1/gateway_pb.d.ts new file mode 100644 index 0000000000000..bda2363d2182c --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/gateway_pb.d.ts @@ -0,0 +1,68 @@ +// package: teleport.terminal.v1 +// file: v1/gateway.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Gateway extends jspb.Message { + getUri(): string; + setUri(value: string): Gateway; + + getTargetName(): string; + setTargetName(value: string): Gateway; + + getTargetUri(): string; + setTargetUri(value: string): Gateway; + + getTargetUser(): string; + setTargetUser(value: string): Gateway; + + getLocalAddress(): string; + setLocalAddress(value: string): Gateway; + + getLocalPort(): string; + setLocalPort(value: string): Gateway; + + getProtocol(): string; + setProtocol(value: string): Gateway; + + getInsecure(): boolean; + setInsecure(value: boolean): Gateway; + + getCaCertPath(): string; + setCaCertPath(value: string): Gateway; + + getCertPath(): string; + setCertPath(value: string): Gateway; + + getKeyPath(): string; + setKeyPath(value: string): Gateway; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Gateway.AsObject; + static toObject(includeInstance: boolean, msg: Gateway): Gateway.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Gateway, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Gateway; + static deserializeBinaryFromReader(message: Gateway, reader: jspb.BinaryReader): Gateway; +} + +export namespace Gateway { + export type AsObject = { + uri: string, + targetName: string, + targetUri: string, + targetUser: string, + localAddress: string, + localPort: string, + protocol: string, + insecure: boolean, + caCertPath: string, + certPath: string, + keyPath: string, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/gateway_pb.js b/lib/teleterm/api/protogen/js/v1/gateway_pb.js new file mode 100644 index 0000000000000..049008c82c16b --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/gateway_pb.js @@ -0,0 +1,467 @@ +// source: v1/gateway.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.teleport.terminal.v1.Gateway', null, global); +/** + * 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.Gateway = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.Gateway, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.Gateway.displayName = 'proto.teleport.terminal.v1.Gateway'; +} + + + +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.Gateway.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.Gateway.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.Gateway} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Gateway.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + targetName: jspb.Message.getFieldWithDefault(msg, 2, ""), + targetUri: jspb.Message.getFieldWithDefault(msg, 3, ""), + targetUser: jspb.Message.getFieldWithDefault(msg, 4, ""), + localAddress: jspb.Message.getFieldWithDefault(msg, 5, ""), + localPort: jspb.Message.getFieldWithDefault(msg, 6, ""), + protocol: jspb.Message.getFieldWithDefault(msg, 7, ""), + insecure: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + caCertPath: jspb.Message.getFieldWithDefault(msg, 9, ""), + certPath: jspb.Message.getFieldWithDefault(msg, 10, ""), + keyPath: jspb.Message.getFieldWithDefault(msg, 11, "") + }; + + 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.Gateway} + */ +proto.teleport.terminal.v1.Gateway.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.Gateway; + return proto.teleport.terminal.v1.Gateway.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.Gateway} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.Gateway} + */ +proto.teleport.terminal.v1.Gateway.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.setUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTargetName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setTargetUri(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setTargetUser(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setLocalAddress(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setLocalPort(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setProtocol(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setInsecure(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setCaCertPath(value); + break; + case 10: + var value = /** @type {string} */ (reader.readString()); + msg.setCertPath(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setKeyPath(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.Gateway.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.Gateway.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.Gateway} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Gateway.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTargetName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getTargetUri(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getTargetUser(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getLocalAddress(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getLocalPort(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getProtocol(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } + f = message.getInsecure(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getCaCertPath(); + if (f.length > 0) { + writer.writeString( + 9, + f + ); + } + f = message.getCertPath(); + if (f.length > 0) { + writer.writeString( + 10, + f + ); + } + f = message.getKeyPath(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string target_name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getTargetName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setTargetName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string target_uri = 3; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getTargetUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setTargetUri = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string target_user = 4; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getTargetUser = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setTargetUser = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string local_address = 5; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getLocalAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setLocalAddress = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string local_port = 6; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getLocalPort = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setLocalPort = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string protocol = 7; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getProtocol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setProtocol = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + +/** + * optional bool insecure = 8; + * @return {boolean} + */ +proto.teleport.terminal.v1.Gateway.prototype.getInsecure = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setInsecure = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); +}; + + +/** + * optional string ca_cert_path = 9; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getCaCertPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setCaCertPath = function(value) { + return jspb.Message.setProto3StringField(this, 9, value); +}; + + +/** + * optional string cert_path = 10; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getCertPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setCertPath = function(value) { + return jspb.Message.setProto3StringField(this, 10, value); +}; + + +/** + * optional string key_path = 11; + * @return {string} + */ +proto.teleport.terminal.v1.Gateway.prototype.getKeyPath = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Gateway} returns this + */ +proto.teleport.terminal.v1.Gateway.prototype.setKeyPath = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/kube_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/kube_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/kube_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/kube_pb.d.ts b/lib/teleterm/api/protogen/js/v1/kube_pb.d.ts new file mode 100644 index 0000000000000..10ceee51b3bb9 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/kube_pb.d.ts @@ -0,0 +1,39 @@ +// package: teleport.terminal.v1 +// file: v1/kube.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as v1_label_pb from "../v1/label_pb"; + +export class Kube extends jspb.Message { + getUri(): string; + setUri(value: string): Kube; + + getName(): string; + setName(value: string): Kube; + + clearLabelsList(): void; + getLabelsList(): Array; + setLabelsList(value: Array): Kube; + addLabels(value?: v1_label_pb.Label, index?: number): v1_label_pb.Label; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Kube.AsObject; + static toObject(includeInstance: boolean, msg: Kube): Kube.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Kube, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Kube; + static deserializeBinaryFromReader(message: Kube, reader: jspb.BinaryReader): Kube; +} + +export namespace Kube { + export type AsObject = { + uri: string, + name: string, + labelsList: Array, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/kube_pb.js b/lib/teleterm/api/protogen/js/v1/kube_pb.js new file mode 100644 index 0000000000000..54e497530d9fc --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/kube_pb.js @@ -0,0 +1,259 @@ +// source: v1/kube.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var v1_label_pb = require('../v1/label_pb.js'); +goog.object.extend(proto, v1_label_pb); +goog.exportSymbol('proto.teleport.terminal.v1.Kube', null, global); +/** + * 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.Kube = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.Kube.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.Kube, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.Kube.displayName = 'proto.teleport.terminal.v1.Kube'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.Kube.repeatedFields_ = [3]; + + + +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.Kube.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.Kube.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.Kube} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Kube.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + v1_label_pb.Label.toObject, includeInstance) + }; + + 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.Kube} + */ +proto.teleport.terminal.v1.Kube.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.Kube; + return proto.teleport.terminal.v1.Kube.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.Kube} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.Kube} + */ +proto.teleport.terminal.v1.Kube.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.setUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 3: + var value = new v1_label_pb.Label; + reader.readMessage(value,v1_label_pb.Label.deserializeBinaryFromReader); + msg.addLabels(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.Kube.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.Kube.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.Kube} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Kube.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + v1_label_pb.Label.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.Kube.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Kube} returns this + */ +proto.teleport.terminal.v1.Kube.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.Kube.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Kube} returns this + */ +proto.teleport.terminal.v1.Kube.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated Label labels = 3; + * @return {!Array} + */ +proto.teleport.terminal.v1.Kube.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_label_pb.Label, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.Kube} returns this +*/ +proto.teleport.terminal.v1.Kube.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Label=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Label} + */ +proto.teleport.terminal.v1.Kube.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.teleport.terminal.v1.Label, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.Kube} returns this + */ +proto.teleport.terminal.v1.Kube.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/label_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/label_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/label_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/label_pb.d.ts b/lib/teleterm/api/protogen/js/v1/label_pb.d.ts new file mode 100644 index 0000000000000..9b976608f2542 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/label_pb.d.ts @@ -0,0 +1,32 @@ +// package: teleport.terminal.v1 +// file: v1/label.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; + +export class Label extends jspb.Message { + getName(): string; + setName(value: string): Label; + + getValue(): string; + setValue(value: string): Label; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Label.AsObject; + static toObject(includeInstance: boolean, msg: Label): Label.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Label, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Label; + static deserializeBinaryFromReader(message: Label, reader: jspb.BinaryReader): Label; +} + +export namespace Label { + export type AsObject = { + name: string, + value: string, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/label_pb.js b/lib/teleterm/api/protogen/js/v1/label_pb.js new file mode 100644 index 0000000000000..6ed7a59197132 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/label_pb.js @@ -0,0 +1,197 @@ +// source: v1/label.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.teleport.terminal.v1.Label', null, global); +/** + * 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.Label = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.Label, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.Label.displayName = 'proto.teleport.terminal.v1.Label'; +} + + + +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.Label.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.Label.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.Label} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Label.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: 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.Label} + */ +proto.teleport.terminal.v1.Label.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.Label; + return proto.teleport.terminal.v1.Label.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.Label} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.Label} + */ +proto.teleport.terminal.v1.Label.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.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.Label.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.Label.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.Label} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Label.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.teleport.terminal.v1.Label.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Label} returns this + */ +proto.teleport.terminal.v1.Label.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string value = 2; + * @return {string} + */ +proto.teleport.terminal.v1.Label.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Label} returns this + */ +proto.teleport.terminal.v1.Label.prototype.setValue = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/protogen/js/v1/server_grpc_pb.js b/lib/teleterm/api/protogen/js/v1/server_grpc_pb.js new file mode 100644 index 0000000000000..97b3a2461dbea --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/server_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/lib/teleterm/api/protogen/js/v1/server_pb.d.ts b/lib/teleterm/api/protogen/js/v1/server_pb.d.ts new file mode 100644 index 0000000000000..d01e741b93e51 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/server_pb.d.ts @@ -0,0 +1,51 @@ +// package: teleport.terminal.v1 +// file: v1/server.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as v1_label_pb from "../v1/label_pb"; + +export class Server extends jspb.Message { + getUri(): string; + setUri(value: string): Server; + + getTunnel(): boolean; + setTunnel(value: boolean): Server; + + getName(): string; + setName(value: string): Server; + + getHostname(): string; + setHostname(value: string): Server; + + getAddr(): string; + setAddr(value: string): Server; + + clearLabelsList(): void; + getLabelsList(): Array; + setLabelsList(value: Array): Server; + addLabels(value?: v1_label_pb.Label, index?: number): v1_label_pb.Label; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Server.AsObject; + static toObject(includeInstance: boolean, msg: Server): Server.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Server, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Server; + static deserializeBinaryFromReader(message: Server, reader: jspb.BinaryReader): Server; +} + +export namespace Server { + export type AsObject = { + uri: string, + tunnel: boolean, + name: string, + hostname: string, + addr: string, + labelsList: Array, + } +} diff --git a/lib/teleterm/api/protogen/js/v1/server_pb.js b/lib/teleterm/api/protogen/js/v1/server_pb.js new file mode 100644 index 0000000000000..823bf9ecadab3 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/server_pb.js @@ -0,0 +1,349 @@ +// source: v1/server.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var v1_label_pb = require('../v1/label_pb.js'); +goog.object.extend(proto, v1_label_pb); +goog.exportSymbol('proto.teleport.terminal.v1.Server', null, global); +/** + * 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.Server = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.Server.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.Server, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.Server.displayName = 'proto.teleport.terminal.v1.Server'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.Server.repeatedFields_ = [6]; + + + +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.Server.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.Server.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.Server} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Server.toObject = function(includeInstance, msg) { + var f, obj = { + uri: jspb.Message.getFieldWithDefault(msg, 1, ""), + tunnel: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), + name: jspb.Message.getFieldWithDefault(msg, 3, ""), + hostname: jspb.Message.getFieldWithDefault(msg, 4, ""), + addr: jspb.Message.getFieldWithDefault(msg, 5, ""), + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + v1_label_pb.Label.toObject, includeInstance) + }; + + 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.Server} + */ +proto.teleport.terminal.v1.Server.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.Server; + return proto.teleport.terminal.v1.Server.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.Server} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.Server} + */ +proto.teleport.terminal.v1.Server.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.setUri(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setTunnel(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setHostname(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setAddr(value); + break; + case 6: + var value = new v1_label_pb.Label; + reader.readMessage(value,v1_label_pb.Label.deserializeBinaryFromReader); + msg.addLabels(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.Server.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.Server.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.Server} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.Server.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTunnel(); + if (f) { + writer.writeBool( + 2, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getHostname(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getAddr(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 6, + f, + v1_label_pb.Label.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.Server.prototype.getUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Server} returns this + */ +proto.teleport.terminal.v1.Server.prototype.setUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bool tunnel = 2; + * @return {boolean} + */ +proto.teleport.terminal.v1.Server.prototype.getTunnel = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.teleport.terminal.v1.Server} returns this + */ +proto.teleport.terminal.v1.Server.prototype.setTunnel = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + +/** + * optional string name = 3; + * @return {string} + */ +proto.teleport.terminal.v1.Server.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Server} returns this + */ +proto.teleport.terminal.v1.Server.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string hostname = 4; + * @return {string} + */ +proto.teleport.terminal.v1.Server.prototype.getHostname = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Server} returns this + */ +proto.teleport.terminal.v1.Server.prototype.setHostname = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string addr = 5; + * @return {string} + */ +proto.teleport.terminal.v1.Server.prototype.getAddr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.Server} returns this + */ +proto.teleport.terminal.v1.Server.prototype.setAddr = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * repeated Label labels = 6; + * @return {!Array} + */ +proto.teleport.terminal.v1.Server.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_label_pb.Label, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.Server} returns this +*/ +proto.teleport.terminal.v1.Server.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 6, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Label=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Label} + */ +proto.teleport.terminal.v1.Server.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.teleport.terminal.v1.Label, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.Server} returns this + */ +proto.teleport.terminal.v1.Server.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); 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 new file mode 100644 index 0000000000000..6447780161d4e --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/service_grpc_pb.d.ts @@ -0,0 +1,287 @@ +// package: teleport.terminal.v1 +// file: v1/service.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as grpc from "grpc"; +import * as v1_service_pb from "../v1/service_pb"; +import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; +import * as v1_cluster_pb from "../v1/cluster_pb"; +import * as v1_database_pb from "../v1/database_pb"; +import * as v1_gateway_pb from "../v1/gateway_pb"; +import * as v1_kube_pb from "../v1/kube_pb"; +import * as v1_app_pb from "../v1/app_pb"; +import * as v1_server_pb from "../v1/server_pb"; +import * as v1_auth_settings_pb from "../v1/auth_settings_pb"; + +interface ITerminalServiceService extends grpc.ServiceDefinition { + listRootClusters: ITerminalServiceService_IListRootClusters; + listLeafClusters: ITerminalServiceService_IListLeafClusters; + listDatabases: ITerminalServiceService_IListDatabases; + listGateways: ITerminalServiceService_IListGateways; + listServers: ITerminalServiceService_IListServers; + listKubes: ITerminalServiceService_IListKubes; + listApps: ITerminalServiceService_IListApps; + createGateway: ITerminalServiceService_ICreateGateway; + addCluster: ITerminalServiceService_IAddCluster; + removeCluster: ITerminalServiceService_IRemoveCluster; + removeGateway: ITerminalServiceService_IRemoveGateway; + getAuthSettings: ITerminalServiceService_IGetAuthSettings; + getCluster: ITerminalServiceService_IGetCluster; + login: ITerminalServiceService_ILogin; + logout: ITerminalServiceService_ILogout; +} + +interface ITerminalServiceService_IListRootClusters extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/ListRootClusters"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_IListLeafClusters extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/ListLeafClusters"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_IListDatabases extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/ListDatabases"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + 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; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_IListKubes extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/ListKubes"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_IListApps extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/ListApps"; + 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_IAddCluster extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/AddCluster"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_IRemoveCluster extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/RemoveCluster"; + 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; + 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; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_IGetCluster extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/GetCluster"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_ILogin extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/Login"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} +interface ITerminalServiceService_ILogout extends grpc.MethodDefinition { + path: "/teleport.terminal.v1.TerminalService/Logout"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} + +export const TerminalServiceService: ITerminalServiceService; + +export interface ITerminalServiceServer { + listRootClusters: grpc.handleUnaryCall; + listLeafClusters: grpc.handleUnaryCall; + listDatabases: grpc.handleUnaryCall; + listGateways: grpc.handleUnaryCall; + listServers: grpc.handleUnaryCall; + listKubes: grpc.handleUnaryCall; + listApps: grpc.handleUnaryCall; + createGateway: grpc.handleUnaryCall; + addCluster: grpc.handleUnaryCall; + removeCluster: grpc.handleUnaryCall; + removeGateway: grpc.handleUnaryCall; + getAuthSettings: grpc.handleUnaryCall; + getCluster: grpc.handleUnaryCall; + login: grpc.handleUnaryCall; + logout: grpc.handleUnaryCall; +} + +export interface ITerminalServiceClient { + listRootClusters(request: v1_service_pb.ListClustersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + listRootClusters(request: v1_service_pb.ListClustersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + listRootClusters(request: v1_service_pb.ListClustersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + listLeafClusters(request: v1_service_pb.ListLeafClustersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + listLeafClusters(request: v1_service_pb.ListLeafClustersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + listLeafClusters(request: v1_service_pb.ListLeafClustersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + listDatabases(request: v1_service_pb.ListDatabasesRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabasesResponse) => void): grpc.ClientUnaryCall; + listDatabases(request: v1_service_pb.ListDatabasesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabasesResponse) => void): grpc.ClientUnaryCall; + listDatabases(request: v1_service_pb.ListDatabasesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabasesResponse) => 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; + listKubes(request: v1_service_pb.ListKubesRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListKubesResponse) => void): grpc.ClientUnaryCall; + listKubes(request: v1_service_pb.ListKubesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListKubesResponse) => void): grpc.ClientUnaryCall; + listKubes(request: v1_service_pb.ListKubesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListKubesResponse) => void): grpc.ClientUnaryCall; + 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; + 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; + 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; + getCluster(request: v1_service_pb.GetClusterRequest, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; + getCluster(request: v1_service_pb.GetClusterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; + getCluster(request: v1_service_pb.GetClusterRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; + login(request: v1_service_pb.LoginRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + login(request: v1_service_pb.LoginRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + login(request: v1_service_pb.LoginRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + logout(request: v1_service_pb.LogoutRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + logout(request: v1_service_pb.LogoutRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + logout(request: v1_service_pb.LogoutRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; +} + +export class TerminalServiceClient extends grpc.Client implements ITerminalServiceClient { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + public listRootClusters(request: v1_service_pb.ListClustersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + public listRootClusters(request: v1_service_pb.ListClustersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + public listRootClusters(request: v1_service_pb.ListClustersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + public listLeafClusters(request: v1_service_pb.ListLeafClustersRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + public listLeafClusters(request: v1_service_pb.ListLeafClustersRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + public listLeafClusters(request: v1_service_pb.ListLeafClustersRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListClustersResponse) => void): grpc.ClientUnaryCall; + public listDatabases(request: v1_service_pb.ListDatabasesRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabasesResponse) => void): grpc.ClientUnaryCall; + public listDatabases(request: v1_service_pb.ListDatabasesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabasesResponse) => void): grpc.ClientUnaryCall; + public listDatabases(request: v1_service_pb.ListDatabasesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListDatabasesResponse) => 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; + public listKubes(request: v1_service_pb.ListKubesRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListKubesResponse) => void): grpc.ClientUnaryCall; + public listKubes(request: v1_service_pb.ListKubesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListKubesResponse) => void): grpc.ClientUnaryCall; + public listKubes(request: v1_service_pb.ListKubesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.ListKubesResponse) => void): grpc.ClientUnaryCall; + 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 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 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; + public getCluster(request: v1_service_pb.GetClusterRequest, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; + public getCluster(request: v1_service_pb.GetClusterRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; + public getCluster(request: v1_service_pb.GetClusterRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_cluster_pb.Cluster) => void): grpc.ClientUnaryCall; + public login(request: v1_service_pb.LoginRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public login(request: v1_service_pb.LoginRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public login(request: v1_service_pb.LoginRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public logout(request: v1_service_pb.LogoutRequest, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public logout(request: v1_service_pb.LogoutRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => void): grpc.ClientUnaryCall; + public logout(request: v1_service_pb.LogoutRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: v1_service_pb.EmptyResponse) => 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 new file mode 100644 index 0000000000000..32469d2d144c3 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/service_grpc_pb.js @@ -0,0 +1,490 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// Copyright 2021 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. +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var v1_service_pb = require('../v1/service_pb.js'); +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +var v1_cluster_pb = require('../v1/cluster_pb.js'); +var v1_database_pb = require('../v1/database_pb.js'); +var v1_gateway_pb = require('../v1/gateway_pb.js'); +var v1_kube_pb = require('../v1/kube_pb.js'); +var v1_app_pb = require('../v1/app_pb.js'); +var v1_server_pb = require('../v1/server_pb.js'); +var v1_auth_settings_pb = require('../v1/auth_settings_pb.js'); + +function serialize_teleport_terminal_v1_AddClusterRequest(arg) { + if (!(arg instanceof v1_service_pb.AddClusterRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.AddClusterRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_AddClusterRequest(buffer_arg) { + return v1_service_pb.AddClusterRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_AuthSettings(arg) { + if (!(arg instanceof v1_auth_settings_pb.AuthSettings)) { + throw new Error('Expected argument of type teleport.terminal.v1.AuthSettings'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_AuthSettings(buffer_arg) { + return v1_auth_settings_pb.AuthSettings.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_Cluster(arg) { + if (!(arg instanceof v1_cluster_pb.Cluster)) { + throw new Error('Expected argument of type teleport.terminal.v1.Cluster'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_Cluster(buffer_arg) { + return v1_cluster_pb.Cluster.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_CreateGatewayRequest(arg) { + if (!(arg instanceof v1_service_pb.CreateGatewayRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.CreateGatewayRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_CreateGatewayRequest(buffer_arg) { + return v1_service_pb.CreateGatewayRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_EmptyResponse(arg) { + if (!(arg instanceof v1_service_pb.EmptyResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.EmptyResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_EmptyResponse(buffer_arg) { + return v1_service_pb.EmptyResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_Gateway(arg) { + if (!(arg instanceof v1_gateway_pb.Gateway)) { + throw new Error('Expected argument of type teleport.terminal.v1.Gateway'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_Gateway(buffer_arg) { + return v1_gateway_pb.Gateway.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_GetAuthSettingsRequest(arg) { + if (!(arg instanceof v1_service_pb.GetAuthSettingsRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.GetAuthSettingsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_GetAuthSettingsRequest(buffer_arg) { + return v1_service_pb.GetAuthSettingsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_GetClusterRequest(arg) { + if (!(arg instanceof v1_service_pb.GetClusterRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.GetClusterRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_GetClusterRequest(buffer_arg) { + return v1_service_pb.GetClusterRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListAppsRequest(arg) { + if (!(arg instanceof v1_service_pb.ListAppsRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListAppsRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListAppsRequest(buffer_arg) { + return v1_service_pb.ListAppsRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListAppsResponse(arg) { + if (!(arg instanceof v1_service_pb.ListAppsResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListAppsResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListAppsResponse(buffer_arg) { + return v1_service_pb.ListAppsResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListClustersRequest(arg) { + if (!(arg instanceof v1_service_pb.ListClustersRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListClustersRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListClustersRequest(buffer_arg) { + return v1_service_pb.ListClustersRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListClustersResponse(arg) { + if (!(arg instanceof v1_service_pb.ListClustersResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListClustersResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListClustersResponse(buffer_arg) { + return v1_service_pb.ListClustersResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListDatabasesRequest(arg) { + if (!(arg instanceof v1_service_pb.ListDatabasesRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListDatabasesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListDatabasesRequest(buffer_arg) { + return v1_service_pb.ListDatabasesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListDatabasesResponse(arg) { + if (!(arg instanceof v1_service_pb.ListDatabasesResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListDatabasesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListDatabasesResponse(buffer_arg) { + return v1_service_pb.ListDatabasesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListGatewaysRequest(arg) { + if (!(arg instanceof v1_service_pb.ListGatewaysRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListGatewaysRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListGatewaysRequest(buffer_arg) { + return v1_service_pb.ListGatewaysRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListGatewaysResponse(arg) { + if (!(arg instanceof v1_service_pb.ListGatewaysResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListGatewaysResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListGatewaysResponse(buffer_arg) { + return v1_service_pb.ListGatewaysResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListKubesRequest(arg) { + if (!(arg instanceof v1_service_pb.ListKubesRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListKubesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListKubesRequest(buffer_arg) { + return v1_service_pb.ListKubesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListKubesResponse(arg) { + if (!(arg instanceof v1_service_pb.ListKubesResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListKubesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListKubesResponse(buffer_arg) { + return v1_service_pb.ListKubesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListLeafClustersRequest(arg) { + if (!(arg instanceof v1_service_pb.ListLeafClustersRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListLeafClustersRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListLeafClustersRequest(buffer_arg) { + return v1_service_pb.ListLeafClustersRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListServersRequest(arg) { + if (!(arg instanceof v1_service_pb.ListServersRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListServersRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListServersRequest(buffer_arg) { + return v1_service_pb.ListServersRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_ListServersResponse(arg) { + if (!(arg instanceof v1_service_pb.ListServersResponse)) { + throw new Error('Expected argument of type teleport.terminal.v1.ListServersResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_ListServersResponse(buffer_arg) { + return v1_service_pb.ListServersResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_LoginRequest(arg) { + if (!(arg instanceof v1_service_pb.LoginRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.LoginRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_LoginRequest(buffer_arg) { + return v1_service_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_LogoutRequest(arg) { + if (!(arg instanceof v1_service_pb.LogoutRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.LogoutRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_LogoutRequest(buffer_arg) { + return v1_service_pb.LogoutRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_RemoveClusterRequest(arg) { + if (!(arg instanceof v1_service_pb.RemoveClusterRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.RemoveClusterRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_RemoveClusterRequest(buffer_arg) { + return v1_service_pb.RemoveClusterRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_teleport_terminal_v1_RemoveGatewayRequest(arg) { + if (!(arg instanceof v1_service_pb.RemoveGatewayRequest)) { + throw new Error('Expected argument of type teleport.terminal.v1.RemoveGatewayRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_teleport_terminal_v1_RemoveGatewayRequest(buffer_arg) { + return v1_service_pb.RemoveGatewayRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// TerminalService desribes teleterm service +var TerminalServiceService = exports.TerminalServiceService = { + // ListRootClusters lists root clusters +listRootClusters: { + path: '/teleport.terminal.v1.TerminalService/ListRootClusters', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListClustersRequest, + responseType: v1_service_pb.ListClustersResponse, + requestSerialize: serialize_teleport_terminal_v1_ListClustersRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListClustersRequest, + responseSerialize: serialize_teleport_terminal_v1_ListClustersResponse, + responseDeserialize: deserialize_teleport_terminal_v1_ListClustersResponse, + }, + // ListLeafClusters lists leaf clusters +listLeafClusters: { + path: '/teleport.terminal.v1.TerminalService/ListLeafClusters', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListLeafClustersRequest, + responseType: v1_service_pb.ListClustersResponse, + requestSerialize: serialize_teleport_terminal_v1_ListLeafClustersRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListLeafClustersRequest, + responseSerialize: serialize_teleport_terminal_v1_ListClustersResponse, + responseDeserialize: deserialize_teleport_terminal_v1_ListClustersResponse, + }, + // ListDatabases lists databases +listDatabases: { + path: '/teleport.terminal.v1.TerminalService/ListDatabases', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListDatabasesRequest, + responseType: v1_service_pb.ListDatabasesResponse, + requestSerialize: serialize_teleport_terminal_v1_ListDatabasesRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListDatabasesRequest, + responseSerialize: serialize_teleport_terminal_v1_ListDatabasesResponse, + responseDeserialize: deserialize_teleport_terminal_v1_ListDatabasesResponse, + }, + // 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', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListServersRequest, + responseType: v1_service_pb.ListServersResponse, + requestSerialize: serialize_teleport_terminal_v1_ListServersRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListServersRequest, + responseSerialize: serialize_teleport_terminal_v1_ListServersResponse, + responseDeserialize: deserialize_teleport_terminal_v1_ListServersResponse, + }, + // ListKubes list kubes +listKubes: { + path: '/teleport.terminal.v1.TerminalService/ListKubes', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListKubesRequest, + responseType: v1_service_pb.ListKubesResponse, + requestSerialize: serialize_teleport_terminal_v1_ListKubesRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListKubesRequest, + responseSerialize: serialize_teleport_terminal_v1_ListKubesResponse, + responseDeserialize: deserialize_teleport_terminal_v1_ListKubesResponse, + }, + // ListApps list apps +listApps: { + path: '/teleport.terminal.v1.TerminalService/ListApps', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.ListAppsRequest, + responseType: v1_service_pb.ListAppsResponse, + requestSerialize: serialize_teleport_terminal_v1_ListAppsRequest, + requestDeserialize: deserialize_teleport_terminal_v1_ListAppsRequest, + 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', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.AddClusterRequest, + responseType: v1_cluster_pb.Cluster, + requestSerialize: serialize_teleport_terminal_v1_AddClusterRequest, + requestDeserialize: deserialize_teleport_terminal_v1_AddClusterRequest, + responseSerialize: serialize_teleport_terminal_v1_Cluster, + responseDeserialize: deserialize_teleport_terminal_v1_Cluster, + }, + // RemoveCluster removes a cluster from profile +removeCluster: { + path: '/teleport.terminal.v1.TerminalService/RemoveCluster', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.RemoveClusterRequest, + responseType: v1_service_pb.EmptyResponse, + requestSerialize: serialize_teleport_terminal_v1_RemoveClusterRequest, + requestDeserialize: deserialize_teleport_terminal_v1_RemoveClusterRequest, + responseSerialize: serialize_teleport_terminal_v1_EmptyResponse, + responseDeserialize: deserialize_teleport_terminal_v1_EmptyResponse, + }, + // RemoveGateway removes a gateway +removeGateway: { + path: '/teleport.terminal.v1.TerminalService/RemoveGateway', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.RemoveGatewayRequest, + responseType: v1_service_pb.EmptyResponse, + requestSerialize: serialize_teleport_terminal_v1_RemoveGatewayRequest, + requestDeserialize: deserialize_teleport_terminal_v1_RemoveGatewayRequest, + responseSerialize: serialize_teleport_terminal_v1_EmptyResponse, + responseDeserialize: deserialize_teleport_terminal_v1_EmptyResponse, + }, + // GetAuthSettings returns cluster auth settigns +getAuthSettings: { + path: '/teleport.terminal.v1.TerminalService/GetAuthSettings', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.GetAuthSettingsRequest, + responseType: v1_auth_settings_pb.AuthSettings, + requestSerialize: serialize_teleport_terminal_v1_GetAuthSettingsRequest, + requestDeserialize: deserialize_teleport_terminal_v1_GetAuthSettingsRequest, + responseSerialize: serialize_teleport_terminal_v1_AuthSettings, + responseDeserialize: deserialize_teleport_terminal_v1_AuthSettings, + }, + // GetCluster returns a cluster +getCluster: { + path: '/teleport.terminal.v1.TerminalService/GetCluster', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.GetClusterRequest, + responseType: v1_cluster_pb.Cluster, + requestSerialize: serialize_teleport_terminal_v1_GetClusterRequest, + requestDeserialize: deserialize_teleport_terminal_v1_GetClusterRequest, + responseSerialize: serialize_teleport_terminal_v1_Cluster, + responseDeserialize: deserialize_teleport_terminal_v1_Cluster, + }, + // Login logs in a user to a cluster +login: { + path: '/teleport.terminal.v1.TerminalService/Login', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.LoginRequest, + responseType: v1_service_pb.EmptyResponse, + requestSerialize: serialize_teleport_terminal_v1_LoginRequest, + requestDeserialize: deserialize_teleport_terminal_v1_LoginRequest, + responseSerialize: serialize_teleport_terminal_v1_EmptyResponse, + responseDeserialize: deserialize_teleport_terminal_v1_EmptyResponse, + }, + // ClusterLogin logs out a user from cluster +logout: { + path: '/teleport.terminal.v1.TerminalService/Logout', + requestStream: false, + responseStream: false, + requestType: v1_service_pb.LogoutRequest, + responseType: v1_service_pb.EmptyResponse, + requestSerialize: serialize_teleport_terminal_v1_LogoutRequest, + requestDeserialize: deserialize_teleport_terminal_v1_LogoutRequest, + responseSerialize: serialize_teleport_terminal_v1_EmptyResponse, + responseDeserialize: deserialize_teleport_terminal_v1_EmptyResponse, + }, +}; + +exports.TerminalServiceClient = grpc.makeGenericClientConstructor(TerminalServiceService); diff --git a/lib/teleterm/api/protogen/js/v1/service_pb.d.ts b/lib/teleterm/api/protogen/js/v1/service_pb.d.ts new file mode 100644 index 0000000000000..aa2fc3d51634f --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/service_pb.d.ts @@ -0,0 +1,561 @@ +// package: teleport.terminal.v1 +// file: v1/service.proto + +/* tslint:disable */ +/* eslint-disable */ + +import * as jspb from "google-protobuf"; +import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb"; +import * as v1_cluster_pb from "../v1/cluster_pb"; +import * as v1_database_pb from "../v1/database_pb"; +import * as v1_gateway_pb from "../v1/gateway_pb"; +import * as v1_kube_pb from "../v1/kube_pb"; +import * as v1_app_pb from "../v1/app_pb"; +import * as v1_server_pb from "../v1/server_pb"; +import * as v1_auth_settings_pb from "../v1/auth_settings_pb"; + +export class RemoveClusterRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): RemoveClusterRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RemoveClusterRequest.AsObject; + static toObject(includeInstance: boolean, msg: RemoveClusterRequest): RemoveClusterRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RemoveClusterRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RemoveClusterRequest; + static deserializeBinaryFromReader(message: RemoveClusterRequest, reader: jspb.BinaryReader): RemoveClusterRequest; +} + +export namespace RemoveClusterRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class GetClusterRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): GetClusterRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetClusterRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetClusterRequest): GetClusterRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetClusterRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetClusterRequest; + static deserializeBinaryFromReader(message: GetClusterRequest, reader: jspb.BinaryReader): GetClusterRequest; +} + +export namespace GetClusterRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class LogoutRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): LogoutRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LogoutRequest.AsObject; + static toObject(includeInstance: boolean, msg: LogoutRequest): LogoutRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LogoutRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LogoutRequest; + static deserializeBinaryFromReader(message: LogoutRequest, reader: jspb.BinaryReader): LogoutRequest; +} + +export namespace LogoutRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class LoginRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): LoginRequest; + + + hasLocal(): boolean; + clearLocal(): void; + getLocal(): LoginRequest.LocalParams | undefined; + setLocal(value?: LoginRequest.LocalParams): LoginRequest; + + + hasSso(): boolean; + clearSso(): void; + getSso(): LoginRequest.SsoParams | undefined; + setSso(value?: LoginRequest.SsoParams): LoginRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LoginRequest.AsObject; + static toObject(includeInstance: boolean, msg: LoginRequest): LoginRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LoginRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LoginRequest; + static deserializeBinaryFromReader(message: LoginRequest, reader: jspb.BinaryReader): LoginRequest; +} + +export namespace LoginRequest { + export type AsObject = { + clusterUri: string, + local?: LoginRequest.LocalParams.AsObject, + sso?: LoginRequest.SsoParams.AsObject, + } + + + export class LocalParams extends jspb.Message { + getUser(): string; + setUser(value: string): LocalParams; + + getPassword(): string; + setPassword(value: string): LocalParams; + + getToken(): string; + setToken(value: string): LocalParams; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): LocalParams.AsObject; + static toObject(includeInstance: boolean, msg: LocalParams): LocalParams.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: LocalParams, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): LocalParams; + static deserializeBinaryFromReader(message: LocalParams, reader: jspb.BinaryReader): LocalParams; + } + + export namespace LocalParams { + export type AsObject = { + user: string, + password: string, + token: string, + } + } + + export class SsoParams extends jspb.Message { + getProviderType(): string; + setProviderType(value: string): SsoParams; + + getProviderName(): string; + setProviderName(value: string): SsoParams; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SsoParams.AsObject; + static toObject(includeInstance: boolean, msg: SsoParams): SsoParams.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SsoParams, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SsoParams; + static deserializeBinaryFromReader(message: SsoParams, reader: jspb.BinaryReader): SsoParams; + } + + export namespace SsoParams { + export type AsObject = { + providerType: string, + providerName: string, + } + } + +} + +export class AddClusterRequest extends jspb.Message { + getName(): string; + setName(value: string): AddClusterRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AddClusterRequest.AsObject; + static toObject(includeInstance: boolean, msg: AddClusterRequest): AddClusterRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AddClusterRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AddClusterRequest; + static deserializeBinaryFromReader(message: AddClusterRequest, reader: jspb.BinaryReader): AddClusterRequest; +} + +export namespace AddClusterRequest { + export type AsObject = { + name: string, + } +} + +export class ListKubesRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): ListKubesRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListKubesRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListKubesRequest): ListKubesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListKubesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListKubesRequest; + static deserializeBinaryFromReader(message: ListKubesRequest, reader: jspb.BinaryReader): ListKubesRequest; +} + +export namespace ListKubesRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class ListAppsRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): ListAppsRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListAppsRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListAppsRequest): ListAppsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListAppsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListAppsRequest; + static deserializeBinaryFromReader(message: ListAppsRequest, reader: jspb.BinaryReader): ListAppsRequest; +} + +export namespace ListAppsRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class ListClustersRequest extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListClustersRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListClustersRequest): ListClustersRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListClustersRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListClustersRequest; + static deserializeBinaryFromReader(message: ListClustersRequest, reader: jspb.BinaryReader): ListClustersRequest; +} + +export namespace ListClustersRequest { + export type AsObject = { + } +} + +export class ListClustersResponse extends jspb.Message { + clearClustersList(): void; + getClustersList(): Array; + setClustersList(value: Array): ListClustersResponse; + addClusters(value?: v1_cluster_pb.Cluster, index?: number): v1_cluster_pb.Cluster; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListClustersResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListClustersResponse): ListClustersResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListClustersResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListClustersResponse; + static deserializeBinaryFromReader(message: ListClustersResponse, reader: jspb.BinaryReader): ListClustersResponse; +} + +export namespace ListClustersResponse { + export type AsObject = { + clustersList: Array, + } +} + +export class ListDatabasesRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): ListDatabasesRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListDatabasesRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListDatabasesRequest): ListDatabasesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListDatabasesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListDatabasesRequest; + static deserializeBinaryFromReader(message: ListDatabasesRequest, reader: jspb.BinaryReader): ListDatabasesRequest; +} + +export namespace ListDatabasesRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class ListLeafClustersRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): ListLeafClustersRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListLeafClustersRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListLeafClustersRequest): ListLeafClustersRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListLeafClustersRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListLeafClustersRequest; + static deserializeBinaryFromReader(message: ListLeafClustersRequest, reader: jspb.BinaryReader): ListLeafClustersRequest; +} + +export namespace ListLeafClustersRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class ListDatabasesResponse extends jspb.Message { + clearDatabasesList(): void; + getDatabasesList(): Array; + setDatabasesList(value: Array): ListDatabasesResponse; + addDatabases(value?: v1_database_pb.Database, index?: number): v1_database_pb.Database; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListDatabasesResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListDatabasesResponse): ListDatabasesResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListDatabasesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListDatabasesResponse; + static deserializeBinaryFromReader(message: ListDatabasesResponse, reader: jspb.BinaryReader): ListDatabasesResponse; +} + +export namespace ListDatabasesResponse { + export type AsObject = { + databasesList: Array, + } +} + +export class CreateGatewayRequest extends jspb.Message { + getTargetUri(): string; + setTargetUri(value: string): CreateGatewayRequest; + + getTargetUser(): string; + setTargetUser(value: string): CreateGatewayRequest; + + getLocalPort(): string; + setLocalPort(value: string): CreateGatewayRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CreateGatewayRequest.AsObject; + static toObject(includeInstance: boolean, msg: CreateGatewayRequest): CreateGatewayRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: CreateGatewayRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CreateGatewayRequest; + static deserializeBinaryFromReader(message: CreateGatewayRequest, reader: jspb.BinaryReader): CreateGatewayRequest; +} + +export namespace CreateGatewayRequest { + export type AsObject = { + targetUri: string, + targetUser: string, + localPort: string, + } +} + +export class ListGatewaysRequest extends jspb.Message { + clearClusterIdsList(): void; + getClusterIdsList(): Array; + setClusterIdsList(value: Array): ListGatewaysRequest; + addClusterIds(value: string, index?: number): string; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListGatewaysRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListGatewaysRequest): ListGatewaysRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListGatewaysRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListGatewaysRequest; + static deserializeBinaryFromReader(message: ListGatewaysRequest, reader: jspb.BinaryReader): ListGatewaysRequest; +} + +export namespace ListGatewaysRequest { + export type AsObject = { + clusterIdsList: Array, + } +} + +export class ListGatewaysResponse extends jspb.Message { + clearGatewaysList(): void; + getGatewaysList(): Array; + setGatewaysList(value: Array): ListGatewaysResponse; + addGateways(value?: v1_gateway_pb.Gateway, index?: number): v1_gateway_pb.Gateway; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListGatewaysResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListGatewaysResponse): ListGatewaysResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListGatewaysResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListGatewaysResponse; + static deserializeBinaryFromReader(message: ListGatewaysResponse, reader: jspb.BinaryReader): ListGatewaysResponse; +} + +export namespace ListGatewaysResponse { + export type AsObject = { + gatewaysList: Array, + } +} + +export class RemoveGatewayRequest extends jspb.Message { + getGatewayUri(): string; + setGatewayUri(value: string): RemoveGatewayRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RemoveGatewayRequest.AsObject; + static toObject(includeInstance: boolean, msg: RemoveGatewayRequest): RemoveGatewayRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RemoveGatewayRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RemoveGatewayRequest; + static deserializeBinaryFromReader(message: RemoveGatewayRequest, reader: jspb.BinaryReader): RemoveGatewayRequest; +} + +export namespace RemoveGatewayRequest { + export type AsObject = { + gatewayUri: string, + } +} + +export class ListServersRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): ListServersRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListServersRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListServersRequest): ListServersRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListServersRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListServersRequest; + static deserializeBinaryFromReader(message: ListServersRequest, reader: jspb.BinaryReader): ListServersRequest; +} + +export namespace ListServersRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class ListServersResponse extends jspb.Message { + clearServersList(): void; + getServersList(): Array; + setServersList(value: Array): ListServersResponse; + addServers(value?: v1_server_pb.Server, index?: number): v1_server_pb.Server; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListServersResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListServersResponse): ListServersResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListServersResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListServersResponse; + static deserializeBinaryFromReader(message: ListServersResponse, reader: jspb.BinaryReader): ListServersResponse; +} + +export namespace ListServersResponse { + export type AsObject = { + serversList: Array, + } +} + +export class ListKubesResponse extends jspb.Message { + clearKubesList(): void; + getKubesList(): Array; + setKubesList(value: Array): ListKubesResponse; + addKubes(value?: v1_kube_pb.Kube, index?: number): v1_kube_pb.Kube; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListKubesResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListKubesResponse): ListKubesResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListKubesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListKubesResponse; + static deserializeBinaryFromReader(message: ListKubesResponse, reader: jspb.BinaryReader): ListKubesResponse; +} + +export namespace ListKubesResponse { + export type AsObject = { + kubesList: Array, + } +} + +export class ListAppsResponse extends jspb.Message { + clearAppsList(): void; + getAppsList(): Array; + setAppsList(value: Array): ListAppsResponse; + addApps(value?: v1_app_pb.App, index?: number): v1_app_pb.App; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListAppsResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListAppsResponse): ListAppsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListAppsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListAppsResponse; + static deserializeBinaryFromReader(message: ListAppsResponse, reader: jspb.BinaryReader): ListAppsResponse; +} + +export namespace ListAppsResponse { + export type AsObject = { + appsList: Array, + } +} + +export class GetAuthSettingsRequest extends jspb.Message { + getClusterUri(): string; + setClusterUri(value: string): GetAuthSettingsRequest; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetAuthSettingsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetAuthSettingsRequest): GetAuthSettingsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetAuthSettingsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetAuthSettingsRequest; + static deserializeBinaryFromReader(message: GetAuthSettingsRequest, reader: jspb.BinaryReader): GetAuthSettingsRequest; +} + +export namespace GetAuthSettingsRequest { + export type AsObject = { + clusterUri: string, + } +} + +export class EmptyResponse extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): EmptyResponse.AsObject; + static toObject(includeInstance: boolean, msg: EmptyResponse): EmptyResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: EmptyResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): EmptyResponse; + static deserializeBinaryFromReader(message: EmptyResponse, reader: jspb.BinaryReader): EmptyResponse; +} + +export namespace EmptyResponse { + export type AsObject = { + } +} diff --git a/lib/teleterm/api/protogen/js/v1/service_pb.js b/lib/teleterm/api/protogen/js/v1/service_pb.js new file mode 100644 index 0000000000000..b0486c3c7b506 --- /dev/null +++ b/lib/teleterm/api/protogen/js/v1/service_pb.js @@ -0,0 +1,4079 @@ +// source: v1/service.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); +goog.object.extend(proto, google_protobuf_empty_pb); +var v1_cluster_pb = require('../v1/cluster_pb.js'); +goog.object.extend(proto, v1_cluster_pb); +var v1_database_pb = require('../v1/database_pb.js'); +goog.object.extend(proto, v1_database_pb); +var v1_gateway_pb = require('../v1/gateway_pb.js'); +goog.object.extend(proto, v1_gateway_pb); +var v1_kube_pb = require('../v1/kube_pb.js'); +goog.object.extend(proto, v1_kube_pb); +var v1_app_pb = require('../v1/app_pb.js'); +goog.object.extend(proto, v1_app_pb); +var v1_server_pb = require('../v1/server_pb.js'); +goog.object.extend(proto, v1_server_pb); +var v1_auth_settings_pb = require('../v1/auth_settings_pb.js'); +goog.object.extend(proto, v1_auth_settings_pb); +goog.exportSymbol('proto.teleport.terminal.v1.AddClusterRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.CreateGatewayRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.EmptyResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.GetAuthSettingsRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.GetClusterRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListAppsRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListAppsResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListClustersRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListClustersResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListDatabasesRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListDatabasesResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListGatewaysRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListGatewaysResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListKubesRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListKubesResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListLeafClustersRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListServersRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.ListServersResponse', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.LoginRequest', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.LoginRequest.LocalParams', null, global); +goog.exportSymbol('proto.teleport.terminal.v1.LoginRequest.SsoParams', null, global); +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); +/** + * 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.RemoveClusterRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.RemoveClusterRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.RemoveClusterRequest.displayName = 'proto.teleport.terminal.v1.RemoveClusterRequest'; +} +/** + * 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.GetClusterRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.GetClusterRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.GetClusterRequest.displayName = 'proto.teleport.terminal.v1.GetClusterRequest'; +} +/** + * 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.LogoutRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.LogoutRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.LogoutRequest.displayName = 'proto.teleport.terminal.v1.LogoutRequest'; +} +/** + * 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.LoginRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.LoginRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.LoginRequest.displayName = 'proto.teleport.terminal.v1.LoginRequest'; +} +/** + * 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.LoginRequest.LocalParams = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.LoginRequest.LocalParams, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.LoginRequest.LocalParams.displayName = 'proto.teleport.terminal.v1.LoginRequest.LocalParams'; +} +/** + * 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.LoginRequest.SsoParams = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.LoginRequest.SsoParams, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.LoginRequest.SsoParams.displayName = 'proto.teleport.terminal.v1.LoginRequest.SsoParams'; +} +/** + * 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.AddClusterRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.AddClusterRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.AddClusterRequest.displayName = 'proto.teleport.terminal.v1.AddClusterRequest'; +} +/** + * 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.ListKubesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListKubesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListKubesRequest.displayName = 'proto.teleport.terminal.v1.ListKubesRequest'; +} +/** + * 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.ListAppsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListAppsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListAppsRequest.displayName = 'proto.teleport.terminal.v1.ListAppsRequest'; +} +/** + * 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.ListClustersRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListClustersRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListClustersRequest.displayName = 'proto.teleport.terminal.v1.ListClustersRequest'; +} +/** + * 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.ListClustersResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListClustersResponse.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListClustersResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListClustersResponse.displayName = 'proto.teleport.terminal.v1.ListClustersResponse'; +} +/** + * 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.ListDatabasesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListDatabasesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListDatabasesRequest.displayName = 'proto.teleport.terminal.v1.ListDatabasesRequest'; +} +/** + * 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.ListLeafClustersRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListLeafClustersRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListLeafClustersRequest.displayName = 'proto.teleport.terminal.v1.ListLeafClustersRequest'; +} +/** + * 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.ListDatabasesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListDatabasesResponse.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListDatabasesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListDatabasesResponse.displayName = 'proto.teleport.terminal.v1.ListDatabasesResponse'; +} +/** + * 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.CreateGatewayRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.CreateGatewayRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.CreateGatewayRequest.displayName = 'proto.teleport.terminal.v1.CreateGatewayRequest'; +} +/** + * 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.ListGatewaysRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListGatewaysRequest.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListGatewaysRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListGatewaysRequest.displayName = 'proto.teleport.terminal.v1.ListGatewaysRequest'; +} +/** + * 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.ListGatewaysResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListGatewaysResponse.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListGatewaysResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListGatewaysResponse.displayName = 'proto.teleport.terminal.v1.ListGatewaysResponse'; +} +/** + * 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.RemoveGatewayRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.RemoveGatewayRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.RemoveGatewayRequest.displayName = 'proto.teleport.terminal.v1.RemoveGatewayRequest'; +} +/** + * 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.ListServersRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListServersRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListServersRequest.displayName = 'proto.teleport.terminal.v1.ListServersRequest'; +} +/** + * 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.ListServersResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListServersResponse.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListServersResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListServersResponse.displayName = 'proto.teleport.terminal.v1.ListServersResponse'; +} +/** + * 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.ListKubesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListKubesResponse.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListKubesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListKubesResponse.displayName = 'proto.teleport.terminal.v1.ListKubesResponse'; +} +/** + * 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.ListAppsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.teleport.terminal.v1.ListAppsResponse.repeatedFields_, null); +}; +goog.inherits(proto.teleport.terminal.v1.ListAppsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.ListAppsResponse.displayName = 'proto.teleport.terminal.v1.ListAppsResponse'; +} +/** + * 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.GetAuthSettingsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.GetAuthSettingsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.GetAuthSettingsRequest.displayName = 'proto.teleport.terminal.v1.GetAuthSettingsRequest'; +} +/** + * 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.EmptyResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.teleport.terminal.v1.EmptyResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.teleport.terminal.v1.EmptyResponse.displayName = 'proto.teleport.terminal.v1.EmptyResponse'; +} + + + +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.RemoveClusterRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.RemoveClusterRequest.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.RemoveClusterRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.RemoveClusterRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.RemoveClusterRequest} + */ +proto.teleport.terminal.v1.RemoveClusterRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.RemoveClusterRequest; + return proto.teleport.terminal.v1.RemoveClusterRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.RemoveClusterRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.RemoveClusterRequest} + */ +proto.teleport.terminal.v1.RemoveClusterRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.RemoveClusterRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.RemoveClusterRequest.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.RemoveClusterRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.RemoveClusterRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.RemoveClusterRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.RemoveClusterRequest} returns this + */ +proto.teleport.terminal.v1.RemoveClusterRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.GetClusterRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.GetClusterRequest.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.GetClusterRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.GetClusterRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.GetClusterRequest} + */ +proto.teleport.terminal.v1.GetClusterRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.GetClusterRequest; + return proto.teleport.terminal.v1.GetClusterRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.GetClusterRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.GetClusterRequest} + */ +proto.teleport.terminal.v1.GetClusterRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.GetClusterRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.GetClusterRequest.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.GetClusterRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.GetClusterRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.GetClusterRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.GetClusterRequest} returns this + */ +proto.teleport.terminal.v1.GetClusterRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.LogoutRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.LogoutRequest.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.LogoutRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LogoutRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.LogoutRequest} + */ +proto.teleport.terminal.v1.LogoutRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.LogoutRequest; + return proto.teleport.terminal.v1.LogoutRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.LogoutRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.LogoutRequest} + */ +proto.teleport.terminal.v1.LogoutRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.LogoutRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.LogoutRequest.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.LogoutRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LogoutRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.LogoutRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LogoutRequest} returns this + */ +proto.teleport.terminal.v1.LogoutRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.LoginRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.LoginRequest.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.LoginRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoginRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, ""), + local: (f = msg.getLocal()) && proto.teleport.terminal.v1.LoginRequest.LocalParams.toObject(includeInstance, f), + sso: (f = msg.getSso()) && proto.teleport.terminal.v1.LoginRequest.SsoParams.toObject(includeInstance, f) + }; + + 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.LoginRequest} + */ +proto.teleport.terminal.v1.LoginRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.LoginRequest; + return proto.teleport.terminal.v1.LoginRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.LoginRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.LoginRequest} + */ +proto.teleport.terminal.v1.LoginRequest.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.setClusterUri(value); + break; + case 2: + var value = new proto.teleport.terminal.v1.LoginRequest.LocalParams; + reader.readMessage(value,proto.teleport.terminal.v1.LoginRequest.LocalParams.deserializeBinaryFromReader); + msg.setLocal(value); + break; + case 3: + var value = new proto.teleport.terminal.v1.LoginRequest.SsoParams; + reader.readMessage(value,proto.teleport.terminal.v1.LoginRequest.SsoParams.deserializeBinaryFromReader); + msg.setSso(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.LoginRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.LoginRequest.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.LoginRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoginRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLocal(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.teleport.terminal.v1.LoginRequest.LocalParams.serializeBinaryToWriter + ); + } + f = message.getSso(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.teleport.terminal.v1.LoginRequest.SsoParams.serializeBinaryToWriter + ); + } +}; + + + + + +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.LoginRequest.LocalParams.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.LoginRequest.LocalParams.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.LoginRequest.LocalParams} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.toObject = function(includeInstance, msg) { + var f, obj = { + user: jspb.Message.getFieldWithDefault(msg, 1, ""), + password: jspb.Message.getFieldWithDefault(msg, 2, ""), + token: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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.LoginRequest.LocalParams} + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.LoginRequest.LocalParams; + return proto.teleport.terminal.v1.LoginRequest.LocalParams.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.LoginRequest.LocalParams} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.LoginRequest.LocalParams} + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.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.setUser(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPassword(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setToken(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.LoginRequest.LocalParams.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.LoginRequest.LocalParams} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUser(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getPassword(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getToken(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string user = 1; + * @return {string} + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.getUser = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoginRequest.LocalParams} returns this + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.setUser = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string password = 2; + * @return {string} + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.getPassword = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoginRequest.LocalParams} returns this + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.setPassword = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string token = 3; + * @return {string} + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.getToken = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoginRequest.LocalParams} returns this + */ +proto.teleport.terminal.v1.LoginRequest.LocalParams.prototype.setToken = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +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.LoginRequest.SsoParams.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.LoginRequest.SsoParams.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.LoginRequest.SsoParams} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.toObject = function(includeInstance, msg) { + var f, obj = { + providerType: jspb.Message.getFieldWithDefault(msg, 1, ""), + providerName: 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.LoginRequest.SsoParams} + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.LoginRequest.SsoParams; + return proto.teleport.terminal.v1.LoginRequest.SsoParams.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.LoginRequest.SsoParams} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.LoginRequest.SsoParams} + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.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.setProviderType(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setProviderName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.LoginRequest.SsoParams.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.LoginRequest.SsoParams} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProviderType(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProviderName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string provider_type = 1; + * @return {string} + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.prototype.getProviderType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoginRequest.SsoParams} returns this + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.prototype.setProviderType = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string provider_name = 2; + * @return {string} + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.prototype.getProviderName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoginRequest.SsoParams} returns this + */ +proto.teleport.terminal.v1.LoginRequest.SsoParams.prototype.setProviderName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.LoginRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.LoginRequest} returns this + */ +proto.teleport.terminal.v1.LoginRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional LocalParams local = 2; + * @return {?proto.teleport.terminal.v1.LoginRequest.LocalParams} + */ +proto.teleport.terminal.v1.LoginRequest.prototype.getLocal = function() { + return /** @type{?proto.teleport.terminal.v1.LoginRequest.LocalParams} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.LoginRequest.LocalParams, 2)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.LoginRequest.LocalParams|undefined} value + * @return {!proto.teleport.terminal.v1.LoginRequest} returns this +*/ +proto.teleport.terminal.v1.LoginRequest.prototype.setLocal = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.LoginRequest} returns this + */ +proto.teleport.terminal.v1.LoginRequest.prototype.clearLocal = function() { + return this.setLocal(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.LoginRequest.prototype.hasLocal = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SsoParams sso = 3; + * @return {?proto.teleport.terminal.v1.LoginRequest.SsoParams} + */ +proto.teleport.terminal.v1.LoginRequest.prototype.getSso = function() { + return /** @type{?proto.teleport.terminal.v1.LoginRequest.SsoParams} */ ( + jspb.Message.getWrapperField(this, proto.teleport.terminal.v1.LoginRequest.SsoParams, 3)); +}; + + +/** + * @param {?proto.teleport.terminal.v1.LoginRequest.SsoParams|undefined} value + * @return {!proto.teleport.terminal.v1.LoginRequest} returns this +*/ +proto.teleport.terminal.v1.LoginRequest.prototype.setSso = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.teleport.terminal.v1.LoginRequest} returns this + */ +proto.teleport.terminal.v1.LoginRequest.prototype.clearSso = function() { + return this.setSso(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.teleport.terminal.v1.LoginRequest.prototype.hasSso = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +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.AddClusterRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.AddClusterRequest.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.AddClusterRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.AddClusterRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.AddClusterRequest} + */ +proto.teleport.terminal.v1.AddClusterRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.AddClusterRequest; + return proto.teleport.terminal.v1.AddClusterRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.AddClusterRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.AddClusterRequest} + */ +proto.teleport.terminal.v1.AddClusterRequest.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.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.AddClusterRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.AddClusterRequest.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.AddClusterRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.AddClusterRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.teleport.terminal.v1.AddClusterRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.AddClusterRequest} returns this + */ +proto.teleport.terminal.v1.AddClusterRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.ListKubesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListKubesRequest.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.ListKubesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListKubesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.ListKubesRequest} + */ +proto.teleport.terminal.v1.ListKubesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListKubesRequest; + return proto.teleport.terminal.v1.ListKubesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListKubesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListKubesRequest} + */ +proto.teleport.terminal.v1.ListKubesRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListKubesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListKubesRequest.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.ListKubesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListKubesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.ListKubesRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.ListKubesRequest} returns this + */ +proto.teleport.terminal.v1.ListKubesRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.ListAppsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListAppsRequest.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.ListAppsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListAppsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.ListAppsRequest} + */ +proto.teleport.terminal.v1.ListAppsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListAppsRequest; + return proto.teleport.terminal.v1.ListAppsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListAppsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListAppsRequest} + */ +proto.teleport.terminal.v1.ListAppsRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListAppsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListAppsRequest.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.ListAppsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListAppsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.ListAppsRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.ListAppsRequest} returns this + */ +proto.teleport.terminal.v1.ListAppsRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.ListClustersRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListClustersRequest.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.ListClustersRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListClustersRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + 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.ListClustersRequest} + */ +proto.teleport.terminal.v1.ListClustersRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListClustersRequest; + return proto.teleport.terminal.v1.ListClustersRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListClustersRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListClustersRequest} + */ +proto.teleport.terminal.v1.ListClustersRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListClustersRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListClustersRequest.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.ListClustersRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListClustersRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListClustersResponse.repeatedFields_ = [1]; + + + +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.ListClustersResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListClustersResponse.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.ListClustersResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListClustersResponse.toObject = function(includeInstance, msg) { + var f, obj = { + clustersList: jspb.Message.toObjectList(msg.getClustersList(), + v1_cluster_pb.Cluster.toObject, includeInstance) + }; + + 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.ListClustersResponse} + */ +proto.teleport.terminal.v1.ListClustersResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListClustersResponse; + return proto.teleport.terminal.v1.ListClustersResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListClustersResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListClustersResponse} + */ +proto.teleport.terminal.v1.ListClustersResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new v1_cluster_pb.Cluster; + reader.readMessage(value,v1_cluster_pb.Cluster.deserializeBinaryFromReader); + msg.addClusters(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListClustersResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListClustersResponse.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.ListClustersResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListClustersResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClustersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + v1_cluster_pb.Cluster.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Cluster clusters = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListClustersResponse.prototype.getClustersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_cluster_pb.Cluster, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListClustersResponse} returns this +*/ +proto.teleport.terminal.v1.ListClustersResponse.prototype.setClustersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Cluster=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Cluster} + */ +proto.teleport.terminal.v1.ListClustersResponse.prototype.addClusters = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.teleport.terminal.v1.Cluster, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListClustersResponse} returns this + */ +proto.teleport.terminal.v1.ListClustersResponse.prototype.clearClustersList = function() { + return this.setClustersList([]); +}; + + + + + +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.ListDatabasesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListDatabasesRequest.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.ListDatabasesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListDatabasesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.ListDatabasesRequest} + */ +proto.teleport.terminal.v1.ListDatabasesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListDatabasesRequest; + return proto.teleport.terminal.v1.ListDatabasesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListDatabasesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListDatabasesRequest} + */ +proto.teleport.terminal.v1.ListDatabasesRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListDatabasesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListDatabasesRequest.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.ListDatabasesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListDatabasesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.ListDatabasesRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.ListDatabasesRequest} returns this + */ +proto.teleport.terminal.v1.ListDatabasesRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.ListLeafClustersRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListLeafClustersRequest.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.ListLeafClustersRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.ListLeafClustersRequest} + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListLeafClustersRequest; + return proto.teleport.terminal.v1.ListLeafClustersRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListLeafClustersRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListLeafClustersRequest} + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListLeafClustersRequest.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.ListLeafClustersRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.ListLeafClustersRequest} returns this + */ +proto.teleport.terminal.v1.ListLeafClustersRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListDatabasesResponse.repeatedFields_ = [1]; + + + +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.ListDatabasesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListDatabasesResponse.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.ListDatabasesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListDatabasesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + databasesList: jspb.Message.toObjectList(msg.getDatabasesList(), + v1_database_pb.Database.toObject, includeInstance) + }; + + 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.ListDatabasesResponse} + */ +proto.teleport.terminal.v1.ListDatabasesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListDatabasesResponse; + return proto.teleport.terminal.v1.ListDatabasesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListDatabasesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListDatabasesResponse} + */ +proto.teleport.terminal.v1.ListDatabasesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new v1_database_pb.Database; + reader.readMessage(value,v1_database_pb.Database.deserializeBinaryFromReader); + msg.addDatabases(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListDatabasesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListDatabasesResponse.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.ListDatabasesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListDatabasesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDatabasesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + v1_database_pb.Database.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Database databases = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListDatabasesResponse.prototype.getDatabasesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_database_pb.Database, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListDatabasesResponse} returns this +*/ +proto.teleport.terminal.v1.ListDatabasesResponse.prototype.setDatabasesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Database=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Database} + */ +proto.teleport.terminal.v1.ListDatabasesResponse.prototype.addDatabases = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.teleport.terminal.v1.Database, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListDatabasesResponse} returns this + */ +proto.teleport.terminal.v1.ListDatabasesResponse.prototype.clearDatabasesList = function() { + return this.setDatabasesList([]); +}; + + + + + +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.CreateGatewayRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.CreateGatewayRequest.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.CreateGatewayRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.CreateGatewayRequest.toObject = function(includeInstance, msg) { + var f, obj = { + targetUri: jspb.Message.getFieldWithDefault(msg, 1, ""), + targetUser: jspb.Message.getFieldWithDefault(msg, 2, ""), + localPort: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + 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.CreateGatewayRequest} + */ +proto.teleport.terminal.v1.CreateGatewayRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.CreateGatewayRequest; + return proto.teleport.terminal.v1.CreateGatewayRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.CreateGatewayRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.CreateGatewayRequest} + */ +proto.teleport.terminal.v1.CreateGatewayRequest.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.setTargetUri(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setTargetUser(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setLocalPort(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.CreateGatewayRequest.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.CreateGatewayRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.CreateGatewayRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTargetUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTargetUser(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getLocalPort(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string target_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.getTargetUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.CreateGatewayRequest} returns this + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.setTargetUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string target_user = 2; + * @return {string} + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.getTargetUser = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.CreateGatewayRequest} returns this + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.setTargetUser = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string local_port = 3; + * @return {string} + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.getLocalPort = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.CreateGatewayRequest} returns this + */ +proto.teleport.terminal.v1.CreateGatewayRequest.prototype.setLocalPort = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListGatewaysRequest.repeatedFields_ = [1]; + + + +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.ListGatewaysRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListGatewaysRequest.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.ListGatewaysRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListGatewaysRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + 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.ListGatewaysRequest} + */ +proto.teleport.terminal.v1.ListGatewaysRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListGatewaysRequest; + return proto.teleport.terminal.v1.ListGatewaysRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListGatewaysRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListGatewaysRequest} + */ +proto.teleport.terminal.v1.ListGatewaysRequest.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.addClusterIds(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListGatewaysRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListGatewaysRequest.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.ListGatewaysRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListGatewaysRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterIdsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string cluster_ids = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListGatewaysRequest.prototype.getClusterIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListGatewaysRequest} returns this + */ +proto.teleport.terminal.v1.ListGatewaysRequest.prototype.setClusterIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.ListGatewaysRequest} returns this + */ +proto.teleport.terminal.v1.ListGatewaysRequest.prototype.addClusterIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListGatewaysRequest} returns this + */ +proto.teleport.terminal.v1.ListGatewaysRequest.prototype.clearClusterIdsList = function() { + return this.setClusterIdsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListGatewaysResponse.repeatedFields_ = [1]; + + + +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.ListGatewaysResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListGatewaysResponse.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.ListGatewaysResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListGatewaysResponse.toObject = function(includeInstance, msg) { + var f, obj = { + gatewaysList: jspb.Message.toObjectList(msg.getGatewaysList(), + v1_gateway_pb.Gateway.toObject, includeInstance) + }; + + 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.ListGatewaysResponse} + */ +proto.teleport.terminal.v1.ListGatewaysResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListGatewaysResponse; + return proto.teleport.terminal.v1.ListGatewaysResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListGatewaysResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListGatewaysResponse} + */ +proto.teleport.terminal.v1.ListGatewaysResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new v1_gateway_pb.Gateway; + reader.readMessage(value,v1_gateway_pb.Gateway.deserializeBinaryFromReader); + msg.addGateways(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListGatewaysResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListGatewaysResponse.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.ListGatewaysResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListGatewaysResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGatewaysList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + v1_gateway_pb.Gateway.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Gateway gateways = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListGatewaysResponse.prototype.getGatewaysList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_gateway_pb.Gateway, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListGatewaysResponse} returns this +*/ +proto.teleport.terminal.v1.ListGatewaysResponse.prototype.setGatewaysList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Gateway=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Gateway} + */ +proto.teleport.terminal.v1.ListGatewaysResponse.prototype.addGateways = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.teleport.terminal.v1.Gateway, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListGatewaysResponse} returns this + */ +proto.teleport.terminal.v1.ListGatewaysResponse.prototype.clearGatewaysList = function() { + return this.setGatewaysList([]); +}; + + + + + +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.RemoveGatewayRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.RemoveGatewayRequest.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.RemoveGatewayRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.toObject = function(includeInstance, msg) { + var f, obj = { + gatewayUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.RemoveGatewayRequest} + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.RemoveGatewayRequest; + return proto.teleport.terminal.v1.RemoveGatewayRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.RemoveGatewayRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.RemoveGatewayRequest} + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.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; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.RemoveGatewayRequest.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.RemoveGatewayRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGatewayUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string gateway_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.prototype.getGatewayUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.RemoveGatewayRequest} returns this + */ +proto.teleport.terminal.v1.RemoveGatewayRequest.prototype.setGatewayUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.ListServersRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListServersRequest.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.ListServersRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListServersRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.ListServersRequest} + */ +proto.teleport.terminal.v1.ListServersRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListServersRequest; + return proto.teleport.terminal.v1.ListServersRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListServersRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListServersRequest} + */ +proto.teleport.terminal.v1.ListServersRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListServersRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListServersRequest.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.ListServersRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListServersRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.ListServersRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.ListServersRequest} returns this + */ +proto.teleport.terminal.v1.ListServersRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListServersResponse.repeatedFields_ = [1]; + + + +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.ListServersResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListServersResponse.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.ListServersResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListServersResponse.toObject = function(includeInstance, msg) { + var f, obj = { + serversList: jspb.Message.toObjectList(msg.getServersList(), + v1_server_pb.Server.toObject, includeInstance) + }; + + 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.ListServersResponse} + */ +proto.teleport.terminal.v1.ListServersResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListServersResponse; + return proto.teleport.terminal.v1.ListServersResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListServersResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListServersResponse} + */ +proto.teleport.terminal.v1.ListServersResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new v1_server_pb.Server; + reader.readMessage(value,v1_server_pb.Server.deserializeBinaryFromReader); + msg.addServers(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListServersResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListServersResponse.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.ListServersResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListServersResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getServersList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + v1_server_pb.Server.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Server servers = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListServersResponse.prototype.getServersList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_server_pb.Server, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListServersResponse} returns this +*/ +proto.teleport.terminal.v1.ListServersResponse.prototype.setServersList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Server=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Server} + */ +proto.teleport.terminal.v1.ListServersResponse.prototype.addServers = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.teleport.terminal.v1.Server, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListServersResponse} returns this + */ +proto.teleport.terminal.v1.ListServersResponse.prototype.clearServersList = function() { + return this.setServersList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListKubesResponse.repeatedFields_ = [1]; + + + +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.ListKubesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListKubesResponse.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.ListKubesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListKubesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + kubesList: jspb.Message.toObjectList(msg.getKubesList(), + v1_kube_pb.Kube.toObject, includeInstance) + }; + + 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.ListKubesResponse} + */ +proto.teleport.terminal.v1.ListKubesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListKubesResponse; + return proto.teleport.terminal.v1.ListKubesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListKubesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListKubesResponse} + */ +proto.teleport.terminal.v1.ListKubesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new v1_kube_pb.Kube; + reader.readMessage(value,v1_kube_pb.Kube.deserializeBinaryFromReader); + msg.addKubes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListKubesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListKubesResponse.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.ListKubesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListKubesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKubesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + v1_kube_pb.Kube.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Kube kubes = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListKubesResponse.prototype.getKubesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_kube_pb.Kube, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListKubesResponse} returns this +*/ +proto.teleport.terminal.v1.ListKubesResponse.prototype.setKubesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.Kube=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.Kube} + */ +proto.teleport.terminal.v1.ListKubesResponse.prototype.addKubes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.teleport.terminal.v1.Kube, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListKubesResponse} returns this + */ +proto.teleport.terminal.v1.ListKubesResponse.prototype.clearKubesList = function() { + return this.setKubesList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.teleport.terminal.v1.ListAppsResponse.repeatedFields_ = [1]; + + + +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.ListAppsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.ListAppsResponse.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.ListAppsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListAppsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + appsList: jspb.Message.toObjectList(msg.getAppsList(), + v1_app_pb.App.toObject, includeInstance) + }; + + 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.ListAppsResponse} + */ +proto.teleport.terminal.v1.ListAppsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.ListAppsResponse; + return proto.teleport.terminal.v1.ListAppsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.ListAppsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.ListAppsResponse} + */ +proto.teleport.terminal.v1.ListAppsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new v1_app_pb.App; + reader.readMessage(value,v1_app_pb.App.deserializeBinaryFromReader); + msg.addApps(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.ListAppsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.ListAppsResponse.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.ListAppsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.ListAppsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAppsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + v1_app_pb.App.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated App apps = 1; + * @return {!Array} + */ +proto.teleport.terminal.v1.ListAppsResponse.prototype.getAppsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, v1_app_pb.App, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.teleport.terminal.v1.ListAppsResponse} returns this +*/ +proto.teleport.terminal.v1.ListAppsResponse.prototype.setAppsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.teleport.terminal.v1.App=} opt_value + * @param {number=} opt_index + * @return {!proto.teleport.terminal.v1.App} + */ +proto.teleport.terminal.v1.ListAppsResponse.prototype.addApps = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.teleport.terminal.v1.App, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.teleport.terminal.v1.ListAppsResponse} returns this + */ +proto.teleport.terminal.v1.ListAppsResponse.prototype.clearAppsList = function() { + return this.setAppsList([]); +}; + + + + + +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.GetAuthSettingsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.GetAuthSettingsRequest.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.GetAuthSettingsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + clusterUri: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + 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.GetAuthSettingsRequest} + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.GetAuthSettingsRequest; + return proto.teleport.terminal.v1.GetAuthSettingsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.GetAuthSettingsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.GetAuthSettingsRequest} + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.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.setClusterUri(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.GetAuthSettingsRequest.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.GetAuthSettingsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getClusterUri(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string cluster_uri = 1; + * @return {string} + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.prototype.getClusterUri = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.teleport.terminal.v1.GetAuthSettingsRequest} returns this + */ +proto.teleport.terminal.v1.GetAuthSettingsRequest.prototype.setClusterUri = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +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.EmptyResponse.prototype.toObject = function(opt_includeInstance) { + return proto.teleport.terminal.v1.EmptyResponse.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.EmptyResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.EmptyResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + 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.EmptyResponse} + */ +proto.teleport.terminal.v1.EmptyResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.teleport.terminal.v1.EmptyResponse; + return proto.teleport.terminal.v1.EmptyResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.teleport.terminal.v1.EmptyResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.teleport.terminal.v1.EmptyResponse} + */ +proto.teleport.terminal.v1.EmptyResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.teleport.terminal.v1.EmptyResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.teleport.terminal.v1.EmptyResponse.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.EmptyResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.teleport.terminal.v1.EmptyResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.teleport.terminal.v1); diff --git a/lib/teleterm/api/uri/uri.go b/lib/teleterm/api/uri/uri.go new file mode 100644 index 0000000000000..8c495a1640fbc --- /dev/null +++ b/lib/teleterm/api/uri/uri.go @@ -0,0 +1,132 @@ +/* +Copyright 2021 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 uri + +import ( + "fmt" + + "github.com/gravitational/trace" + "github.com/ucarion/urlpath" +) + +var pathClusters = urlpath.New("/clusters/:cluster/*") +var pathLeafClusters = urlpath.New("/clusters/:cluster/leaves/:leaf/*") + +// New creates an instance of ResourceURI +func New(path string) ResourceURI { + return ResourceURI{ + path: path, + } +} + +// NewClusterURI creates a new cluster URI for given cluster name +func NewClusterURI(clusterName string) ResourceURI { + return ResourceURI{ + path: fmt.Sprintf("/clusters/%v", clusterName), + } +} + +// ParseClusterURI parses a string and returns cluster URI +func ParseClusterURI(path string) (ResourceURI, error) { + URI := New(path) + rootClusterName := URI.GetRootClusterName() + leafClusterName := URI.GetLeafClusterName() + + if rootClusterName == "" { + return URI, trace.BadParameter("missing root cluster name") + } + + clusterURI := NewClusterURI(rootClusterName) + if leafClusterName != "" { + clusterURI = clusterURI.AppendLeafCluster(leafClusterName) + } + + return clusterURI, nil +} + +// NewGatewayURI creates a gateway URI for a given ID +func NewGatewayURI(id string) ResourceURI { + return ResourceURI{ + path: fmt.Sprintf("/gateways/%v", id), + } +} + +// ResourceURI describes resource URI +type ResourceURI struct { + path string +} + +// GetRootClusterName returns root cluster name +func (r ResourceURI) GetRootClusterName() string { + result, ok := pathClusters.Match(r.path + "/") + if !ok { + return "" + } + + return result.Params["cluster"] +} + +// GetLeafClusterName returns leaf cluster name +func (r ResourceURI) GetLeafClusterName() string { + result, ok := pathLeafClusters.Match(r.path + "/") + if !ok { + return "" + } + + return result.Params["leaf"] +} + +// AppendServer appends server segment to the URI +func (r ResourceURI) AppendServer(id string) ResourceURI { + r.path = fmt.Sprintf("%v/servers/%v", r.path, id) + return r +} + +// AppendLeafCluster appends leaf cluster segment to the URI +func (r ResourceURI) AppendLeafCluster(name string) ResourceURI { + r.path = fmt.Sprintf("%v/leaves/%v", r.path, name) + return r +} + +// AppendKube appends kube segment to the URI +func (r ResourceURI) AppendKube(name string) ResourceURI { + r.path = fmt.Sprintf("%v/kubes/%v", r.path, name) + return r +} + +// AppendDB appends database segment to the URI +func (r ResourceURI) AppendDB(name string) ResourceURI { + r.path = fmt.Sprintf("%v/dbs/%v", r.path, name) + return r +} + +// AddGateway appends gateway segment to the URI +func (r ResourceURI) AddGateway(id string) ResourceURI { + r.path = fmt.Sprintf("%v/gateways/%v", r.path, id) + return r +} + +// AppendApp appends app segment to the URI +func (r ResourceURI) AppendApp(name string) ResourceURI { + r.path = fmt.Sprintf("%v/apps/%v", r.path, name) + return r +} + +// String returns string representation of the Resource URI +func (r ResourceURI) String() string { + return r.path +} diff --git a/lib/teleterm/api/uri/uri_test.go b/lib/teleterm/api/uri/uri_test.go new file mode 100644 index 0000000000000..253c475b8c66a --- /dev/null +++ b/lib/teleterm/api/uri/uri_test.go @@ -0,0 +1,54 @@ +/* +Copyright 2021 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 uri_test + +import ( + "fmt" + "reflect" + "testing" + + "github.com/gravitational/teleport/lib/teleterm/api/uri" +) + +func TestURI(t *testing.T) { + testCases := []struct { + in uri.ResourceURI + out string + }{ + { + uri.NewClusterURI("teleport.sh").AppendServer("server1"), + "/clusters/teleport.sh/servers/server1", + }, + { + uri.NewClusterURI("teleport.sh").AppendApp("app1"), + "/clusters/teleport.sh/apps/app1", + }, + { + uri.NewClusterURI("teleport.sh").AppendDB("dbhost1"), + "/clusters/teleport.sh/dbs/dbhost1", + }, + } + + for _, tt := range testCases { + t.Run(fmt.Sprintf("%v", tt.in), func(t *testing.T) { + out := tt.in.String() + if !reflect.DeepEqual(out, tt.out) { + t.Errorf("out %#v, want %#v", out, tt.out) + } + }) + } +} diff --git a/lib/teleterm/apiserver/apiserver.go b/lib/teleterm/apiserver/apiserver.go new file mode 100644 index 0000000000000..414390596ca7e --- /dev/null +++ b/lib/teleterm/apiserver/apiserver.go @@ -0,0 +1,94 @@ +// Copyright 2021 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 apiserver + +import ( + "net" + "net/url" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/apiserver/handler" + + "github.com/gravitational/trace" + + "google.golang.org/grpc" +) + +// New creates an instance of API Server +func New(cfg Config) (*APIServer, error) { + if err := cfg.CheckAndSetDefaults(); err != nil { + return nil, trace.Wrap(err) + } + + serviceHandler, err := handler.New( + handler.Config{ + DaemonService: cfg.Daemon, + }, + ) + if err != nil { + return nil, trace.Wrap(err) + } + + ls, err := newListener(cfg.HostAddr) + if err != nil { + return nil, trace.Wrap(err) + } + + grpcServer := grpc.NewServer(grpc.Creds(nil), grpc.ChainUnaryInterceptor( + withErrorHandling(cfg.Log), + )) + + api.RegisterTerminalServiceServer(grpcServer, serviceHandler) + + return &APIServer{cfg, ls, grpcServer}, nil +} + +// Serve starts accepting incoming connections +func (s *APIServer) Serve() error { + return s.grpcServer.Serve(s.ls) +} + +// Stop stops the server and closes all listeners +func (s *APIServer) Stop() { + s.grpcServer.GracefulStop() +} + +func newListener(hostAddr string) (net.Listener, error) { + uri, err := url.Parse(hostAddr) + + if err != nil { + return nil, trace.BadParameter("invalid host address: %s", hostAddr) + } + + if uri.Scheme != "unix" { + return nil, trace.BadParameter("invalid unix socket address: %s", hostAddr) + } + + lis, err := net.Listen(uri.Scheme, uri.Path) + if err != nil { + return nil, trace.Wrap(err) + } + + return lis, nil +} + +// Server is a combination of the underlying grpc.Server and its RuntimeOpts. +type APIServer struct { + Config + // ls is the server listener + ls net.Listener + // grpc is an instance of grpc server + grpcServer *grpc.Server +} diff --git a/lib/teleterm/apiserver/config.go b/lib/teleterm/apiserver/config.go new file mode 100644 index 0000000000000..5671d2eed9670 --- /dev/null +++ b/lib/teleterm/apiserver/config.go @@ -0,0 +1,50 @@ +// Copyright 2021 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 apiserver + +import ( + "github.com/gravitational/teleport/lib/teleterm/daemon" + + "github.com/gravitational/trace" + + "github.com/sirupsen/logrus" +) + +// Config is the APIServer configuration +type Config struct { + // HostAddr is the APIServer host address + HostAddr string + // Daemon is the terminal daemon service + Daemon *daemon.Service + // Log is a component logger + Log logrus.FieldLogger +} + +// CheckAndSetDefaults checks and sets default config values. +func (c *Config) CheckAndSetDefaults() error { + if c.HostAddr == "" { + return trace.BadParameter("missing HostAddr") + } + + if c.Daemon == nil { + return trace.BadParameter("missing daemon service") + } + + if c.Log == nil { + c.Log = logrus.WithField(trace.Component, "teleterm: api_server") + } + + return nil +} diff --git a/lib/teleterm/apiserver/handler/handler.go b/lib/teleterm/apiserver/handler/handler.go new file mode 100644 index 0000000000000..722008bf8f0f2 --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler.go @@ -0,0 +1,69 @@ +// Copyright 2021 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 handler + +import ( + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/daemon" + + "github.com/gravitational/trace" +) + +// New creates an instance of Handler +func New(cfg Config) (*Handler, error) { + if err := cfg.CheckAndSetDefaults(); err != nil { + return nil, trace.Wrap(err) + } + + return &Handler{ + cfg, + }, nil +} + +// Config is the terminal service configuration +type Config struct { + // DaemonService is the instance of daemon service + DaemonService *daemon.Service +} + +// CheckAndSetDefaults checks and sets the defaults +func (c *Config) CheckAndSetDefaults() error { + if c.DaemonService == nil { + return trace.BadParameter("missing DaemonService") + } + + return nil +} + +// Handler implements teleterm api service +type Handler struct { + // Config is the service config + Config +} + +// sortedLabels is a sort wrapper that sorts labels by name +type APILabels []*api.Label + +func (s APILabels) Len() int { + return len(s) +} + +func (s APILabels) Less(i, j int) bool { + return s[i].Name < s[j].Name +} + +func (s APILabels) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} diff --git a/lib/teleterm/apiserver/handler/handler_apps.go b/lib/teleterm/apiserver/handler/handler_apps.go new file mode 100644 index 0000000000000..fbc13d616b61d --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_apps.go @@ -0,0 +1,61 @@ +// Copyright 2021 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 handler + +import ( + "context" + "sort" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/clusters" + + "github.com/gravitational/trace" +) + +// ListApps lists cluster applications +func (s *Handler) ListApps(ctx context.Context, req *api.ListAppsRequest) (*api.ListAppsResponse, error) { + apps, err := s.DaemonService.ListApps(ctx, req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + response := &api.ListAppsResponse{} + for _, app := range apps { + response.Apps = append(response.Apps, newAPIApp(app)) + } + + return response, nil +} + +func newAPIApp(app clusters.App) *api.App { + apiLabels := APILabels{} + for name, value := range app.GetAllLabels() { + apiLabels = append(apiLabels, &api.Label{ + Name: name, + Value: value, + }) + } + sort.Sort(apiLabels) + + return &api.App{ + Uri: app.URI.String(), + Name: app.GetName(), + Labels: apiLabels, + Description: app.GetDescription(), + AppUri: app.GetURI(), + PublicAddr: app.GetPublicAddr(), + AwsConsole: app.IsAWSConsole(), + } +} diff --git a/lib/teleterm/apiserver/handler/handler_auth.go b/lib/teleterm/apiserver/handler/handler_auth.go new file mode 100644 index 0000000000000..6baff1f7c758a --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_auth.go @@ -0,0 +1,88 @@ +// Copyright 2021 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 handler + +import ( + "context" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + + "github.com/gravitational/trace" +) + +// Login logs in a user to a cluster +func (s *Handler) Login(ctx context.Context, req *api.LoginRequest) (*api.EmptyResponse, error) { + cluster, err := s.DaemonService.ResolveCluster(req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + if req.Local != nil { + if err := cluster.LocalLogin(ctx, req.Local.User, req.Local.Password, req.Local.Token); err != nil { + return nil, trace.Wrap(err) + } + + return &api.EmptyResponse{}, nil + } + + if req.Sso != nil { + if err := cluster.SSOLogin(ctx, req.Sso.ProviderType, req.Sso.ProviderName); err != nil { + return nil, trace.Wrap(err) + } + + return &api.EmptyResponse{}, nil + } + + return nil, trace.BadParameter("missing login parameters") +} + +// Logout logs a user out from a cluster +func (s *Handler) Logout(ctx context.Context, req *api.LogoutRequest) (*api.EmptyResponse, error) { + if err := s.DaemonService.ClusterLogout(ctx, req.ClusterUri); err != nil { + return nil, trace.Wrap(err) + } + + return &api.EmptyResponse{}, nil +} + +// GetAuthSettings returns cluster auth preferences +func (s *Handler) GetAuthSettings(ctx context.Context, req *api.GetAuthSettingsRequest) (*api.AuthSettings, error) { + cluster, err := s.DaemonService.ResolveCluster(req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + preferences, err := cluster.SyncAuthPreference(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + result := &api.AuthSettings{ + PreferredMfa: string(preferences.PreferredLocalMFA), + SecondFactor: string(preferences.SecondFactor), + LocalAuthEnabled: preferences.LocalAuthEnabled, + AuthProviders: []*api.AuthProvider{}, + } + + for _, provider := range preferences.Providers { + result.AuthProviders = append(result.AuthProviders, &api.AuthProvider{ + Type: provider.Type, + Name: provider.Name, + DisplayName: provider.DisplayName, + }) + } + + return result, nil +} diff --git a/lib/teleterm/apiserver/handler/handler_clusters.go b/lib/teleterm/apiserver/handler/handler_clusters.go new file mode 100644 index 0000000000000..179d55ec58192 --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_clusters.go @@ -0,0 +1,113 @@ +// Copyright 2021 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 handler + +import ( + "context" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/clusters" + + "github.com/gravitational/trace" +) + +// ListRootClusters lists root clusters +func (s *Handler) ListRootClusters(ctx context.Context, r *api.ListClustersRequest) (*api.ListClustersResponse, error) { + clusters, err := s.DaemonService.ListRootClusters(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + result := []*api.Cluster{} + for _, cluster := range clusters { + result = append(result, newAPIRootCluster(cluster)) + } + + return &api.ListClustersResponse{ + Clusters: result, + }, nil +} + +// ListLeafClusters lists leaf clusters +func (s *Handler) ListLeafClusters(ctx context.Context, req *api.ListLeafClustersRequest) (*api.ListClustersResponse, error) { + leaves, err := s.DaemonService.ListLeafClusters(ctx, req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + response := &api.ListClustersResponse{} + for _, leaf := range leaves { + response.Clusters = append(response.Clusters, newAPILeafCluster(leaf)) + } + + return response, nil +} + +// AddCluster creates a new cluster +func (s *Handler) AddCluster(ctx context.Context, req *api.AddClusterRequest) (*api.Cluster, error) { + cluster, err := s.DaemonService.AddCluster(ctx, req.Name) + if err != nil { + return nil, trace.Wrap(err) + } + + return newAPIRootCluster(cluster), nil +} + +// RemoveCluster removes a cluster from local system +func (s *Handler) RemoveCluster(ctx context.Context, req *api.RemoveClusterRequest) (*api.EmptyResponse, error) { + if err := s.DaemonService.RemoveCluster(ctx, req.ClusterUri); err != nil { + return nil, trace.Wrap(err) + } + + return &api.EmptyResponse{}, nil +} + +// GetCluster returns a cluster +func (s *Handler) GetCluster(ctx context.Context, req *api.GetClusterRequest) (*api.Cluster, error) { + cluster, err := s.DaemonService.ResolveCluster(req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + return newAPIRootCluster(cluster), nil +} + +func newAPIRootCluster(cluster *clusters.Cluster) *api.Cluster { + loggedInUser := cluster.GetLoggedInUser() + return &api.Cluster{ + Uri: cluster.URI.String(), + Name: cluster.Name, + Connected: cluster.Connected(), + LoggedInUser: &api.LoggedInUser{ + Name: loggedInUser.Name, + SshLogins: loggedInUser.SSHLogins, + Roles: loggedInUser.Roles, + }, + } +} + +func newAPILeafCluster(leaf clusters.LeafCluster) *api.Cluster { + return &api.Cluster{ + Name: leaf.Name, + Uri: leaf.URI.String(), + Connected: leaf.Connected, + Leaf: true, + LoggedInUser: &api.LoggedInUser{ + Name: leaf.LoggedInUser.Name, + SshLogins: leaf.LoggedInUser.SSHLogins, + Roles: leaf.LoggedInUser.Roles, + }, + } +} diff --git a/lib/teleterm/apiserver/handler/handler_databases.go b/lib/teleterm/apiserver/handler/handler_databases.go new file mode 100644 index 0000000000000..e89d9a0bfa0b1 --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_databases.go @@ -0,0 +1,66 @@ +// Copyright 2021 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 handler + +import ( + "context" + "sort" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/clusters" + + "github.com/gravitational/trace" +) + +// ListDatabases lists databases +func (s *Handler) ListDatabases(ctx context.Context, req *api.ListDatabasesRequest) (*api.ListDatabasesResponse, error) { + cluster, err := s.DaemonService.ResolveCluster(req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + dbs, err := cluster.GetDatabases(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + response := &api.ListDatabasesResponse{} + for _, db := range dbs { + response.Databases = append(response.Databases, newAPIDatabase(db)) + } + + return response, nil +} + +func newAPIDatabase(db clusters.Database) *api.Database { + apiLabels := APILabels{} + for name, value := range db.GetAllLabels() { + apiLabels = append(apiLabels, &api.Label{ + Name: name, + Value: value, + }) + } + + sort.Sort(apiLabels) + + return &api.Database{ + Uri: db.URI.String(), + Name: db.GetName(), + Desc: db.GetDescription(), + Protocol: db.GetProtocol(), + Type: db.GetType(), + Labels: apiLabels, + } +} diff --git a/lib/teleterm/apiserver/handler/handler_gateways.go b/lib/teleterm/apiserver/handler/handler_gateways.go new file mode 100644 index 0000000000000..4741cd3fbd9ad --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_gateways.go @@ -0,0 +1,83 @@ +// Copyright 2021 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 handler + +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/gateway" + + "github.com/gravitational/trace" +) + +// CreateGateway creates a gateway +func (s *Handler) CreateGateway(ctx context.Context, req *api.CreateGatewayRequest) (*api.Gateway, error) { + params := clusters.CreateGatewayParams{ + TargetURI: req.TargetUri, + TargetUser: req.TargetUser, + LocalPort: req.LocalPort, + } + + gateway, err := s.DaemonService.CreateGateway(ctx, params) + if err != nil { + return nil, trace.Wrap(err) + } + + return newAPIGateway(gateway), nil +} + +// ListGateways lists all gateways +func (s *Handler) ListGateways(ctx context.Context, req *api.ListGatewaysRequest) (*api.ListGatewaysResponse, error) { + gws, err := s.DaemonService.ListGateways(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + apiGws := []*api.Gateway{} + for _, gw := range gws { + apiGws = append(apiGws, newAPIGateway(gw)) + } + + return &api.ListGatewaysResponse{ + Gateways: apiGws, + }, nil +} + +// RemoveGateway removes cluster gateway +func (s *Handler) RemoveGateway(ctx context.Context, req *api.RemoveGatewayRequest) (*api.EmptyResponse, error) { + if err := s.DaemonService.RemoveGateway(ctx, req.GatewayUri); err != nil { + return nil, trace.Wrap(err) + } + + return &api.EmptyResponse{}, nil +} + +func newAPIGateway(gateway *gateway.Gateway) *api.Gateway { + return &api.Gateway{ + Uri: gateway.URI.String(), + TargetUri: gateway.TargetURI, + TargetName: gateway.TargetName, + TargetUser: gateway.TargetUser, + Protocol: gateway.Protocol, + LocalAddress: gateway.LocalAddress, + LocalPort: gateway.LocalPort, + CaCertPath: gateway.CACertPath, + CertPath: gateway.CertPath, + KeyPath: gateway.KeyPath, + Insecure: gateway.Insecure, + } +} diff --git a/lib/teleterm/apiserver/handler/handler_kubes.go b/lib/teleterm/apiserver/handler/handler_kubes.go new file mode 100644 index 0000000000000..320cf5f841102 --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_kubes.go @@ -0,0 +1,65 @@ +// Copyright 2021 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 handler + +import ( + "context" + "sort" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/clusters" + + "github.com/gravitational/trace" +) + +// ListKubes lists kubernetes clusters +func (s *Handler) ListKubes(ctx context.Context, req *api.ListKubesRequest) (*api.ListKubesResponse, error) { + kubes, err := s.DaemonService.ListKubes(ctx, req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + response := &api.ListKubesResponse{} + for _, k := range kubes { + response.Kubes = append(response.Kubes, newAPIKube(k)) + } + + return response, nil +} + +func newAPIKube(kube clusters.Kube) *api.Kube { + apiLabels := APILabels{} + for name, value := range kube.StaticLabels { + apiLabels = append(apiLabels, &api.Label{ + Name: name, + Value: value, + }) + } + + for name, cmd := range kube.DynamicLabels { + apiLabels = append(apiLabels, &api.Label{ + Name: name, + Value: cmd.GetResult(), + }) + } + + sort.Sort(apiLabels) + + return &api.Kube{ + Name: kube.Name, + Uri: kube.URI.String(), + Labels: apiLabels, + } +} diff --git a/lib/teleterm/apiserver/handler/handler_servers.go b/lib/teleterm/apiserver/handler/handler_servers.go new file mode 100644 index 0000000000000..3a883c010dab6 --- /dev/null +++ b/lib/teleterm/apiserver/handler/handler_servers.go @@ -0,0 +1,70 @@ +// Copyright 2021 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 handler + +import ( + "context" + "sort" + + api "github.com/gravitational/teleport/lib/teleterm/api/protogen/golang/v1" + "github.com/gravitational/teleport/lib/teleterm/clusters" + + "github.com/gravitational/trace" +) + +// ListServers lists servers +func (s *Handler) ListServers(ctx context.Context, req *api.ListServersRequest) (*api.ListServersResponse, error) { + servers, err := s.DaemonService.ListServers(ctx, req.ClusterUri) + if err != nil { + return nil, trace.Wrap(err) + } + + response := &api.ListServersResponse{} + for _, srv := range servers { + response.Servers = append(response.Servers, newAPIServer(srv)) + } + + return response, nil +} + +func newAPIServer(server clusters.Server) *api.Server { + apiLabels := APILabels{} + serverLabels := server.GetLabels() + for name, value := range serverLabels { + apiLabels = append(apiLabels, &api.Label{ + Name: name, + Value: value, + }) + } + + serverCmdLabels := server.GetCmdLabels() + for name, cmd := range serverCmdLabels { + apiLabels = append(apiLabels, &api.Label{ + Name: name, + Value: cmd.GetResult(), + }) + } + + sort.Sort(apiLabels) + + return &api.Server{ + Uri: server.URI.String(), + Tunnel: server.GetUseTunnel(), + Name: server.GetName(), + Hostname: server.GetHostname(), + Addr: server.GetAddr(), + Labels: apiLabels, + } +} diff --git a/lib/teleterm/apiserver/middleware.go b/lib/teleterm/apiserver/middleware.go new file mode 100644 index 0000000000000..44a22a937f060 --- /dev/null +++ b/lib/teleterm/apiserver/middleware.go @@ -0,0 +1,49 @@ +/* +Copyright 2021 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 apiserver + +import ( + "context" + + "github.com/gravitational/trace" + "github.com/gravitational/trace/trail" + + "github.com/sirupsen/logrus" + "google.golang.org/grpc" +) + +// withErrorHandling is GRPC middleware that maps internal errors to proper GRPC error codes +func withErrorHandling(log logrus.FieldLogger) grpc.UnaryServerInterceptor { + return func( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, + ) (interface{}, error) { + resp, err := handler(ctx, req) + if err != nil { + log.WithError(err).Error("Request failed.") + // do not return a full error stack on access denied errors + if trace.IsAccessDenied(err) { + return resp, trail.ToGRPC(trace.AccessDenied("access denied")) + } + return resp, trail.ToGRPC(err) + } + + return resp, nil + } +} diff --git a/lib/teleterm/buf.gen.yaml b/lib/teleterm/buf.gen.yaml new file mode 100644 index 0000000000000..450b3c714ed07 --- /dev/null +++ b/lib/teleterm/buf.gen.yaml @@ -0,0 +1,26 @@ +version: v1 +plugins: + # Generated using an old version of protoc-gen-go - we can't use the latest + # plugins because Teleport itself depends on an old google.golang.org/grpc + # version. + # protoc itself may be the latest one. + # $ go install github.com/golang/protobuf/protoc-gen-go@v1.4.3 + - name: go + out: api/protogen/golang + opt: + - plugins=grpc + - paths=source_relative + + - name: js + out: api/protogen/js + opt: + - import_style=commonjs,binary + + - name: grpc + out: api/protogen/js + opt: grpc_js + path: grpc_tools_node_protoc_plugin + + - name: ts + out: api/protogen/js + opt: "service=grpc-node" \ No newline at end of file diff --git a/lib/teleterm/buf.work.yaml b/lib/teleterm/buf.work.yaml new file mode 100644 index 0000000000000..f8db8020d6919 --- /dev/null +++ b/lib/teleterm/buf.work.yaml @@ -0,0 +1,3 @@ +version: v1 +directories: + - api/proto diff --git a/lib/teleterm/clusters/cluster.go b/lib/teleterm/clusters/cluster.go new file mode 100644 index 0000000000000..e084ce4284949 --- /dev/null +++ b/lib/teleterm/clusters/cluster.go @@ -0,0 +1,93 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" + + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" +) + +// Cluster describes user settings and access to various resources. +type Cluster struct { + // URI is the cluster URI + URI uri.ResourceURI + // Name is the cluster name + Name string + + // Log is a component logger + Log logrus.FieldLogger + // dir is the directory where cluster certificates are stored + dir string + // Status is the cluster status + status client.ProfileStatus + // client is the cluster Teleport client + clusterClient *client.TeleportClient + // clock is a clock for time-related operations + clock clockwork.Clock +} + +// Connected indicates if connection to the cluster can be established +func (c *Cluster) Connected() bool { + return c.status.Name != "" && !c.status.IsExpired(c.clock) +} + +// GetRoles returns currently logged-in user roles +func (c *Cluster) GetRoles(ctx context.Context) ([]*types.Role, error) { + proxyClient, err := c.clusterClient.ConnectToProxy(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + defer proxyClient.Close() + + roles := []*types.Role{} + for _, name := range c.status.Roles { + role, err := proxyClient.GetRole(ctx, name) + if err != nil { + return nil, trace.Wrap(err) + } + roles = append(roles, &role) + } + + return roles, nil +} + +// GetLoggedInUser returns currently logged-in user +func (c *Cluster) GetLoggedInUser() LoggedInUser { + return LoggedInUser{ + Name: c.status.Username, + SSHLogins: c.status.Logins, + Roles: c.status.Roles, + } +} + +// LoggedInUser is the currently logged-in user +type LoggedInUser struct { + // Name is the user name + Name string + // SSHLogins is the user sshlogins + SSHLogins []string + // Roles is the user roles + Roles []string +} diff --git a/lib/teleterm/clusters/cluster_apps.go b/lib/teleterm/clusters/cluster_apps.go new file mode 100644 index 0000000000000..78fa4c7e19745 --- /dev/null +++ b/lib/teleterm/clusters/cluster_apps.go @@ -0,0 +1,57 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" +) + +// App describes an app +type App struct { + // URI is the app URI + URI uri.ResourceURI + + types.Application +} + +// GetApps returns apps +func (c *Cluster) GetApps(ctx context.Context) ([]App, error) { + // Get a list of all applications. + apps, err := c.clusterClient.ListApps(ctx, &proto.ListResourcesRequest{ + Namespace: defaults.Namespace, + }) + if err != nil { + return nil, trace.Wrap(err) + } + + results := []App{} + for _, app := range apps { + results = append(results, App{ + URI: c.URI.AppendApp(app.GetName()), + Application: app, + }) + } + + return results, nil +} diff --git a/lib/teleterm/clusters/cluster_auth.go b/lib/teleterm/clusters/cluster_auth.go new file mode 100644 index 0000000000000..59e9355088037 --- /dev/null +++ b/lib/teleterm/clusters/cluster_auth.go @@ -0,0 +1,258 @@ +/* +Copyright 2021 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 ( + "context" + "fmt" + + "github.com/gravitational/teleport/api/constants" + "github.com/gravitational/teleport/lib/auth" + "github.com/gravitational/teleport/lib/client" + dbprofile "github.com/gravitational/teleport/lib/client/db" + "github.com/gravitational/teleport/lib/kube/kubeconfig" + web "github.com/gravitational/teleport/lib/web/ui" + + "github.com/gravitational/trace" +) + +// SyncAuthPreference fetches Teleport auth preferences and stores it in the cluster profile +func (c *Cluster) SyncAuthPreference(ctx context.Context) (*web.WebConfigAuthSettings, error) { + _, err := c.clusterClient.Ping(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + if err := c.clusterClient.SaveProfile(c.dir, false); err != nil { + return nil, trace.Wrap(err) + } + + cfg, err := c.clusterClient.GetWebConfig(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + return &cfg.Auth, nil +} + +// Logout deletes all cluster certificates +func (c *Cluster) Logout(ctx context.Context) error { + // Delete db certs + for _, db := range c.status.Databases { + err := dbprofile.Delete(c.clusterClient, db) + if err != nil { + return trace.Wrap(err) + } + } + + // Get the address of the active Kubernetes proxy to find AuthInfos, + // Clusters, and Contexts in kubeconfig. + clusterName, _ := c.clusterClient.KubeProxyHostPort() + if c.clusterClient.SiteName != "" { + clusterName = fmt.Sprintf("%v.%v", c.clusterClient.SiteName, clusterName) + } + + // Remove cluster entries from kubeconfig + if err := kubeconfig.Remove("", clusterName); err != nil { + return trace.Wrap(err) + } + + // Remove keys for this user from disk and running agent. + if err := c.clusterClient.Logout(); !trace.IsNotFound(err) { + return trace.Wrap(err) + } + + return nil +} + +// LocalLogin processes local logins for this cluster +func (c *Cluster) LocalLogin(ctx context.Context, user, password, otpToken string) error { + pingResp, err := c.clusterClient.Ping(ctx) + if err != nil { + return trace.Wrap(err) + } + + // TODO(alex-kovoy): SiteName needs to be reset if trying to login to a cluster with + // existing profile for the first time (investigate why) + c.clusterClient.SiteName = "" + + switch pingResp.Auth.SecondFactor { + case constants.SecondFactorOff, constants.SecondFactorOTP: + err := c.localLogin(ctx, user, password, otpToken) + if err != nil { + return trace.Wrap(err) + } + case constants.SecondFactorU2F, constants.SecondFactorWebauthn, constants.SecondFactorOn, constants.SecondFactorOptional: + err := c.localMFALogin(ctx, user, password) + if err != nil { + return trace.Wrap(err) + } + default: + return trace.BadParameter("unsupported second factor type: %q", pingResp.Auth.SecondFactor) + } + + return nil +} + +// SSOLogin logs in a user to the Teleport cluster using supported SSO provider +func (c *Cluster) SSOLogin(ctx context.Context, providerType, providerName string) error { + if _, err := c.clusterClient.Ping(ctx); err != nil { + return trace.Wrap(err) + } + + key, err := client.NewKey() + if err != nil { + return trace.Wrap(err) + } + + // TODO(alex-kovoy): SiteName needs to be reset if trying to login to a cluster with + // existing profile for the first time (investigate why) + c.clusterClient.SiteName = "" + + response, err := client.SSHAgentSSOLogin(ctx, client.SSHLoginSSO{ + SSHLogin: client.SSHLogin{ + ProxyAddr: c.clusterClient.WebProxyAddr, + PubKey: key.Pub, + TTL: c.clusterClient.KeyTTL, + Insecure: c.clusterClient.InsecureSkipVerify, + Compatibility: c.clusterClient.CertificateFormat, + KubernetesCluster: c.clusterClient.KubernetesCluster, + }, + ConnectorID: providerName, + Protocol: providerType, + BindAddr: c.clusterClient.BindAddr, + Browser: c.clusterClient.Browser, + }) + if err != nil { + return trace.Wrap(err) + } + + if err := c.processAuthResponse(ctx, key, response); err != nil { + return trace.Wrap(err) + } + + return nil +} + +func (c *Cluster) localMFALogin(ctx context.Context, user, password string) error { + key, err := client.NewKey() + if err != nil { + return trace.Wrap(err) + } + + response, err := client.SSHAgentMFALogin(ctx, client.SSHLoginMFA{ + SSHLogin: client.SSHLogin{ + ProxyAddr: c.clusterClient.WebProxyAddr, + PubKey: key.Pub, + TTL: c.clusterClient.KeyTTL, + Insecure: c.clusterClient.InsecureSkipVerify, + Compatibility: c.clusterClient.CertificateFormat, + RouteToCluster: c.clusterClient.SiteName, + KubernetesCluster: c.clusterClient.KubernetesCluster, + }, + User: user, + Password: password, + }) + if err != nil { + return trace.Wrap(err) + } + + if err := c.processAuthResponse(ctx, key, response); err != nil { + return trace.Wrap(err) + } + + return err +} + +func (c *Cluster) localLogin(ctx context.Context, user, password, otpToken string) error { + key, err := client.NewKey() + if err != nil { + return trace.Wrap(err) + } + + response, err := client.SSHAgentLogin(ctx, client.SSHLoginDirect{ + SSHLogin: client.SSHLogin{ + ProxyAddr: c.clusterClient.WebProxyAddr, + PubKey: key.Pub, + TTL: c.clusterClient.KeyTTL, + Insecure: c.clusterClient.InsecureSkipVerify, + Compatibility: c.clusterClient.CertificateFormat, + KubernetesCluster: c.clusterClient.KubernetesCluster, + }, + User: user, + Password: password, + OTPToken: otpToken, + }) + if err != nil { + return trace.Wrap(err) + } + + if err := c.processAuthResponse(ctx, key, response); err != nil { + return trace.Wrap(err) + } + + return nil +} + +func (c *Cluster) processAuthResponse(ctx context.Context, key *client.Key, response *auth.SSHLoginResponse) error { + // Check that a host certificate for at least one cluster was returned. + if len(response.HostSigners) == 0 { + return trace.BadParameter("bad response from the server: expected at least one certificate, got 0") + } + + // extract the new certificate out of the response + key.Cert = response.Cert + key.TLSCert = response.TLSCert + key.TrustedCA = response.HostSigners + key.Username = response.Username + + if c.clusterClient.KubernetesCluster != "" { + key.KubeTLSCerts[c.clusterClient.KubernetesCluster] = response.TLSCert + } + if c.clusterClient.DatabaseService != "" { + key.DBTLSCerts[c.clusterClient.DatabaseService] = response.TLSCert + } + + // Store the requested cluster name in the key. + key.ClusterName = c.clusterClient.SiteName + if key.ClusterName == "" { + rootClusterName := key.TrustedCA[0].ClusterName + key.ClusterName = rootClusterName + c.clusterClient.SiteName = rootClusterName + } + + // Update username before updating the profile + c.clusterClient.LocalAgent().UpdateUsername(response.Username) + c.clusterClient.Username = response.Username + + if err := c.clusterClient.ActivateKey(ctx, key); err != nil { + return trace.Wrap(err) + } + + if err := c.clusterClient.SaveProfile(c.dir, true); err != nil { + return trace.Wrap(err) + } + + status, err := client.ReadProfileStatus(c.dir, key.ProxyHost) + if err != nil { + return trace.Wrap(err) + } + + c.status = *status + + return nil +} diff --git a/lib/teleterm/clusters/cluster_databases.go b/lib/teleterm/clusters/cluster_databases.go new file mode 100644 index 0000000000000..a7d52d64ae21e --- /dev/null +++ b/lib/teleterm/clusters/cluster_databases.go @@ -0,0 +1,116 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport/api/client/proto" + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/client" + dbprofile "github.com/gravitational/teleport/lib/client/db" + libdefaults "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + "github.com/gravitational/teleport/lib/tlsca" + + "github.com/gravitational/trace" +) + +// Database describes database +type Database struct { + // URI is the database URI + URI uri.ResourceURI + types.Database +} + +// GetDatabase returns a database +func (c *Cluster) GetDatabase(ctx context.Context, dbURI string) (*Database, error) { + dbs, err := c.GetDatabases(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + for _, db := range dbs { + if db.URI.String() == dbURI { + return &db, nil + } + } + + return nil, trace.NotFound("database is not found: %v", dbURI) +} + +// GetDatabases returns databases +func (c *Cluster) GetDatabases(ctx context.Context) ([]Database, error) { + proxyClient, err := c.clusterClient.ConnectToProxy(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + defer proxyClient.Close() + + dbservers, err := proxyClient.FindDatabaseServersByFilters(ctx, proto.ListResourcesRequest{ + Namespace: defaults.Namespace, + }) + if err != nil { + return nil, trace.Wrap(err) + } + + dbs := []Database{} + for _, srv := range dbservers { + dbs = append(dbs, Database{ + URI: c.URI.AppendDB(srv.GetHostID()), + Database: srv.GetDatabase(), + }) + } + + return dbs, nil +} + +// ReissueDBCerts issues new certificates for specific DB access +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. + if db.GetProtocol() == libdefaults.ProtocolMongoDB && user == "" { + return trace.BadParameter("please provide the database user name using --db-user flag") + } + + err := c.clusterClient.ReissueUserCerts(ctx, client.CertCacheKeep, client.ReissueParams{ + RouteToCluster: c.clusterClient.SiteName, + RouteToDatabase: proto.RouteToDatabase{ + ServiceName: db.GetName(), + Protocol: db.GetProtocol(), + Username: user, + }, + AccessRequests: c.status.ActiveRequests.AccessRequests, + }) + if err != nil { + return trace.Wrap(err) + } + + // Update the database-specific connection profile file. + err = dbprofile.Add(c.clusterClient, tlsca.RouteToDatabase{ + ServiceName: db.GetName(), + Protocol: db.GetProtocol(), + Username: user, + }, c.status) + if err != nil { + return trace.Wrap(err) + } + + return nil +} diff --git a/lib/teleterm/clusters/cluster_gateways.go b/lib/teleterm/clusters/cluster_gateways.go new file mode 100644 index 0000000000000..940b65bb9c5a0 --- /dev/null +++ b/lib/teleterm/clusters/cluster_gateways.go @@ -0,0 +1,65 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport/lib/teleterm/gateway" + + "github.com/gravitational/trace" +) + +type CreateGatewayParams struct { + // TargetURI is the cluster resource URI + TargetURI string + // TargetUser is the target user name + TargetUser string + // LocalPort is the gateway local port + LocalPort string +} + +// CreateGateway creates a gateway +func (c *Cluster) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error) { + db, err := c.GetDatabase(ctx, params.TargetURI) + if err != nil { + return nil, trace.Wrap(err) + } + + if err := c.ReissueDBCerts(ctx, params.TargetUser, db); err != nil { + return nil, trace.Wrap(err) + } + + gw, err := gateway.New(gateway.Config{ + LocalPort: params.LocalPort, + TargetURI: params.TargetURI, + TargetUser: params.TargetUser, + TargetName: db.GetName(), + Protocol: db.GetProtocol(), + KeyPath: c.status.KeyPath(), + CACertPath: c.status.CACertPathForCluster(c.Name), + CertPath: c.status.DatabaseCertPathForCluster("", db.GetName()), + Insecure: c.clusterClient.InsecureSkipVerify, + WebProxyAddr: c.clusterClient.WebProxyAddr, + Log: c.Log.WithField("gateway", params.TargetURI), + }) + if err != nil { + return nil, trace.Wrap(err) + } + + return gw, nil +} diff --git a/lib/teleterm/clusters/cluster_kubes.go b/lib/teleterm/clusters/cluster_kubes.go new file mode 100644 index 0000000000000..af2a3123fd937 --- /dev/null +++ b/lib/teleterm/clusters/cluster_kubes.go @@ -0,0 +1,71 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" +) + +// Kube describes kubernetes service +type Kube struct { + // URI is the kube URI + URI uri.ResourceURI + + types.KubernetesCluster +} + +// GetKubes returns kube services +func (c *Cluster) GetKubes(ctx context.Context) ([]Kube, error) { + proxyClient, err := c.clusterClient.ConnectToProxy(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + defer proxyClient.Close() + + authClient, err := proxyClient.ConnectToCluster(ctx, c.clusterClient.SiteName, true) + if err != nil { + return nil, trace.Wrap(err) + } + defer authClient.Close() + + services, err := authClient.GetKubeServices(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + kubeMap := map[string]Kube{} + for _, service := range services { + for _, kube := range service.GetKubernetesClusters() { + kubeMap[kube.Name] = Kube{ + URI: c.URI.AppendKube(kube.Name), + KubernetesCluster: *kube, + } + } + } + + kubes := make([]Kube, 0, len(kubeMap)) + for _, value := range kubeMap { + kubes = append(kubes, value) + } + + return kubes, nil +} diff --git a/lib/teleterm/clusters/cluster_leaves.go b/lib/teleterm/clusters/cluster_leaves.go new file mode 100644 index 0000000000000..9fdd199de46e9 --- /dev/null +++ b/lib/teleterm/clusters/cluster_leaves.go @@ -0,0 +1,64 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" +) + +// LeafCluster describes a leaf (trusted) cluster +type LeafCluster struct { + // URI is the leaf cluster URI + URI uri.ResourceURI + // LoggedInUser is the logged in user + LoggedInUser LoggedInUser + // Name is the leaf cluster name + Name string + // Connected indicates if this leaf cluster is connected + Connected bool +} + +//GetLeafClusters returns leaf clusters +func (c *Cluster) GetLeafClusters(ctx context.Context) ([]LeafCluster, error) { + proxyClient, err := c.clusterClient.ConnectToProxy(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + defer proxyClient.Close() + + remoteClusters, err := proxyClient.GetLeafClusters(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + results := []LeafCluster{} + for _, remoteCluster := range remoteClusters { + results = append(results, LeafCluster{ + URI: c.URI.AppendLeafCluster(remoteCluster.GetName()), + Name: remoteCluster.GetName(), + Connected: remoteCluster.GetConnectionStatus() == teleport.RemoteClusterStatusOnline, + LoggedInUser: c.GetLoggedInUser(), + }) + } + + return results, nil +} diff --git a/lib/teleterm/clusters/cluster_servers.go b/lib/teleterm/clusters/cluster_servers.go new file mode 100644 index 0000000000000..02ac5daf983ba --- /dev/null +++ b/lib/teleterm/clusters/cluster_servers.go @@ -0,0 +1,59 @@ +/* +Copyright 2021 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 ( + "context" + + "github.com/gravitational/teleport/api/defaults" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" +) + +// Database describes database +type Server struct { + // URI is the database URI + URI uri.ResourceURI + + types.Server +} + +// GetServers returns cluster servers +func (c *Cluster) GetServers(ctx context.Context) ([]Server, error) { + proxyClient, err := c.clusterClient.ConnectToProxy(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + defer proxyClient.Close() + + clusterServers, err := proxyClient.FindServersByLabels(ctx, defaults.Namespace, nil) + if err != nil { + return nil, trace.Wrap(err) + } + + results := []Server{} + for _, server := range clusterServers { + results = append(results, Server{ + URI: c.URI.AppendServer(server.GetName()), + Server: server, + }) + } + + return results, nil +} diff --git a/lib/teleterm/clusters/config.go b/lib/teleterm/clusters/config.go new file mode 100644 index 0000000000000..7d151b3db2b43 --- /dev/null +++ b/lib/teleterm/clusters/config.go @@ -0,0 +1,53 @@ +/* +Copyright 2021 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 ( + "github.com/gravitational/trace" + + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" +) + +// Config is the cluster service config +type Config struct { + // Dir is the directory to store cluster profiles + Dir string + // Clock is a clock for time-related operations + Clock clockwork.Clock + // InsecureSkipVerify is an option to skip TLS cert check + InsecureSkipVerify bool + // Log is a component logger + Log logrus.FieldLogger +} + +// CheckAndSetDefaults checks the configuration for its validity and sets default values if needed +func (c *Config) CheckAndSetDefaults() error { + if c.Dir == "" { + return trace.BadParameter("missing working directory") + } + + if c.Clock == nil { + c.Clock = clockwork.NewRealClock() + } + + if c.Log == nil { + c.Log = logrus.WithField(trace.Component, "teleterm: storage") + } + + return nil +} diff --git a/lib/teleterm/clusters/storage.go b/lib/teleterm/clusters/storage.go new file mode 100644 index 0000000000000..dfc0ab2694fb1 --- /dev/null +++ b/lib/teleterm/clusters/storage.go @@ -0,0 +1,230 @@ +/* +Copyright 2021 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 ( + "context" + "net" + + "github.com/gravitational/teleport/api/profile" + "github.com/gravitational/teleport/lib/client" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" +) + +// NewStorage creates an instance of Cluster profile storage. +func NewStorage(cfg Config) (*Storage, error) { + if err := cfg.CheckAndSetDefaults(); err != nil { + return nil, trace.Wrap(err) + } + + return &Storage{Config: cfg}, nil +} + +// ReadAll reads clusters from profiles +func (s *Storage) ReadAll() ([]*Cluster, error) { + pfNames, err := profile.ListProfileNames(s.Dir) + if err != nil { + return nil, trace.Wrap(err) + } + + clusters := make([]*Cluster, 0, len(pfNames)) + for _, name := range pfNames { + cluster, err := s.fromProfile(name) + if err != nil { + return nil, trace.Wrap(err) + } + + clusters = append(clusters, cluster) + } + + return clusters, nil +} + +// GetByName returns a cluster by name +func (s *Storage) GetByName(clusterName string) (*Cluster, error) { + cluster, err := s.fromProfile(clusterName) + if err != nil { + return nil, trace.Wrap(err) + } + + return cluster, nil +} + +// GetByURI returns a cluster by URI +func (s *Storage) GetByURI(clusterURI string) (*Cluster, error) { + URI := uri.New(clusterURI) + rootClusterName := URI.GetRootClusterName() + leafClusterName := URI.GetLeafClusterName() + + cluster, err := s.fromProfile(rootClusterName) + if err != nil { + return nil, trace.Wrap(err) + } + + if leafClusterName != "" { + cluster.clusterClient.SiteName = leafClusterName + } + + cluster.URI = URI + + 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 { + return trace.Wrap(err) + } + + return nil +} + +// Add adds a cluster +func (s *Storage) Add(ctx context.Context, webProxyAddress string) (*Cluster, error) { + profiles, err := profile.ListProfileNames(s.Dir) + if err != nil { + return nil, trace.Wrap(err) + } + + clusterName := parseName(webProxyAddress) + for _, pname := range profiles { + if pname == clusterName { + return nil, trace.BadParameter("cluster %v already exists", clusterName) + } + } + + cluster, err := s.addCluster(ctx, s.Dir, webProxyAddress) + if err != nil { + return nil, trace.Wrap(err) + } + + return cluster, nil +} + +// addCluster adds a new cluster +func (s *Storage) addCluster(ctx context.Context, dir, webProxyAddress string) (*Cluster, error) { + if webProxyAddress == "" { + return nil, trace.BadParameter("cluster address is missing") + } + + if dir == "" { + return nil, trace.BadParameter("cluster directory is missing") + } + + cfg := client.MakeDefaultConfig() + cfg.WebProxyAddr = webProxyAddress + cfg.HomePath = s.Dir + cfg.KeysDir = s.Dir + cfg.InsecureSkipVerify = s.InsecureSkipVerify + + clusterName := parseName(webProxyAddress) + clusterURI := uri.NewClusterURI(clusterName) + clusterClient, err := client.NewClient(cfg) + if err != nil { + return nil, trace.Wrap(err) + } + + // verify that cluster is reachable + _, err = clusterClient.Ping(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + if err := cfg.SaveProfile(s.Dir, false); err != nil { + return nil, trace.Wrap(err) + } + + return &Cluster{ + URI: clusterURI, + Name: clusterName, + clusterClient: clusterClient, + dir: s.Dir, + clock: s.Clock, + Log: s.Log.WithField("cluster", clusterURI), + }, nil +} + +// fromProfile creates a new cluster from its profile +func (s *Storage) fromProfile(clusterName string) (*Cluster, error) { + if clusterName == "" { + return nil, trace.BadParameter("cluster name is missing") + } + + cfg := client.MakeDefaultConfig() + if err := cfg.LoadProfile(s.Dir, clusterName); err != nil { + return nil, trace.Wrap(err) + } + + cfg.KeysDir = s.Dir + cfg.HomePath = s.Dir + cfg.InsecureSkipVerify = s.InsecureSkipVerify + + clusterClient, err := client.NewClient(cfg) + if err != nil { + return nil, trace.Wrap(err) + } + + status := &client.ProfileStatus{} + + // load profile status if key exists + _, err = clusterClient.LocalAgent().GetKey(clusterName) + if err != nil { + s.Log.WithError(err).Infof("Unable to load the keys for cluster %v.", clusterName) + } + + if err == nil && cfg.Username != "" { + status, err = client.ReadProfileStatus(s.Dir, clusterName) + if err != nil { + return nil, trace.Wrap(err) + } + + if err := clusterClient.LoadKeyForCluster(status.Cluster); err != nil { + return nil, trace.Wrap(err) + } + } + if err != nil && !trace.IsNotFound(err) { + return nil, trace.Wrap(err) + } + + clusterURI := uri.NewClusterURI(clusterName) + return &Cluster{ + URI: clusterURI, + Name: clusterName, + clusterClient: clusterClient, + dir: s.Dir, + clock: s.Clock, + status: *status, + Log: s.Log.WithField("cluster", clusterURI), + }, nil +} + +// parseName gets cluster name from cluster web proxy address +func parseName(webProxyAddress string) string { + clusterName, _, err := net.SplitHostPort(webProxyAddress) + if err != nil { + clusterName = webProxyAddress + } + + return clusterName +} + +// Storage is the cluster storage +type Storage struct { + Config +} diff --git a/lib/teleterm/config.go b/lib/teleterm/config.go new file mode 100644 index 0000000000000..2988f9528993b --- /dev/null +++ b/lib/teleterm/config.go @@ -0,0 +1,58 @@ +// Copyright 2021 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 teleterm + +import ( + "fmt" + "os" + + "github.com/gravitational/teleport/lib/utils" + + "github.com/gravitational/trace" +) + +// Config describes teleterm configuration +type Config struct { + // Addr is the bind address for the server + Addr string + // ShutdownSignals is the set of captured signals that cause server shutdown. + ShutdownSignals []os.Signal + // HomeDir is the directory to store cluster profiles + HomeDir string + // InsecureSkipVerify is an option to skip HTTPS cert check + InsecureSkipVerify bool +} + +// CheckAndSetDefaults checks and sets default config values. +func (c *Config) CheckAndSetDefaults() error { + if c.HomeDir == "" { + return trace.BadParameter("missing home directory") + } + + if c.Addr == "" { + c.Addr = fmt.Sprintf("unix://%v/tshd.socket", c.HomeDir) + } + + addr, err := utils.ParseAddr(c.Addr) + if err != nil { + return trace.Wrap(err) + } + + if addr.Network() != "unix" { + return trace.BadParameter("only unix sockets are supported") + } + + return nil +} diff --git a/lib/teleterm/daemon/config.go b/lib/teleterm/daemon/config.go new file mode 100644 index 0000000000000..28beb123d08c3 --- /dev/null +++ b/lib/teleterm/daemon/config.go @@ -0,0 +1,55 @@ +/* +Copyright 2021 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 daemon + +import ( + "github.com/gravitational/teleport/lib/teleterm/clusters" + + "github.com/gravitational/trace" + + "github.com/jonboulle/clockwork" + "github.com/sirupsen/logrus" +) + +// Config is the cluster service config +type Config struct { + // Storage is a storage service that reads/writes to tsh profiles + Storage *clusters.Storage + // Clock is a clock for time-related operations + Clock clockwork.Clock + // InsecureSkipVerify is an option to skip HTTPS cert check + InsecureSkipVerify bool + // Log is a component logger + Log *logrus.Entry +} + +// CheckAndSetDefaults checks the configuration for its validity and sets default values if needed +func (c *Config) CheckAndSetDefaults() error { + if c.Storage == nil { + return trace.BadParameter("missing cluster storage") + } + + if c.Clock == nil { + c.Clock = clockwork.NewRealClock() + } + + if c.Log == nil { + c.Log = logrus.NewEntry(logrus.StandardLogger()).WithField(trace.Component, "daemon") + } + + return nil +} diff --git a/lib/teleterm/daemon/daemon.go b/lib/teleterm/daemon/daemon.go new file mode 100644 index 0000000000000..72a788313c035 --- /dev/null +++ b/lib/teleterm/daemon/daemon.go @@ -0,0 +1,259 @@ +// Copyright 2021 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 daemon + +import ( + "context" + "sync" + + apiuri "github.com/gravitational/teleport/lib/teleterm/api/uri" + "github.com/gravitational/teleport/lib/teleterm/clusters" + "github.com/gravitational/teleport/lib/teleterm/gateway" + + "github.com/gravitational/trace" +) + +// New creates an instance of Daemon service +func New(cfg Config) (*Service, error) { + if err := cfg.CheckAndSetDefaults(); err != nil { + return nil, trace.Wrap(err) + } + + return &Service{ + Config: cfg, + }, nil +} + +// ListRootClusters returns a list of root clusters +func (s *Service) ListRootClusters(ctx context.Context) ([]*clusters.Cluster, error) { + clusters, err := s.Storage.ReadAll() + if err != nil { + return nil, trace.Wrap(err) + } + + return clusters, nil +} + +// ListLeafClusters returns a list of leaf clusters +func (s *Service) ListLeafClusters(ctx context.Context, uri string) ([]clusters.LeafCluster, error) { + cluster, err := s.ResolveCluster(uri) + if err != nil { + return nil, trace.Wrap(err) + } + + // leaf cluster cannot have own leaves + if cluster.URI.GetLeafClusterName() != "" { + return nil, nil + } + + leaves, err := cluster.GetLeafClusters(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + return leaves, nil +} + +// AddCluster adds a cluster +func (s *Service) AddCluster(ctx context.Context, webProxyAddress string) (*clusters.Cluster, error) { + cluster, err := s.Storage.Add(ctx, webProxyAddress) + if err != nil { + return nil, trace.Wrap(err) + } + + return cluster, nil +} + +// RemoveCluster removes cluster +func (s *Service) RemoveCluster(ctx context.Context, uri string) error { + cluster, err := s.ResolveCluster(uri) + if err != nil { + return trace.Wrap(err) + } + + if cluster.Connected() { + if err := cluster.Logout(ctx); err != nil { + return trace.Wrap(err) + } + } + + if err := s.Storage.Remove(ctx, cluster.Name); err != nil { + return trace.Wrap(err) + } + + return nil +} + +// 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()) + if err != nil { + return nil, trace.Wrap(err) + } + + return cluster, nil +} + +// ClusterLogout logs a user out from the cluster +func (s *Service) ClusterLogout(ctx context.Context, uri string) error { + cluster, err := s.ResolveCluster(uri) + if err != nil { + return trace.Wrap(err) + } + + if err := cluster.Logout(ctx); err != nil { + return trace.Wrap(err) + } + + return nil +} + +// CreateGateway creates a gateway to given targetURI +func (s *Service) CreateGateway(ctx context.Context, params clusters.CreateGatewayParams) (*gateway.Gateway, error) { + s.mu.Lock() + defer s.mu.Unlock() + + cluster, err := s.ResolveCluster(params.TargetURI) + if err != nil { + return nil, trace.Wrap(err) + } + + gateway, err := cluster.CreateGateway(ctx, params) + if err != nil { + return nil, trace.Wrap(err) + } + + gateway.Open() + + s.gateways = append(s.gateways, gateway) + + return gateway, nil +} + +// ListServers returns cluster servers +func (s *Service) ListServers(ctx context.Context, clusterURI string) ([]clusters.Server, error) { + cluster, err := s.ResolveCluster(clusterURI) + if err != nil { + return nil, trace.Wrap(err) + } + + servers, err := cluster.GetServers(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + return servers, nil +} + +// ListServers returns cluster servers +func (s *Service) ListApps(ctx context.Context, clusterURI string) ([]clusters.App, error) { + cluster, err := s.ResolveCluster(clusterURI) + if err != nil { + return nil, trace.Wrap(err) + } + + apps, err := cluster.GetApps(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + return apps, nil +} + +// RemoveGateway removes cluster gateway +func (s *Service) RemoveGateway(ctx context.Context, gatewayURI string) error { + gateway, err := s.FindGateway(gatewayURI) + if err != nil { + return trace.Wrap(err) + } + + gateway.Close() + + s.mu.Lock() + defer s.mu.Unlock() + // remove closed gateway from list + for index := range s.gateways { + if s.gateways[index] == gateway { + s.gateways = append(s.gateways[:index], s.gateways[index+1:]...) + return nil + } + } + + return nil +} + +// ListKubes lists kubernetes clusters +func (s *Service) ListKubes(ctx context.Context, uri string) ([]clusters.Kube, error) { + cluster, err := s.ResolveCluster(uri) + if err != nil { + return nil, trace.Wrap(err) + } + + kubes, err := cluster.GetKubes(ctx) + if err != nil { + return nil, trace.Wrap(err) + } + + return kubes, nil +} + +// FindGateway finds a gateway by URI +func (s *Service) FindGateway(gatewayURI string) (*gateway.Gateway, error) { + s.mu.RLock() + defer s.mu.RUnlock() + + for _, gateway := range s.gateways { + if gateway.URI.String() == gatewayURI { + return gateway, nil + } + } + + return nil, trace.NotFound("gateway is not found: %v", gatewayURI) +} + +// ListGateways lists gateways +func (s *Service) ListGateways(ctx context.Context) ([]*gateway.Gateway, error) { + s.mu.RLock() + defer s.mu.RUnlock() + + // copy this slice to avoid race conditions when original slice gets modified + gateways := make([]*gateway.Gateway, len(s.gateways)) + copy(gateways, s.gateways) + return gateways, nil +} + +// Stop terminates all cluster open connections +func (s *Service) Stop() { + s.mu.RLock() + defer s.mu.RUnlock() + + for _, gateway := range s.gateways { + gateway.Close() + } +} + +// Service is the daemon service +type Service struct { + Config + + mu sync.RWMutex + // gateways is the cluster gateways + gateways []*gateway.Gateway +} diff --git a/lib/teleterm/gateway/config.go b/lib/teleterm/gateway/config.go new file mode 100644 index 0000000000000..74fb1bb27db54 --- /dev/null +++ b/lib/teleterm/gateway/config.go @@ -0,0 +1,86 @@ +/* +Copyright 2021 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 ( + "github.com/google/uuid" + "github.com/gravitational/teleport/lib/teleterm/api/uri" + + "github.com/gravitational/trace" + + "github.com/sirupsen/logrus" +) + +// CreateGatewayParams describes gateway parameters +type Config struct { + // URI is the gateway URI + URI uri.ResourceURI + // TargetName is the remote resource name + TargetName string + // TargetURI is the remote resource URI + TargetURI string + // TargetUser is the target user name + TargetUser string + + // Port is the gateway port + LocalPort string + // LocalAddress is the local address + LocalAddress string + // Protocol is the gateway protocol + Protocol string + // CACertPath + CACertPath string + // CertPath + CertPath string + // KeyPath + KeyPath string + // Insecure + Insecure bool + // WebProxyAddr + WebProxyAddr string + // Log is a component logger + Log logrus.FieldLogger +} + +// CheckAndSetDefaults checks and sets the defaults +func (c *Config) CheckAndSetDefaults() error { + if c.URI.String() == "" { + c.URI = uri.NewGatewayURI(uuid.NewString()) + } + + if c.LocalAddress == "" { + c.LocalAddress = "localhost" + } + + if c.LocalPort == "" { + c.LocalPort = "0" + } + + if c.Log == nil { + c.Log = logrus.WithField("gateway", c.URI.String()) + } + + if c.TargetName == "" { + return trace.BadParameter("missing target name") + } + + if c.TargetURI == "" { + return trace.BadParameter("missing target URI") + } + + return nil +} diff --git a/lib/teleterm/gateway/gateway.go b/lib/teleterm/gateway/gateway.go new file mode 100644 index 0000000000000..af0d64c9c9ccd --- /dev/null +++ b/lib/teleterm/gateway/gateway.go @@ -0,0 +1,124 @@ +/* +Copyright 2021 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 ( + "context" + "fmt" + "net" + + alpn "github.com/gravitational/teleport/lib/srv/alpnproxy" + alpncommon "github.com/gravitational/teleport/lib/srv/alpnproxy/common" + "github.com/gravitational/teleport/lib/utils" + + "github.com/gravitational/trace" +) + +// New creates an instance of Gateway +func New(cfg Config) (*Gateway, error) { + if err := cfg.CheckAndSetDefaults(); err != nil { + return nil, trace.Wrap(err) + } + + listener, err := net.Listen("tcp", fmt.Sprintf("%s:%s", cfg.LocalAddress, cfg.LocalPort)) + if err != nil { + return nil, trace.Wrap(err) + } + + closeContext, closeCancel := context.WithCancel(context.Background()) + // make sure the listener is closed if gateway creation failed + ok := false + defer func() { + if ok { + return + } + + closeCancel() + if err := listener.Close(); err != nil { + cfg.Log.WithError(err).Warn("Failed to close listener.") + } + }() + + // retrieve automatically assigned port number + _, port, err := net.SplitHostPort(listener.Addr().String()) + if err != nil { + return nil, trace.Wrap(err) + } + + protocol, err := alpncommon.ToALPNProtocol(cfg.Protocol) + if err != nil { + return nil, trace.Wrap(err) + } + + address, err := utils.ParseAddr(cfg.WebProxyAddr) + if err != nil { + return nil, trace.Wrap(err) + } + + localProxy, err := alpn.NewLocalProxy(alpn.LocalProxyConfig{ + InsecureSkipVerify: cfg.Insecure, + RemoteProxyAddr: cfg.WebProxyAddr, + Protocol: protocol, + Listener: listener, + ParentContext: closeContext, + SNI: address.Host(), + }) + if err != nil { + return nil, trace.Wrap(err) + } + + cfg.LocalPort = port + + gateway := &Gateway{ + Config: cfg, + closeContext: closeContext, + closeCancel: closeCancel, + localProxy: localProxy, + } + + ok = true + return gateway, nil +} + +// Close terminates gateway connection +func (g *Gateway) Close() { + g.closeCancel() + g.localProxy.Close() +} + +// Open opens a gateway to Teleport proxy +func (g *Gateway) Open() { + go func() { + g.Log.Info("Gateway is open.") + if err := g.localProxy.Start(g.closeContext); err != nil { + g.Log.WithError(err).Warn("Failed to open a connection.") + } + + g.Log.Info("Gateway has closed.") + }() +} + +// Gateway describes local proxy that creates a gateway to the remote Teleport resource. +type Gateway struct { + Config + + 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 +} diff --git a/lib/teleterm/teleterm.go b/lib/teleterm/teleterm.go new file mode 100644 index 0000000000000..b5356fdc94f14 --- /dev/null +++ b/lib/teleterm/teleterm.go @@ -0,0 +1,90 @@ +// Copyright 2021 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 teleterm + +import ( + "context" + "os" + "os/signal" + + "github.com/gravitational/teleport/lib/teleterm/apiserver" + "github.com/gravitational/teleport/lib/teleterm/clusters" + "github.com/gravitational/teleport/lib/teleterm/daemon" + + "github.com/gravitational/trace" + + log "github.com/sirupsen/logrus" +) + +// Start starts daemon service +func Start(ctx context.Context, cfg Config) error { + if err := cfg.CheckAndSetDefaults(); err != nil { + return trace.Wrap(err) + } + + storage, err := clusters.NewStorage(clusters.Config{ + Dir: cfg.HomeDir, + InsecureSkipVerify: cfg.InsecureSkipVerify, + }) + if err != nil { + return trace.Wrap(err) + } + + daemonService, err := daemon.New(daemon.Config{ + Storage: storage, + InsecureSkipVerify: cfg.InsecureSkipVerify, + }) + if err != nil { + return trace.Wrap(err) + } + + apiServer, err := apiserver.New(apiserver.Config{ + HostAddr: cfg.Addr, + Daemon: daemonService, + }) + if err != nil { + return trace.Wrap(err) + } + + serverAPIWait := make(chan error) + go func() { + err := apiServer.Serve() + serverAPIWait <- err + }() + + // Wait for shutdown signals + go func() { + c := make(chan os.Signal, len(cfg.ShutdownSignals)) + signal.Notify(c, cfg.ShutdownSignals...) + select { + case <-ctx.Done(): + log.Info("Context closed, stopping service.") + case sig := <-c: + log.Infof("Captured %s, stopping service.", sig) + } + daemonService.Stop() + apiServer.Stop() + }() + + log.Infof("tsh daemon is listening on %v.", cfg.Addr) + + errAPI := <-serverAPIWait + + if errAPI != nil { + return trace.Wrap(errAPI, "shutting down due to API Server error") + } + + return nil +} diff --git a/lib/teleterm/teleterm_test.go b/lib/teleterm/teleterm_test.go new file mode 100644 index 0000000000000..9594338cdd51d --- /dev/null +++ b/lib/teleterm/teleterm_test.go @@ -0,0 +1,48 @@ +// Copyright 2021 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 teleterm_test + +import ( + "context" + "fmt" + "testing" + + "github.com/gravitational/teleport/lib/teleterm" + + "github.com/stretchr/testify/require" +) + +func TestStart(t *testing.T) { + homeDir := t.TempDir() + cfg := teleterm.Config{ + Addr: fmt.Sprintf("unix://%v/teleterm.sock", homeDir), + HomeDir: fmt.Sprintf("%v/", homeDir), + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + wait := make(chan error) + go func() { + err := teleterm.Start(ctx, cfg) + wait <- err + }() + + defer func() { + cancel() // Stop the server. + require.NoError(t, <-wait) + }() + +} diff --git a/rfd/0063-teleport-terminal.md b/rfd/0063-teleport-terminal.md new file mode 100644 index 0000000000000..f6ac98a524c02 --- /dev/null +++ b/rfd/0063-teleport-terminal.md @@ -0,0 +1,118 @@ +--- +authors: Alexey Kontsevoy (alexey@goteleport.com) +state: draft +--- + +# RFD 0063 - Teleport Terminal + +## What +Teleport Terminal is a desktop application that provides quick access to remote resources via Teleport. +This RFD defines the high-level architecture of Teleport Terminal. + +## Details +There are two main components to Teleport Terminal: +1. teleterm +2. tsh (daemon mode) + +### teleterm +`teleterm` is an [Electron](https://www.electronjs.org/) application that uses Chromium engine +for its tabbed UI and nodejs for OS-level operations. +Electron has been chosen because of cross-platform support and an ability to reuse most of existing Teleport Web UI components and design system. + +#### UI +`teleterm` UI will have the following features: +1. Built-in fully featured terminal based on [xterm](https://xtermjs.org/) and [node-pty](https://github.com/microsoft/node-pty) to fork processes. +2. Tabbed layout where a tab can be an ssh session, rdp connection, or any other document. +3. Ability to add and access multiple Teleport clusters at the same time. +4. Command Palette for quick access and navigation. + +### tsh daemon +`tsh daemon` is a `tsh` tool that runs as a service. A hidden flag launches `tsh` in a background process that exposes gRPC API over unix-socket (similarly to docker daemon). +This API is used by `teleterm` to call `tsh` internal methods to access Teleport clusters. +This makes `tsh` as `teleterm` backend service that stores information about clusters and retrieved certificates. + +#### gRPC API +`tsh` gRPC API allows programmatic access to `tsh` functionality. This includes logging into a cluster, k8s, and creating a local proxy (alpn). +It uses unix-sockets as the primary communication channel. Unix Sockets are now broadly supported as Microsoft added Unix Sockets support to Windows (Windows 10 Version 1803). +On systems where Unix Sockets are not supported, `tsh` can establish a localhost TLS/TCP connection where TLS certificates are re-generated at start-time by `teleterm`. +Only unix-sockets are supported at this time. + +### Security +`teleterm` runs under OS local user's privileges and does not require `root` access. It stores its state under user’s "app data" folder. +This includes UI state, settings, and temporary files such as unix-sockets. +Currently `tsh` profiles are also stored there as well. + +`teleterm` minimizes the attack surface by delegating as much as possible to `tsh`. For example, +SSH to a server happens via executing a local `TELEPORT_CLUSTER=leafCluster tsh --proxy=rootCluster ssh login@server` command and piping it to the `pty`. + +Database access happens via creating a local alpn proxy connection over tsh `API`. If MFA is required, `teleterm` receives a notification (over gRPC stream) before alpn proxy accepts a new connection request. + +UI process (Electron renderer) runs in the context isolation mode with `nodejs` integration turned off. UI talks to tsh API and `node-pty` over [contextBridge](https://www.electronjs.org/docs/latest/api/context-bridge). +Even though UI does have access to local shells (via contextBridge -> node-pty), using `contextBridge` by default helps clear access boundaries between processes. + +UI will ensure that general [security recommendations](https://www.electronjs.org/docs/latest/tutorial/security) are implemented. + +## Packaging and installation +`teleterm` uses [Electron-Builder](https://github.com/electron-userland/electron-builder) that handles creation of packages for multiple platforms. `tsh` is packaged together with the +rest of the application and installed into the "app data" folder. After an installation, `teleterm` prompts a dialog asking a user to optionally register `tsh` and `teleterm` globally via symlinks. + +Electron supports automatic updates. The updates happens via a publicly exposed service that Electron trusts. This service can be hosted by the +cloud team. This functionality currently is not implemented. + + +### Diagram +```pro + +------------+ + | | + +-------+---------+ | + | | | + | teleport +--+ + | clusters | + | | + +------+-+--------+ + ^ ^ External Network ++------------------------------------------------|-|---------------------+ + | | Host OS + Clients (psql) | | + | | | + v | | + +--------+---------------+ | | + | | SNI/ALPN | | + +--+----------------------+ | routing | | + | | | | | + | proxy connections +-+ | | + | | | | + +-------------------+-----+ | | + ^ | | + | | | + +---------------+ | tls/tcp on localhost | | + | tsh profiles | | | | + | (files) | | v v + | | | +------+-+-------------------+ + +-------^-------+ | | | + | +-------------------+ tsh | + +<------------------------------+ (daemon) | + | | + +-------------+--------------+ + +--------+-----------------+ ^ + | Terminal | | + | Electron Main Process | | gRPC API + +-----------+--------------+ | (domain socket) + ^ | + | | + IPC | | + named pipes | | + v Terminal UI (Electron Renderer Process) | + +-----------+------------+---------------------------------------------+ + | -recently used | root@node1 × | k8s_c × | rdp_win2 × | + | root@node1 +---------------------------------------------+ + | root@node2 | | + +------------------------+ ./ | + | -clusters | ../ | + | -cluster1 | assets/ | + | servers (20) | babel.config.js | + | databases (12) | | + | +cluster2 | | + | +cluster3 | | + +------------------------+---------------------------------------------+ +``` diff --git a/tool/tsh/daemon.go b/tool/tsh/daemon.go new file mode 100644 index 0000000000000..3727dcab9aace --- /dev/null +++ b/tool/tsh/daemon.go @@ -0,0 +1,47 @@ +/* +Copyright 2021 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 main + +import ( + "context" + "os" + "syscall" + + "github.com/gravitational/teleport/api/profile" + "github.com/gravitational/teleport/lib/teleterm" + + "github.com/gravitational/trace" +) + +// onDaemonStart implements "tsh daemon start" command. +func onDaemonStart(cf *CLIConf) error { + homeDir := profile.FullProfilePath(cf.HomePath) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + err := teleterm.Start(ctx, teleterm.Config{ + HomeDir: homeDir, + Addr: cf.DaemonAddr, + InsecureSkipVerify: cf.InsecureSkipVerify, + ShutdownSignals: []os.Signal{os.Interrupt, syscall.SIGTERM}, + }) + if err != nil { + return trace.Wrap(err) + } + + return nil +} diff --git a/tool/tsh/tsh.go b/tool/tsh/tsh.go index 59cebbc1a0293..166aa41522de6 100644 --- a/tool/tsh/tsh.go +++ b/tool/tsh/tsh.go @@ -140,6 +140,8 @@ type CLIConf struct { SiteName string // KubernetesCluster specifies the kubernetes cluster to login to. KubernetesCluster string + // DaemonAddr is the daemon listening address. + DaemonAddr string // DatabaseService specifies the database proxy server to log into. DatabaseService string // DatabaseUser specifies database user to embed in the certificate. @@ -446,6 +448,11 @@ func Run(args []string, opts ...cliOption) error { ssh.Flag("x11-untrusted-timeout", "Sets a timeout for untrusted X11 forwarding, after which the client will reject any forwarding requests from the server").Default("10m").DurationVar((&cf.X11ForwardingTimeout)) ssh.Flag("participant-req", "Displays a verbose list of required participants in a moderated session.").BoolVar(&cf.displayParticipantRequirements) + // Daemon service for teleterm client + daemon := app.Command("daemon", "Daemon is the tsh daemon service").Hidden() + daemonStart := daemon.Command("start", "Starts tsh daemon service").Hidden() + daemonStart.Flag("addr", "Addr is the daemon listening address.").StringVar(&cf.DaemonAddr) + // AWS. aws := app.Command("aws", "Access AWS API.") aws.Arg("command", "AWS command and subcommands arguments that are going to be forwarded to AWS CLI").StringsVar(&cf.AWSCommandArgs) @@ -789,6 +796,8 @@ func Run(args []string, opts ...cliOption) error { err = onConfigProxy(&cf) case aws.FullCommand(): err = onAWS(&cf) + case daemonStart.FullCommand(): + err = onDaemonStart(&cf) default: // This should only happen when there's a missing switch case above. err = trace.BadParameter("command %q not configured", command)