auth

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthManager

type AuthManager interface {
	// Cluster authentication lifecycle
	EnsureClusterAuth(ctx context.Context, cluster *clusterv1.Cluster) error
	DeleteClusterAuth(ctx context.Context, cluster *clusterv1.Cluster) error
	GetClusterPassword(ctx context.Context, cluster *clusterv1.Cluster) (string, error)

	// Cleanup
	DeleteGatewaySecrets(ctx context.Context) error
}

AuthManager manages authentication secrets for observability services

func NewAuthManager

func NewAuthManager(client client.Client, config Config) AuthManager

NewAuthManager creates a new auth manager with config for managing htpasswd secrets

type AuthType

type AuthType string

AuthType represents the type of observability authentication

const (
	// Auth types
	AuthTypeMetrics AuthType = "metrics"
	AuthTypeLogs    AuthType = "logs"
	AuthTypeTraces  AuthType = "traces"

	// Gateway secret data keys (supporting migration from Ingress to Gateway API)
	IngressDataKey   = "auth"
	HTTPRouteDataKey = ".htpasswd"
)

type Config

type Config struct {
	// Auth type (metrics, logs, traces)
	AuthType AuthType

	// Gateway secret configuration
	GatewaySecrets GatewaySecretsConfig
}

func NewConfig

func NewConfig(authType AuthType, gatewaySecretsNamespace, ingressSecretName, httprouteSecretName string) Config

NewConfig creates a new auth configuration

type GatewaySecretsConfig

type GatewaySecretsConfig struct {
	// Namespace where gateway secrets are created
	Namespace string

	// Ingress secret name and data key (legacy)
	IngressSecretName string
	IngressDataKey    string

	// HTTPRoute secret name and data key (Gateway API)
	HTTPRouteSecretName string
	HTTPRouteDataKey    string
}

GatewaySecretsConfig contains configuration for gateway authentication secrets

type PasswordGenerator

type PasswordGenerator interface {
	GeneratePassword(length int) (string, error)
	GenerateHtpasswd(username, password string) (string, error)
}

PasswordGenerator generates passwords and htpasswd entries

func NewPasswordGenerator

func NewPasswordGenerator() PasswordGenerator

NewPasswordGenerator creates a new password generator

Jump to

Keyboard shortcuts

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