Documentation
¶
Index ¶
- func BuildConfig(ctx context.Context, host string, auth *gatewayv1alpha1.AuthConfig, ...) (*rest.Config, error)
- func BuildConfigFromMetadata(host string, authType, token, kubeconfig, certData, keyData, caData string) (*rest.Config, error)
- func ConfigureAuthentication(ctx context.Context, config *rest.Config, auth *gatewayv1alpha1.AuthConfig, ...) error
- func ConfigureFromKubeconfig(config *rest.Config, kubeconfigData []byte) error
- func ExtractAuthFromKubeconfig(config *rest.Config, authInfo *api.AuthInfo) error
- func ExtractCAData(ctx context.Context, ca *gatewayv1alpha1.CAConfig, k8sClient client.Client) ([]byte, error)
- func InjectClusterMetadata(ctx context.Context, schemaJSON []byte, config MetadataInjectionConfig, ...) ([]byte, error)
- func InjectKCPMetadataFromEnv(schemaJSON []byte, clusterPath string, log *logger.Logger, ...) ([]byte, error)
- type MetadataInjectionConfig
- type MetadataInjector
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 ¶
ConfigureFromKubeconfig configures authentication from kubeconfig data
func ExtractAuthFromKubeconfig ¶
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
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