sambox

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateLeafCert

func GenerateLeafCert(sni string, ca *CA, priv *rsa.PrivateKey) (*tls.Certificate, error)

Types

type CA

type CA struct {
	CertBytes   []byte
	Certificate *x509.Certificate
	PrivateKey  *rsa.PrivateKey
}

func GenerateEphemeralCA

func GenerateEphemeralCA() (*CA, error)

type CertCache

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

func NewCertCache

func NewCertCache() *CertCache

func (*CertCache) GetCertificate

func (c *CertCache) GetCertificate(sni string, ca *CA) (*tls.Certificate, error)

type Gateway

type Gateway struct {
	CA              *CA
	CertCache       *CertCache
	SecretStore     map[string]SecretConfig
	Transport       http.RoundTripper
	InterceptorsDir string
	// contains filtered or unexported fields
}

func NewGateway

func NewGateway(secretStore map[string]SecretConfig, transport http.RoundTripper, interceptorsDir string) (*Gateway, error)

func (*Gateway) Serve

func (g *Gateway) Serve(listener net.Listener) error

type SecretConfig

type SecretConfig struct {
	Kind       SecretKind `yaml:"kind" json:"kind"`
	HeaderName string     `yaml:"header_name" json:"header_name"`
	Value      string     `yaml:"value" json:"value"`
}

type SecretKind

type SecretKind string
const (
	SecretKindBearer       SecretKind = "bearer"
	SecretKindCustomHeader SecretKind = "customheader"
	SecretKindBasicAuth    SecretKind = "basicauth"
)

Jump to

Keyboard shortcuts

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