config

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnectorSchemer added in v1.4.1

func NewConnectorSchemer() *schemer.Schemer

NewConnectorSchemer returns a schemer.Schemer prepped with Connector schemas for validation and parsing.

func NewKerberosSchemer added in v1.4.1

func NewKerberosSchemer() *schemer.Schemer

NewKerberosSchema returns a schemer.Schemer prepped with Kerberos schemas for validation and parsing.

Types

type Admin added in v1.4.1

type Admin struct {
	SuperUser *SuperUser `json:"superUser"`
	API       *AdminAPI  `json:"api,omitempty"`
}

Admin holds configuration for the admin API.

type AdminAPI added in v0.9.0

type AdminAPI struct {
	// Cookies contain cookie settings for the csrf, session, and refresh cookies.
	Cookies *Cookies `json:"cookies,omitempty"`
	// Origins holds configuration for CORS origins. In addition, Origins other than the allowed ones
	// will be rejected with a 403 response.
	Origins *Origins `json:"origins,omitempty"`
	// TLS holds configuration for TLS settings for the admin API.
	TLS *ServerTLS `json:"tls,omitempty"`
}

AdminAPI holds configuration for the admin API.

type Auth added in v1.4.1

type Auth struct {
	Methods *AuthMethods `json:"methods"`
	Scheme  *AuthScheme  `json:"scheme"`
	Order   int          `json:"order"`
}

Auth holds configuration for authentication and authorization.

type AuthMapping added in v0.8.1

type AuthMapping struct {
	Backend       string   `json:"backend"`
	Method        string   `json:"method"`
	Exempt        []string `json:"exempt"`
	Authorization *AuthZ   `json:"authorization"`
}

AuthMapping contain the mapping between backend and method, as well as custom overrides for authN and authZ.

type AuthMethodBasic added in v0.8.1

type AuthMethodBasic struct {
	API *AuthMethodBasicAPI `json:"api,omitempty"`
}

AuthMethodBasic is the Kerberos basic authentication method, where manages user sessions.

type AuthMethodBasicAPI added in v1.3.0

type AuthMethodBasicAPI struct {
	Cookies *Cookies `json:"cookies,omitempty"`
	Origins *Origins `json:"origins,omitempty"`
}

AuthMethodBasicAPI contain settings for the administrative API side of the basic authentication mechanism.

type AuthMethods added in v0.8.1

type AuthMethods struct {
	Basic *AuthMethodBasic `json:"basic"`
}

AuthMethods contain the configured methods of authentication and authorization.

type AuthScheme added in v0.8.1

type AuthScheme struct {
	Mappings []*AuthMapping `json:"mappings"`
}

AuthScheme maps backends to AuthMethods.

type AuthZ added in v0.8.1

type AuthZ struct {
	Groups []string            `json:"groups"`
	Paths  map[string][]string `json:"paths"`
}

AuthZ specifies the authorization scheme for a backend.

type BackendTLS added in v0.9.0

type BackendTLS struct {
	// RootCAFile is the path to a PEM-encoded CA bundle used to verify the backend's certificate.
	// When empty, the system certificate pool is used.
	RootCAFile string `json:"rootCAFile,omitempty"`
	// ClientCertFile and ClientKeyFile enable mTLS.
	// Both must be set together.
	ClientCertFile string `json:"clientCertFile,omitempty"`
	ClientKeyFile  string `json:"clientKeyFile,omitempty"`
	// InsecureSkipVerify disables server certificate verification.
	// Must only be used in non-production environments.
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}

BackendTLS holds per-backend TLS settings. When nil, the forwarder uses plain HTTP for that backend.

type Connector added in v1.4.1

type Connector struct {
	// Origins holds configuration for CORS origins.
	Origins *Origins `json:"origins,omitempty"`

	// Persistence holds configuration for the persistence layer.
	Persistence *Persistence `json:"persistence"`

	// TLS holds configuration for the server TLS settings.
	TLS *ServerTLS `json:"tls,omitempty"`

	// TargetTLS holds configuration for the target TLS settings.
	TargetTLS *TargetTLS `json:"targetTls,omitempty"`
}

func NewConnector added in v1.4.1

func NewConnector() *Connector

NewConnector returns a *Connector config struct with defaults set.

type Cookies added in v1.3.0

type Cookies struct {
	// Domain is the domain setting for cookies, this translates directly to Domain=<value> for cookies.
	Domain string `json:"domain,omitempty"`
	// SameSite is the SameSite setting for cookies, this translates directly to SameSite=<value> for cookies.
	SameSite string `json:"sameSite,omitempty"`
}

type Gateway added in v1.4.1

type Gateway struct {
	Router *Router    `json:"router"`
	TLS    *ServerTLS `json:"tls,omitempty"`
}

Gateway holds configuration for the API gateway.

type Kerberos added in v1.4.1

type Kerberos struct {
	GatewayCfg     Gateway        `json:"gateway"`
	OASCfg         *OAS           `json:"oas,omitempty"`
	AuthCfg        *Auth          `json:"auth,omitempty"`
	AdminCfg       *Admin         `json:"admin,omitempty"`
	ObsCfg         *Observability `json:"observability,omitempty"`
	PersistenceCfg *Persistence   `json:"persistence,omitempty"`
}

Kerberos is the root configuration object for Kerberos.

func NewKerberos added in v1.4.1

func NewKerberos() *Kerberos

NewKerberos returns a *Kerberos with default values set, note that you need to call PostProcess after parsing as well.

func (*Kerberos) AuthEnabled added in v1.4.1

func (kc *Kerberos) AuthEnabled() bool

AuthEnabled returns true if auth is enabled.

func (*Kerberos) OASEnabled added in v1.4.1

func (kc *Kerberos) OASEnabled() bool

OASEnabled returns true if OAS validation is enabled.

func (*Kerberos) PostProcess added in v1.4.1

func (kc *Kerberos) PostProcess()

PostProcess tweaks some default values after parsing.

type OAS added in v1.4.1

type OAS struct {
	Order    int                  `json:"order"`
	Mappings []*OASBackendMapping `json:"mappings"`
}

OAS holds configuration for OAS-based request routing and validation.

type OASBackendMapping added in v0.8.1

type OASBackendMapping struct {
	Backend       string                 `json:"backend"`
	Specification string                 `json:"specification"`
	Options       *OASBackendMappingOpts `json:"options"`
}

type OASBackendMappingOpts added in v0.8.1

type OASBackendMappingOpts struct {
	ValidateBody bool `json:"validateBody"`
}

type Observability added in v1.4.1

type Observability struct {
	Enabled        bool `json:"enabled"`
	RuntimeMetrics bool `json:"runtimeMetrics"`
}

Observability holds configuration for observability features.

type Origins added in v1.3.0

type Origins struct {
	// AllowedOrigins is a list of allowed origins for CORS.
	AllowedOrigins []string `json:"allowedOrigins,omitempty"`
	// AllowAll indicates whether to allow all origins for CORS. Mutually exclusive with 'allowedOrigins'.
	// AllowAll will mean the Access-Control-Allow-Origin header is set to whatever Origin was received.
	AllowAll bool `json:"allowAll,omitempty"`
	// DenyAll denies any request with an Origin header, effectively disabling cross-site access.
	// Mutually exclusive with 'allowedOrigins' and 'allowAll'.
	DenyAll bool `json:"denyAll,omitempty"`
}

Origins holds configuration for CORS origins.

type Persistence added in v1.4.1

type Persistence struct {
	// Driver selects the database backend: "sqlite" or "postgres".
	Driver string `json:"driver"`
	// Address is the database address. For postgres: host. For sqlite: file path.
	Address string `json:"address"`

	// Postgres contains specific configuration for the postgres driver. Ignored for other drivers.
	*Postgres `json:"postgres,omitempty"`
}

Persistence holds configuration for the backing database.

type Postgres added in v0.10.0

type Postgres struct {
	// Database is the database name (postgres only).
	Database string `json:"database"`
	// Username is the database user (postgres only).
	Username *string `json:"username,omitempty"`
	// Password is the database password (postgres only).
	Password *string `json:"password,omitempty"`
	// SSLMode controls TLS for postgres connections (e.g. "disable", "require", "verify-full").
	SSLMode *string `json:"sslMode,omitempty"`
}

Postgres contains postgres-specific settings.

type Router added in v0.9.0

type Router struct {
	Backends []*RouterBackend `json:"backends"`
}

Router holds configuration for the request router.

type RouterBackend added in v0.8.1

type RouterBackend struct {
	Name      string `json:"name"`
	Host      string `json:"host"`
	Port      int    `json:"port"`
	TimeoutMs int    `json:"timeout,omitempty"`
	// Origins holds configuration for CORS origins. In addition, Origins other than the allowed ones
	// will be rejected with a 403 response.
	Origins *Origins    `json:"origins,omitempty"`
	TLS     *BackendTLS `json:"tls,omitempty"`
}

RouterBackend is a single router entry for a backend proxied by Kerberos.

type ServerTLS added in v0.9.0

type ServerTLS struct {
	CertFile string `json:"serverCertFile"`
	KeyFile  string `json:"serverKeyFile"`
}

type SuperUser added in v0.8.1

type SuperUser struct {
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

SuperUser contains the provisioned credentials for the kerbeos super user.

type TargetTLS added in v1.3.3

type TargetTLS struct {
	// RootCAFile is the path to a PEM-encoded CA bundle used to verify the target's certificate.
	// When empty, the system certificate pool is used.
	RootCAFile string `json:"rootCAFile,omitempty"`
	// InsecureSkipVerify indicates whether to skip TLS verification for the target.
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}

Jump to

Keyboard shortcuts

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