Documentation
¶
Overview ¶
Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0
Copyright (c) Ultraviolet SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func ConfigureCertificateAuthorities(tlsConfig *tls.Config, serverCAFile, clientCAFile string) (bool, error)
- func ConfigureClientCA(tlsConfig *tls.Config, clientCAFile string) (bool, error)
- func ConfigureRootCA(tlsConfig *tls.Config, serverCAFile string) error
- func LoadCertFile(certFile string) ([]byte, error)
- func LoadX509KeyPair(certfile, keyfile string) (tls.Certificate, error)
- func ReadFileOrData(input string) ([]byte, error)
- type ProxyConfig
- type ProxyContext
- type ProxyServer
- type TLSSetupResult
Constants ¶
This section is empty.
Variables ¶
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 ¶
ConfigureClientCA configures the client CA certificates for the TLS config Returns true if client CA was configured, false otherwise.
func ConfigureRootCA ¶
ConfigureRootCA configures the root CA certificates for the TLS config.
func LoadCertFile ¶
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 ¶
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 ¶
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 ¶
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.