teleport

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(ctx context.Context, log logr.Logger, cluster *capi.Cluster, ctrlClient client.Client) error

func RemoveFinalizer

func RemoveFinalizer(ctx context.Context, log logr.Logger, cluster *capi.Cluster, ctrlClient client.Client) error

Types

type Client

type Client interface {
	Ping(ctx context.Context) (proto.PingResponse, error)
	GetToken(ctx context.Context, name string) (types.ProvisionToken, error)
	GetTokens(ctx context.Context) ([]types.ProvisionToken, error)
	CreateToken(ctx context.Context, token types.ProvisionToken) error
	UpsertToken(ctx context.Context, token types.ProvisionToken) error
	DeleteToken(ctx context.Context, name string) error
}

func NewClient

func NewClient(ctx context.Context, proxyAddr, identityFile string) (Client, error)

type SecretConfig

type SecretConfig struct {
	ProxyAddr             string
	IdentityFile          string
	TeleportVersion       string
	ManagementClusterName string
	AppName               string
	AppVersion            string
	AppCatalog            string
}

func GetConfigFromSecret

func GetConfigFromSecret(ctx context.Context, ctrlClient client.Client, namespace string) (*SecretConfig, error)

type Teleport

type Teleport struct {
	SecretConfig   *SecretConfig
	TeleportClient Client
	Namespace      string
	TokenGenerator token.Generator
}

func New

func New(namespace string, secretConfig *SecretConfig, tokenGenerator token.Generator) *Teleport

func (*Teleport) CreateConfigMap

func (t *Teleport) CreateConfigMap(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string, registerName string, token string) error

func (*Teleport) CreateSecret

func (t *Teleport) CreateSecret(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string, token string) error

func (*Teleport) DeleteConfigMap

func (t *Teleport) DeleteConfigMap(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string) error

func (*Teleport) DeleteSecret

func (t *Teleport) DeleteSecret(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string) error

func (*Teleport) DeleteToken

func (t *Teleport) DeleteToken(ctx context.Context, log logr.Logger, registerName string) error

func (*Teleport) GenerateToken

func (t *Teleport) GenerateToken(ctx context.Context, registerName string, tokenType string) (string, error)

func (*Teleport) GetConfigMap

func (t *Teleport) GetConfigMap(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string) (*corev1.ConfigMap, error)

func (*Teleport) GetSecret

func (t *Teleport) GetSecret(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string) (*corev1.Secret, error)

func (*Teleport) GetTokenFromConfigMap

func (t *Teleport) GetTokenFromConfigMap(ctx context.Context, configMap *corev1.ConfigMap) (string, error)

func (*Teleport) GetTokenFromSecret

func (t *Teleport) GetTokenFromSecret(ctx context.Context, secret *corev1.Secret) (string, error)

func (*Teleport) IsTokenValid

func (t *Teleport) IsTokenValid(ctx context.Context, registerName string, oldToken string, tokenType string) (bool, error)

func (*Teleport) UpdateConfigMap

func (t *Teleport) UpdateConfigMap(ctx context.Context, log logr.Logger, ctrlClient client.Client, configMap *corev1.ConfigMap, token string) error

func (*Teleport) UpdateSecret

func (t *Teleport) UpdateSecret(ctx context.Context, log logr.Logger, ctrlClient client.Client, clusterName string, clusterNamespace string, token string) error

Jump to

Keyboard shortcuts

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