Documentation ¶
Index ¶
- type AccessRequest
- type App
- type Cluster
- func (c *Cluster) AssumeRole(ctx context.Context, req *api.AssumeRoleRequest) error
- func (c *Cluster) Connected() bool
- func (c *Cluster) CreateAccessRequest(ctx context.Context, req *api.CreateAccessRequestRequest) (*AccessRequest, error)
- func (c *Cluster) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error)
- func (c *Cluster) DeleteAccessRequest(ctx context.Context, req *api.DeleteAccessRequestRequest) error
- func (c *Cluster) GetAccessRequests(ctx context.Context, req types.AccessRequestFilter) ([]AccessRequest, error)
- func (c *Cluster) GetAllDatabases(ctx context.Context) ([]Database, error)
- func (c *Cluster) GetAllKubes(ctx context.Context) ([]Kube, error)
- func (c *Cluster) GetAllServers(ctx context.Context) ([]Server, error)
- func (c *Cluster) GetAllowedDatabaseUsers(ctx context.Context, dbURI string) ([]string, error)
- func (c *Cluster) GetApps(ctx context.Context) ([]App, error)
- func (c *Cluster) GetClusterFeatures(ctx context.Context) (*proto.Features, error)
- func (c *Cluster) GetDatabase(ctx context.Context, dbURI string) (*Database, error)
- func (c *Cluster) GetDatabases(ctx context.Context, r *api.GetDatabasesRequest) (*GetDatabasesResponse, error)
- func (c *Cluster) GetKubes(ctx context.Context, r *api.GetKubesRequest) (*GetKubesResponse, error)
- func (c *Cluster) GetLeafClusters(ctx context.Context) ([]LeafCluster, error)
- func (c *Cluster) GetLoggedInUser() LoggedInUser
- func (c *Cluster) GetProxyHost() string
- func (c *Cluster) GetRequestableRoles(ctx context.Context, req *api.GetRequestableRolesRequest) (*types.AccessCapabilities, error)
- func (c *Cluster) GetRoles(ctx context.Context) ([]*types.Role, error)
- func (c *Cluster) GetServers(ctx context.Context, r *api.GetServersRequest) (*GetServersResponse, error)
- func (c *Cluster) LocalLogin(ctx context.Context, user, password, otpToken string) error
- func (c *Cluster) Logout(ctx context.Context) error
- func (c *Cluster) PasswordlessLogin(ctx context.Context, stream api.TerminalService_LoginPasswordlessServer) error
- func (c *Cluster) ReissueDBCerts(ctx context.Context, routeToDatabase tlsca.RouteToDatabase) error
- func (c *Cluster) ReviewAccessRequest(ctx context.Context, req *api.ReviewAccessRequestRequest) (*AccessRequest, error)
- func (c *Cluster) SSOLogin(ctx context.Context, providerType, providerName string) error
- func (c *Cluster) SyncAuthPreference(ctx context.Context) (*webclient.WebConfigAuthSettings, error)
- func (c *Cluster) TransferFile(ctx context.Context, request *api.FileTransferRequest, ...) error
- type Config
- type CreateGatewayParams
- type Database
- type DbcmdCLICommandProvider
- type FileTransferProgressSender
- type GatewayCreator
- type GetDatabasesResponse
- type GetKubesResponse
- type GetServersResponse
- type Kube
- type LeafCluster
- type LoggedInUser
- type Resolver
- type SSHLoginFunc
- type Server
- type Storage
- func (s *Storage) Add(ctx context.Context, webProxyAddress string) (*Cluster, error)
- func (s *Storage) GetByResourceURI(resourceURI string) (*Cluster, error)
- func (s *Storage) GetByURI(clusterURI string) (*Cluster, error)
- func (s *Storage) ReadAll() ([]*Cluster, error)
- func (s *Storage) Remove(ctx context.Context, profileName string) error
- func (s *Storage) ResolveCluster(resourceURI string) (*Cluster, error)
- type StorageByResourceURI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessRequest ¶
type AccessRequest struct { URI uri.ResourceURI types.AccessRequest }
type App ¶
type App struct { // URI is the app URI URI uri.ResourceURI types.Application }
App describes an app
type Cluster ¶
type Cluster struct { // URI is the cluster URI URI uri.ResourceURI // Name is the cluster name Name string // ProfileName is the name of the tsh profile ProfileName string // Log is a component logger Log *logrus.Entry // Auth server features // only present where the auth client can be queried // and set with GetClusterFeatures Features *proto.Features // contains filtered or unexported fields }
Cluster describes user settings and access to various resources.
func (*Cluster) AssumeRole ¶
func (*Cluster) CreateAccessRequest ¶
func (c *Cluster) CreateAccessRequest(ctx context.Context, req *api.CreateAccessRequestRequest) (*AccessRequest, error)
Creates an access request.
func (*Cluster) CreateGateway ¶
func (c *Cluster) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error)
CreateGateway creates a gateway
func (*Cluster) DeleteAccessRequest ¶
func (*Cluster) GetAccessRequests ¶
func (c *Cluster) GetAccessRequests(ctx context.Context, req types.AccessRequestFilter) ([]AccessRequest, error)
Returns all access requests available to the user.
func (*Cluster) GetAllDatabases ¶
GetDatabases returns databases
func (*Cluster) GetAllKubes ¶
GetAllKubes returns kube services
func (*Cluster) GetAllServers ¶
GetAllServers returns a full list of servers without pagination or sorting.
func (*Cluster) GetAllowedDatabaseUsers ¶
GetAllowedDatabaseUsers returns allowed users for the given database based on the role set.
func (*Cluster) GetClusterFeatures ¶
GetClusterFeatures returns a list of features enabled/disabled by the auth server
func (*Cluster) GetDatabase ¶
GetDatabase returns a database
func (*Cluster) GetDatabases ¶
func (c *Cluster) GetDatabases(ctx context.Context, r *api.GetDatabasesRequest) (*GetDatabasesResponse, error)
func (*Cluster) GetKubes ¶
func (c *Cluster) GetKubes(ctx context.Context, r *api.GetKubesRequest) (*GetKubesResponse, error)
GetKubes returns a paginated kubes list
func (*Cluster) GetLeafClusters ¶
func (c *Cluster) GetLeafClusters(ctx context.Context) ([]LeafCluster, error)
GetLeafClusters returns leaf clusters
func (*Cluster) GetLoggedInUser ¶
func (c *Cluster) GetLoggedInUser() LoggedInUser
GetLoggedInUser returns currently logged-in user
func (*Cluster) GetProxyHost ¶
GetProxyHost returns proxy address (host:port) of the cluster
func (*Cluster) GetRequestableRoles ¶
func (c *Cluster) GetRequestableRoles(ctx context.Context, req *api.GetRequestableRolesRequest) (*types.AccessCapabilities, error)
GetRequestableRoles returns the requestable roles for the currently logged-in user
func (*Cluster) GetServers ¶
func (c *Cluster) GetServers(ctx context.Context, r *api.GetServersRequest) (*GetServersResponse, error)
GetServers returns a paginated list of servers.
func (*Cluster) LocalLogin ¶
LocalLogin processes local logins for this cluster
func (*Cluster) PasswordlessLogin ¶
func (c *Cluster) PasswordlessLogin(ctx context.Context, stream api.TerminalService_LoginPasswordlessServer) error
PasswordlessLogin processes passwordless logins for this cluster.
func (*Cluster) ReissueDBCerts ¶
ReissueDBCerts issues new certificates for specific DB access and saves them to disk.
func (*Cluster) ReviewAccessRequest ¶
func (c *Cluster) ReviewAccessRequest(ctx context.Context, req *api.ReviewAccessRequestRequest) (*AccessRequest, error)
func (*Cluster) SSOLogin ¶
SSOLogin logs in a user to the Teleport cluster using supported SSO provider
func (*Cluster) SyncAuthPreference ¶
SyncAuthPreference fetches Teleport auth preferences and stores it in the cluster profile
func (*Cluster) TransferFile ¶
func (c *Cluster) TransferFile(ctx context.Context, request *api.FileTransferRequest, sendProgress FileTransferProgressSender) error
type 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.Entry }
Config is the cluster service config
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults checks the configuration for its validity and sets default values if needed
type CreateGatewayParams ¶
type CreateGatewayParams struct { // TargetURI is the cluster resource URI TargetURI string // TargetUser is the target user name TargetUser string // TargetSubresourceName points at a subresource of the remote resource, for example a database // name on a database server. TargetSubresourceName string // LocalPort is the gateway local port LocalPort string CLICommandProvider gateway.CLICommandProvider TCPPortAllocator gateway.TCPPortAllocator OnExpiredCert gateway.OnExpiredCertFunc }
type Database ¶
type Database struct { // URI is the database URI URI uri.ResourceURI types.Database }
Database describes database
type DbcmdCLICommandProvider ¶
type DbcmdCLICommandProvider struct {
// contains filtered or unexported fields
}
DbcmdCLICommandProvider provides CLI commands for database gateways. It needs Storage to read fresh profile state from the disk.
func NewDbcmdCLICommandProvider ¶
func NewDbcmdCLICommandProvider(storage StorageByResourceURI, execer dbcmd.Execer) DbcmdCLICommandProvider
func (DbcmdCLICommandProvider) GetCommand ¶
func (d DbcmdCLICommandProvider) GetCommand(gateway *gateway.Gateway) (string, error)
type FileTransferProgressSender ¶
type FileTransferProgressSender = func(progress *api.FileTransferProgress) error
type GatewayCreator ¶
type GatewayCreator struct {
// contains filtered or unexported fields
}
func NewGatewayCreator ¶
func NewGatewayCreator(resolver Resolver) GatewayCreator
func (GatewayCreator) CreateGateway ¶
func (g GatewayCreator) CreateGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error)
type GetDatabasesResponse ¶
type GetKubesResponse ¶
type GetServersResponse ¶
type Kube ¶
type Kube struct { // URI is the kube URI URI uri.ResourceURI KubernetesCluster types.KubeCluster }
Kube describes kubernetes service
type LeafCluster ¶
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 }
LeafCluster describes a leaf (trusted) cluster
type LoggedInUser ¶
type LoggedInUser struct { // Name is the user name Name string // SSHLogins is the user sshlogins SSHLogins []string // Roles is the user roles Roles []string // ActiveRequests is the user active requests ActiveRequests []string }
LoggedInUser is the currently logged-in user
type SSHLoginFunc ¶
type SSHLoginFunc func(context.Context, *keys.PrivateKey) (*auth.SSHLoginResponse, error)
type Server ¶
type Server struct { // URI is the database URI URI uri.ResourceURI types.Server }
Database describes database
type Storage ¶
type Storage struct {
Config
}
Storage is the cluster storage
func NewStorage ¶
NewStorage creates an instance of Cluster profile storage.
func (*Storage) GetByResourceURI ¶
GetByResourceURI returns a cluster by a URI of its resource. Accepts both root and leaf cluster resources and will return a root or leaf cluster accordingly.