ingress

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0

Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAppendServerCA = errors.New("failed to append server ca to tls.Config")
	ErrAppendClientCA = errors.New("failed to append client ca to tls.Config")
)

Functions

func ConfigureCertificateAuthorities

func ConfigureCertificateAuthorities(tlsConfig *tls.Config, serverCAFile, clientCAFile string) (bool, error)

ConfigureCertificateAuthorities configures both root and client CAs for the TLS config Returns true if mTLS should be enabled (client CA is configured).

func ConfigureClientCA

func ConfigureClientCA(tlsConfig *tls.Config, clientCAFile string) (bool, error)

ConfigureClientCA configures the client CA certificates for the TLS config Returns true if client CA was configured, false otherwise.

func ConfigureRootCA

func ConfigureRootCA(tlsConfig *tls.Config, serverCAFile string) error

ConfigureRootCA configures the root CA certificates for the TLS config.

func LoadCertFile

func LoadCertFile(certFile string) ([]byte, error)

LoadCertFile loads certificate data from file path or returns empty byte slice if path is empty.

func LoadX509KeyPair

func LoadX509KeyPair(certfile, keyfile string) (tls.Certificate, error)

LoadX509KeyPair loads X.509 key pair from certificate and key files or data.

func ReadFileOrData

func ReadFileOrData(input string) ([]byte, error)

ReadFileOrData reads data from file if input looks like a file path, otherwise treats input as raw data.

Types

type ProxyConfig

type ProxyConfig struct {
	Port         string
	CertFile     string
	KeyFile      string
	ServerCAFile string
	ClientCAFile string
	AttestedTLS  bool
}

ProxyConfig contains configuration for starting a proxy instance.

func AgentConfigToProxyConfig

func AgentConfigToProxyConfig(cfg agent.AgentConfig) ProxyConfig

AgentConfigToProxyConfig converts agent.AgentConfig to ProxyConfig.

type ProxyContext

type ProxyContext struct {
	ID   string
	Name string
}

ProxyContext provides context information for logging and tracking.

func ComputationToProxyContext

func ComputationToProxyContext(cmp agent.Computation) ProxyContext

ComputationToProxyContext converts agent.Computation to ProxyContext.

type ProxyServer

type ProxyServer interface {
	Start(cfg ProxyConfig, ctx ProxyContext) error
	Stop() error
}

ProxyServer manages ingress proxy instances.

func NewProxyServer

func NewProxyServer(logger *slog.Logger, backendURL *url.URL, certProvider atls.CertificateProvider) ProxyServer

NewProxyServer creates a new ingress proxy server manager.

type TLSSetupResult

type TLSSetupResult struct {
	Config *tls.Config
	MTLS   bool
}

TLSSetupResult contains the result of TLS configuration setup.

func SetupRegularTLS

func SetupRegularTLS(certFile, keyFile, serverCAFile, clientCAFile string) (*TLSSetupResult, error)

SetupRegularTLS sets up TLS configuration using regular certificates.

Jump to

Keyboard shortcuts

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