auth

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfig

func BuildConfig(ctx context.Context, host string, auth *gatewayv1alpha1.AuthConfig, ca *gatewayv1alpha1.CAConfig, k8sClient client.Client) (*rest.Config, error)

BuildConfig creates a rest.Config from cluster connection parameters This function unifies the authentication logic used by both listener and gateway

func BuildConfigFromMetadata

func BuildConfigFromMetadata(host string, authType, token, kubeconfig, certData, keyData, caData string) (*rest.Config, error)

BuildConfigFromMetadata creates a rest.Config from base64-encoded metadata (used by gateway)

func ConfigureAuthentication

func ConfigureAuthentication(ctx context.Context, config *rest.Config, auth *gatewayv1alpha1.AuthConfig, k8sClient client.Client) error

ConfigureAuthentication configures authentication for rest.Config from AuthConfig

func ConfigureFromKubeconfig

func ConfigureFromKubeconfig(config *rest.Config, kubeconfigData []byte) error

ConfigureFromKubeconfig configures authentication from kubeconfig data

func ExtractAuthFromKubeconfig

func ExtractAuthFromKubeconfig(config *rest.Config, authInfo *api.AuthInfo) error

ExtractAuthFromKubeconfig extracts authentication info from kubeconfig AuthInfo

func ExtractCAData

func ExtractCAData(ctx context.Context, ca *gatewayv1alpha1.CAConfig, k8sClient client.Client) ([]byte, error)

ExtractCAData extracts CA certificate data from secret or configmap references

func InjectClusterMetadata

func InjectClusterMetadata(ctx context.Context, schemaJSON []byte, config MetadataInjectionConfig, k8sClient client.Client, log *logger.Logger) ([]byte, error)

InjectClusterMetadata is a legacy wrapper for backward compatibility

func InjectKCPMetadataFromEnv

func InjectKCPMetadataFromEnv(schemaJSON []byte, clusterPath string, log *logger.Logger, hostOverride ...string) ([]byte, error)

InjectKCPMetadataFromEnv is a legacy wrapper for backward compatibility

Types

type MetadataInjectionConfig

type MetadataInjectionConfig struct {
	Host         string
	Path         string
	Auth         *gatewayv1alpha1.AuthConfig
	CA           *gatewayv1alpha1.CAConfig
	HostOverride string // For virtual workspaces
}

MetadataInjectionConfig contains configuration for metadata injection

type MetadataInjector

type MetadataInjector struct {
	// contains filtered or unexported fields
}

MetadataInjector provides metadata injection services with structured logging

func NewMetadataInjector

func NewMetadataInjector(log *logger.Logger, client client.Client) *MetadataInjector

NewMetadataInjector creates a new MetadataInjector service

func (*MetadataInjector) InjectClusterMetadata

func (m *MetadataInjector) InjectClusterMetadata(ctx context.Context, schemaJSON []byte, config MetadataInjectionConfig) ([]byte, error)

InjectClusterMetadata injects cluster metadata into schema JSON This unified function handles both KCP and ClusterAccess use cases

func (*MetadataInjector) InjectKCPMetadataFromEnv

func (m *MetadataInjector) InjectKCPMetadataFromEnv(schemaJSON []byte, clusterPath string, hostOverride ...string) ([]byte, error)

InjectKCPMetadataFromEnv injects KCP metadata using kubeconfig from environment This is a convenience function for KCP use cases

Jump to

Keyboard shortcuts

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