config

package
v0.0.0-...-914c13f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MatcherOr  = MatcherOp("or")
	MatcherAnd = MatcherOp("and")
)

Variables

This section is empty.

Functions

func NewServerConfig

func NewServerConfig(logger log.Logger, certFile, keyFile, minVersion string, cipherSuites []string) (*tls.Config, error)

NewServerConfig provides new server TLS configuration.

Types

type Config

type Config struct {
	KubeconfigPath string
	DebugToken     string
	Name           string
	Mappings       map[string]string

	LogFormat string
	LogLevel  level.Option

	Opa       OPAConfig
	Server    ServerConfig
	TLS       TLSConfig
	Memcached MemcachedConfig
}

func ParseFlags

func ParseFlags() (*Config, error)

type Matcher

type Matcher struct {
	Keys      []string
	MatcherOp MatcherOp
	// contains filtered or unexported fields
}

func EmptyMatcher

func EmptyMatcher() *Matcher

func (*Matcher) ForRequest

func (m *Matcher) ForRequest(tenant string, groups []string) *Matcher

func (*Matcher) IsEmpty

func (m *Matcher) IsEmpty() bool

func (*Matcher) IsSingle

func (m *Matcher) IsSingle() bool

type MatcherOp

type MatcherOp string

type MemcachedConfig

type MemcachedConfig struct {
	Expire   int32
	Interval int32
	Servers  []string
}

type OPAConfig

type OPAConfig struct {
	Pkg                string
	Rule               string
	Matcher            string
	MatcherOp          string
	MatcherSkipTenants string
	MatcherAdminGroups string
}

func (*OPAConfig) ToMatcher

func (c *OPAConfig) ToMatcher() Matcher

type ServerConfig

type ServerConfig struct {
	Listen         string
	ListenInternal string
	HealthcheckURL string
}

type TLSConfig

type TLSConfig struct {
	MinVersion   string
	CipherSuites []string

	ServerCertFile string
	ServerKeyFile  string

	InternalServerCertFile string
	InternalServerKeyFile  string
	InternalServerCAFile   string
}

Jump to

Keyboard shortcuts

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