Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeTLSCipherSuiteHookFunc(from reflect.Type, to reflect.Type, data any) (any, error)
- func DecodeTLSMinVersionHookFunc(from reflect.Type, to reflect.Type, data any) (any, error)
- func StringToByteSizeHookFunc() mapstructure.DecodeHookFunc
- func ValidateConfigSchema(src io.Reader) error
- type BufferLimit
- type CORS
- type CacheConfig
- type Configuration
- type ConfigurationPath
- type ConnectionsLimit
- type DefaultRule
- type EnforcementSettings
- type EnvVarPrefix
- type KeyStore
- type LogFormat
- type LoggingConfig
- type ManagementConfig
- type Mechanism
- type MechanismConfig
- type MechanismPrototypes
- type MetricsConfig
- type OperationMode
- type ProfilingConfig
- type RespondConfig
- type ResponseOverride
- type RuleProviders
- type SecureDefaultRule
- type ServeConfig
- type TLS
- type TLSCipherSuites
- type TLSMinVersion
- type Timeout
- type TracingConfig
- type TrustStore
Constants ¶
View Source
const ( SpanProcessorSimple = "simple" SpanProcessorBatch = "batch" )
Variables ¶
View Source
var InsecureNetworks = []string{
"0.0.0.0/0",
"0/0",
"0000:0000:0000:0000:0000:0000:0000:0000/0",
"::/0",
}
Functions ¶
func StringToByteSizeHookFunc ¶
func StringToByteSizeHookFunc() mapstructure.DecodeHookFunc
func ValidateConfigSchema ¶ added in v0.16.0
Types ¶
type BufferLimit ¶
type CORS ¶
type CORS struct {
AllowedOrigins []string `koanf:"allowed_origins"`
AllowedMethods []string `koanf:"allowed_methods"`
AllowedHeaders []string `koanf:"allowed_headers"`
ExposedHeaders []string `koanf:"exposed_headers"`
AllowCredentials bool `koanf:"allow_credentials"`
MaxAge time.Duration `koanf:"max_age,string"`
}
type CacheConfig ¶
type Configuration ¶
type Configuration struct {
Serve ServeConfig `koanf:"serve"`
Management ManagementConfig `koanf:"management"`
Log LoggingConfig `koanf:"log"`
Tracing TracingConfig `koanf:"tracing"`
Metrics MetricsConfig `koanf:"metrics"`
Profiling ProfilingConfig `koanf:"profiling"`
Cache CacheConfig `koanf:"cache"`
Prototypes *MechanismPrototypes `koanf:"mechanisms,omitempty"`
Default *DefaultRule `koanf:"default_rule,omitempty"`
Providers RuleProviders `koanf:"providers,omitempty"`
SecretsReloadEnabled bool `koanf:"secrets_reload_enabled"`
}
func NewConfiguration ¶
func NewConfiguration( envPrefix EnvVarPrefix, configFile ConfigurationPath, validator validation.Validator, ) (*Configuration, error)
type ConfigurationPath ¶
type ConfigurationPath string
type ConnectionsLimit ¶
type DefaultRule ¶
type DefaultRule struct {
BacktrackingEnabled bool `koanf:"backtracking_enabled"`
Execute []MechanismConfig `koanf:"execute"`
ErrorHandler []MechanismConfig `koanf:"on_error"`
}
type EnforcementSettings ¶ added in v0.16.0
type EnforcementSettings struct {
EnforceSecureDefaultRule bool
EnforceSecureTrustedProxies bool
EnforceIngressTLS bool
EnforceEgressTLS bool
EnforceUpstreamTLS bool
}
func (EnforcementSettings) AlwaysValidate ¶ added in v0.16.0
func (v EnforcementSettings) AlwaysValidate() bool
func (EnforcementSettings) ErrorMessage ¶ added in v0.16.0
func (v EnforcementSettings) ErrorMessage(param string) string
func (EnforcementSettings) MessageTemplate ¶ added in v0.16.0
func (v EnforcementSettings) MessageTemplate() string
func (EnforcementSettings) Tag ¶ added in v0.16.0
func (v EnforcementSettings) Tag() string
type EnvVarPrefix ¶
type EnvVarPrefix string
type LoggingConfig ¶
type ManagementConfig ¶ added in v0.16.0
type ManagementConfig struct {
Host string `koanf:"host"`
Port int `koanf:"port"`
Timeout Timeout `koanf:"timeout"`
BufferLimit BufferLimit `koanf:"buffer_limit"`
CORS *CORS `koanf:"cors,omitempty"`
TLS *TLS `koanf:"tls,omitempty" validate:"enforced=notnil"`
}
func (ManagementConfig) Address ¶ added in v0.16.0
func (c ManagementConfig) Address() string
type Mechanism ¶
type Mechanism struct {
ID string `koanf:"id"`
Type string `koanf:"type"`
Config MechanismConfig `koanf:"config"`
Condition string `koanf:"if"`
}
type MechanismConfig ¶
func (*MechanismConfig) DeepCopyInto ¶
func (in *MechanismConfig) DeepCopyInto(out *MechanismConfig)
type MechanismPrototypes ¶
type MetricsConfig ¶
type MetricsConfig struct {
Enabled bool `koanf:"enabled"`
}
func (MetricsConfig) Address ¶
func (c MetricsConfig) Address() string
type ProfilingConfig ¶
type ProfilingConfig struct {
Enabled bool `koanf:"enabled"`
Host string `koanf:"host"`
Port int `koanf:"port"`
}
func (ProfilingConfig) Address ¶
func (c ProfilingConfig) Address() string
type RespondConfig ¶
type RespondConfig struct {
Verbose bool `koanf:"verbose"`
With struct {
Accepted ResponseOverride `koanf:"accepted"`
ArgumentError ResponseOverride `koanf:"argument_error"`
AuthenticationError ResponseOverride `koanf:"authentication_error"`
AuthorizationError ResponseOverride `koanf:"authorization_error"`
CommunicationError ResponseOverride `koanf:"communication_error"`
InternalError ResponseOverride `koanf:"internal_error"`
NoRuleError ResponseOverride `koanf:"no_rule_error"`
} `koanf:"with"`
}
type ResponseOverride ¶
type ResponseOverride struct {
Code int `koanf:"code"`
}
type RuleProviders ¶
type SecureDefaultRule ¶ added in v0.16.0
type SecureDefaultRule bool
type ServeConfig ¶
type ServeConfig struct {
Host string `koanf:"host"`
Port int `koanf:"port"`
Timeout Timeout `koanf:"timeout"`
BufferLimit BufferLimit `koanf:"buffer_limit"`
ConnectionsLimit ConnectionsLimit `koanf:"connections_limit"`
CORS *CORS `koanf:"cors,omitempty"`
TLS *TLS `koanf:"tls,omitempty" validate:"enforced=notnil"`
TrustedProxies []string `koanf:"trusted_proxies,omitempty" validate:"enforced=secure_networks"`
Respond RespondConfig `koanf:"respond"`
}
func (ServeConfig) Address ¶ added in v0.16.0
func (c ServeConfig) Address() string
type TLS ¶
type TLS struct {
KeyStore KeyStore `koanf:"key_store" mapstructure:"key_store"`
KeyID string `koanf:"key_id" mapstructure:"key_id"`
CipherSuites TLSCipherSuites `koanf:"cipher_suites" mapstructure:"cipher_suites"`
MinVersion TLSMinVersion `koanf:"min_version" mapstructure:"min_version"`
}
type TLSCipherSuites ¶
type TLSCipherSuites []uint16
func (TLSCipherSuites) OrDefault ¶
func (s TLSCipherSuites) OrDefault() []uint16
type TLSMinVersion ¶
type TLSMinVersion uint16
func (TLSMinVersion) OrDefault ¶
func (v TLSMinVersion) OrDefault() uint16
type TracingConfig ¶
type TrustStore ¶
type TrustStore struct {
Path string `koanf:"path" mapstructure:"path"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.