authenticate

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package authenticate contains the commands to manage authentication in Liqo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	LocalClusterID  liqov1beta1.ClusterID
	RemoteClusterID liqov1beta1.ClusterID

	TenantNamespace string
	// contains filtered or unexported fields
}

Cluster contains the information about a cluster.

func NewCluster

func NewCluster(local *factory.Factory) *Cluster

NewCluster returns a new Cluster struct.

func (*Cluster) EnsureIdentity

func (c *Cluster) EnsureIdentity(ctx context.Context, identity *authv1beta1.Identity) error

EnsureIdentity apply the identity resource on the consumer cluster and wait for the status to be updated.

func (*Cluster) EnsureNonce

func (c *Cluster) EnsureNonce(ctx context.Context) ([]byte, error)

EnsureNonce ensure the presence of a secret containing the nonce for the authentication challenge of a consumer cluster.

func (*Cluster) EnsureSignedNonce

func (c *Cluster) EnsureSignedNonce(ctx context.Context, nonce []byte) ([]byte, error)

EnsureSignedNonce ensure the presence of a secret containing the signed nonce of the authentication challenge and return the signed nonce.

func (*Cluster) EnsureTenant

func (c *Cluster) EnsureTenant(ctx context.Context, tenant *authv1beta1.Tenant) error

EnsureTenant apply the tenant resource on the provider cluster and wait for the status to be updated.

func (*Cluster) EnsureTenantNamespace

func (c *Cluster) EnsureTenantNamespace(ctx context.Context, remoteClusterID liqov1beta1.ClusterID) error

EnsureTenantNamespace ensure the presence of the tenant namespace on the local cluster given a remote cluster id.

func (*Cluster) GenerateIdentity

func (c *Cluster) GenerateIdentity(ctx context.Context, remoteTenantNamespace string) (*authv1beta1.Identity, error)

GenerateIdentity generate the identity resource to be applied on the consumer cluster.

func (*Cluster) GenerateTenant

func (c *Cluster) GenerateTenant(ctx context.Context, signedNonce []byte, proxyURL *string) (*authv1beta1.Tenant, error)

GenerateTenant generate the tenant resource to be applied on the provider cluster.

func (*Cluster) GetAPIServerProxyRemappedIP

func (c *Cluster) GetAPIServerProxyRemappedIP(ctx context.Context) (string, error)

GetAPIServerProxyRemappedIP get the remapped IP of the API server proxy of the cluster.

func (*Cluster) RemapIPExternalCIDR

func (c *Cluster) RemapIPExternalCIDR(ctx context.Context, ip string) (string, error)

RemapIPExternalCIDR remaps the given IP address to the external CIDR of the remote cluster.

func (*Cluster) SetLocalClusterID

func (c *Cluster) SetLocalClusterID(ctx context.Context) error

SetLocalClusterID set the local cluster id retrieving it from the Liqo configmaps.

type Options

type Options struct {
	LocalFactory  *factory.Factory
	RemoteFactory *factory.Factory
	Timeout       time.Duration

	InBand   bool
	ProxyURL string
}

Options encapsulates the arguments of the authenticate command.

func NewOptions

func NewOptions(localFactory *factory.Factory) *Options

NewOptions returns a new Options struct.

func (*Options) RunAuthenticate

func (o *Options) RunAuthenticate(ctx context.Context) error

RunAuthenticate initializes the authentication with a provider cluster.

Jump to

Keyboard shortcuts

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