tlsowner

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package tlsowner decides which component terminates TLS for a hostname, so every surface reports one coherent certificate and ACME state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	Upstream    bool
	ACMEEnabled bool
	Custom      bool
	Route       *store.ProxyRouteStatus
}

Inputs are the stored facts Resolve decides from.

type Owner

type Owner string

Owner is the component whose certificate visitors actually receive.

const (
	ACME     Owner = "acme"
	Internal Owner = "internal"
	Proxy    Owner = "proxy"
	Custom   Owner = "custom"
)

Owners a hostname can have.

func Resolve

func Resolve(in Inputs) Owner

Resolve returns the effective TLS owner. A proxy that terminates TLS wins over everything stored here, because the ingress then serves plain HTTP.

type ProxyCert

type ProxyCert struct {
	Issuer   string
	NotAfter time.Time
}

ProxyCert is the certificate a fronting proxy was last seen serving.

type RouteReader

type RouteReader interface {
	ListProxyRouteStatus(ctx context.Context) ([]store.ProxyRouteStatus, error)
}

RouteReader lists the managed proxy routes and what each one serves.

type SettingsReader

type SettingsReader interface {
	GetIngressSettings(ctx context.Context) (store.IngressSettings, error)
}

SettingsReader is the ingress settings read this package needs.

type Snapshot

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

Snapshot is the stored TLS ownership state at one instant.

func Load

func Load(ctx context.Context, settings SettingsReader, routes RouteReader, custom map[string]bool) Snapshot

Load reads settings and route status. Either reader may be nil, and a read error leaves that part empty so ownership degrades to the ingress's own.

func (Snapshot) Owner

func (s Snapshot) Owner(domain string) Owner

Owner returns the effective owner of domain.

func (Snapshot) ProxyCert

func (s Snapshot) ProxyCert(domain string) (ProxyCert, bool)

ProxyCert returns the trusted certificate the proxy serves for domain.

func (Snapshot) ProxyHosts

func (s Snapshot) ProxyHosts() []string

ProxyHosts lists every tracked hostname a proxy owns.

func (Snapshot) ProxyManaged

func (s Snapshot) ProxyManaged(domain string) bool

ProxyManaged reports whether a proxy owns domain's certificate.

func (Snapshot) Suppressed

func (s Snapshot) Suppressed(domain string) bool

Suppressed reports whether a stored certificate for domain must be ignored: every host when TLS is upstream, else the proxy-owned ones.

func (Snapshot) Upstream

func (s Snapshot) Upstream() bool

Upstream reports whether a proxy terminates TLS for every host.

Jump to

Keyboard shortcuts

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