handler

package
v0.0.0-...-5c79d48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APILabels

type APILabels []*api.Label

sortedLabels is a sort wrapper that sorts labels by name

func (APILabels) Len

func (s APILabels) Len() int

func (APILabels) Less

func (s APILabels) Less(i, j int) bool

func (APILabels) Swap

func (s APILabels) Swap(i, j int)

type Config

type Config struct {
	// DaemonService is the instance of daemon service
	DaemonService *daemon.Service
}

Config is the terminal service configuration

func (*Config) CheckAndSetDefaults

func (c *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets the defaults

type Handler

type Handler struct {
	api.UnimplementedTerminalServiceServer

	// Config is the service config
	Config
}

Handler implements teleterm api service

func New

func New(cfg Config) (*Handler, error)

New creates an instance of Handler

func (*Handler) AddCluster

func (s *Handler) AddCluster(ctx context.Context, req *api.AddClusterRequest) (*api.Cluster, error)

AddCluster creates a new cluster

func (*Handler) AssumeRole

func (s *Handler) AssumeRole(ctx context.Context, req *api.AssumeRoleRequest) (*api.EmptyResponse, error)

AssumeRole reissues a certificate. This can include new RequestIds and RequestIds to drop from the cert at the same time.

func (*Handler) CreateAccessRequest

CreateAccessRequest creates an Access Request.

func (*Handler) CreateGateway

func (s *Handler) CreateGateway(ctx context.Context, req *api.CreateGatewayRequest) (*api.Gateway, error)

CreateGateway creates a gateway

func (*Handler) DeleteAccessRequest

func (s *Handler) DeleteAccessRequest(ctx context.Context, req *api.DeleteAccessRequestRequest) (*api.EmptyResponse, error)

DeleteAccessRequest deletes an Access Request.

func (*Handler) GetAccessRequest

GetAccessRequest returns a single access request by id.

func (*Handler) GetAccessRequests

GetAccessRequests returns a list of all available access requests the user can view.

func (*Handler) GetApps

func (s *Handler) GetApps(ctx context.Context, req *api.GetAppsRequest) (*api.GetAppsResponse, error)

GetApps gets apps with filters and returns paginated results

func (*Handler) GetAuthSettings

func (s *Handler) GetAuthSettings(ctx context.Context, req *api.GetAuthSettingsRequest) (*api.AuthSettings, error)

GetAuthSettings returns cluster auth preferences

func (*Handler) GetCluster

func (s *Handler) GetCluster(ctx context.Context, req *api.GetClusterRequest) (*api.Cluster, error)

GetCluster returns a cluster

func (*Handler) GetDatabases

GetDatabases gets databses with filters and returns paginated results

func (*Handler) GetKubes

func (s *Handler) GetKubes(ctx context.Context, req *api.GetKubesRequest) (*api.GetKubesResponse, error)

GetKubes accepts parameterized input to enable searching, sorting, and pagination

func (*Handler) GetRequestableRoles

func (*Handler) GetServers

func (s *Handler) GetServers(ctx context.Context, req *api.GetServersRequest) (*api.GetServersResponse, error)

GetServers accepts parameterized input to enable searching, sorting, and pagination

func (*Handler) GetSuggestedAccessLists

GetSuggestedAccessLists returns suggested access lists for an access request.

func (*Handler) GetUserPreferences

func (*Handler) ListDatabaseUsers

ListDatabaseUsers is used to list database user suggestions when the user is attempting to establish a connection to a database through Teleterm.

The list is based on whatever we can deduce from the role set, so it's similar to the behavior of `tsh db ls -v`, with the exception that Teleterm is interested only in the allowed usernames.

func (*Handler) ListGateways

ListGateways lists all gateways

func (*Handler) ListLeafClusters

func (s *Handler) ListLeafClusters(ctx context.Context, req *api.ListLeafClustersRequest) (*api.ListClustersResponse, error)

ListLeafClusters lists leaf clusters

func (*Handler) ListRootClusters

func (s *Handler) ListRootClusters(ctx context.Context, r *api.ListClustersRequest) (*api.ListClustersResponse, error)

ListRootClusters lists root clusters

func (*Handler) ListUnifiedResources

func (*Handler) Login

func (s *Handler) Login(ctx context.Context, req *api.LoginRequest) (*api.EmptyResponse, error)

Login logs in a user to a cluster

func (*Handler) LoginPasswordless

func (s *Handler) LoginPasswordless(stream api.TerminalService_LoginPasswordlessServer) error

LoginPasswordless logs in a user to a cluster passwordlessly.

func (*Handler) Logout

func (s *Handler) Logout(ctx context.Context, req *api.LogoutRequest) (*api.EmptyResponse, error)

Logout logs a user out from a cluster

func (*Handler) PromoteAccessRequest

PromoteAccessRequest promotes an access request to an access list.

func (*Handler) RemoveCluster

func (s *Handler) RemoveCluster(ctx context.Context, req *api.RemoveClusterRequest) (*api.EmptyResponse, error)

RemoveCluster removes a cluster from local system

func (*Handler) RemoveGateway

func (s *Handler) RemoveGateway(ctx context.Context, req *api.RemoveGatewayRequest) (*api.EmptyResponse, error)

RemoveGateway removes cluster gateway

func (*Handler) ReportUsageEvent

func (h *Handler) ReportUsageEvent(ctx context.Context, req *api.ReportUsageEventRequest) (*api.EmptyResponse, error)

func (*Handler) ReviewAccessRequest

ReviewAccessRequest creates a new AccessRequestReview for a given RequestId.

func (*Handler) SetGatewayLocalPort

func (s *Handler) SetGatewayLocalPort(ctx context.Context, req *api.SetGatewayLocalPortRequest) (*api.Gateway, error)

SetGatewayLocalPort restarts the gateway under the new port without fetching new certs.

func (*Handler) SetGatewayTargetSubresourceName

func (s *Handler) SetGatewayTargetSubresourceName(ctx context.Context, req *api.SetGatewayTargetSubresourceNameRequest) (*api.Gateway, error)

SetGatewayTargetSubresourceName changes the TargetSubresourceName field of gateway.Gateway and returns the updated version of gateway.Gateway.

In Connect this is used to update the db name of a db connection along with the CLI command.

func (*Handler) TransferFile

func (s *Handler) TransferFile(request *api.FileTransferRequest, server api.TerminalService_TransferFileServer) error

func (*Handler) UpdateHeadlessAuthenticationState

UpdateHeadlessAuthenticationState logs in a user to a cluster

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL