configuration

package
v0.0.0-...-136a2fa Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForbiddenStrategyErrorType = "forbidden"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key = string
const (
	ProxyReadTimeout                    Key = "serve.proxy.timeout.read"
	ProxyWriteTimeout                   Key = "serve.proxy.timeout.write"
	ProxyIdleTimeout                    Key = "serve.proxy.timeout.idle"
	ProxyServeAddressHost               Key = "serve.proxy.host"
	ProxyServeAddressPort               Key = "serve.proxy.port"
	APIServeAddressHost                 Key = "serve.api.host"
	APIServeAddressPort                 Key = "serve.api.port"
	APIReadTimeout                      Key = "serve.api.timeout.read"
	APIWriteTimeout                     Key = "serve.api.timeout.write"
	APIIdleTimeout                      Key = "serve.api.timeout.idle"
	PrometheusServeAddressHost          Key = "serve.prometheus.host"
	PrometheusServeAddressPort          Key = "serve.prometheus.port"
	PrometheusServeMetricsPath          Key = "serve.prometheus.metrics_path"
	PrometheusServeMetricsNamePrefix    Key = "serve.prometheus.metric_name_prefix"
	PrometheusServeHideRequestPaths     Key = "serve.prometheus.hide_request_paths"
	PrometheusServeCollapseRequestPaths Key = "serve.prometheus.collapse_request_paths"
	AccessRuleRepositories              Key = "access_rules.repositories"
	AccessRuleMatchingStrategy          Key = "access_rules.matching_strategy"
)
const (
	AuthorizerAllowIsEnabled            Key = "authorizers.allow.enabled"
	AuthorizerDenyIsEnabled             Key = "authorizers.deny.enabled"
	AuthorizerKetoEngineACPORYIsEnabled Key = "authorizers.keto_engine_acp_ory.enabled"
	AuthorizerRemoteIsEnabled           Key = "authorizers.remote.enabled"
	AuthorizerRemoteJSONIsEnabled       Key = "authorizers.remote_json.enabled"
)

Authorizers

const (
	MutatorCookieIsEnabled   Key = "mutators.cookie.enabled"
	MutatorHeaderIsEnabled   Key = "mutators.header.enabled"
	MutatorNoopIsEnabled     Key = "mutators.noop.enabled"
	MutatorHydratorIsEnabled Key = "mutators.hydrator.enabled"
	MutatorIDTokenIsEnabled  Key = "mutators.id_token.enabled"
	MutatorIDTokenJWKSURL    Key = "mutators.id_token.config.jwks_url"
)

Mutators

const (
	// anonymous
	AuthenticatorAnonymousIsEnabled Key = "authenticators.anonymous.enabled"

	// noop
	AuthenticatorNoopIsEnabled Key = "authenticators.noop.enabled"

	// cookie session
	AuthenticatorCookieSessionIsEnabled Key = "authenticators.cookie_session.enabled"

	// jwt
	AuthenticatorJwtIsEnabled  Key = "authenticators.jwt.enabled"
	AuthenticatorJwtJwkMaxWait Key = "authenticators.jwt.config.jwks_max_wait"
	AuthenticatorJwtJwkTtl     Key = "authenticators.jwt.config.jwks_ttl"

	// oauth2_client_credentials
	AuthenticatorOAuth2ClientCredentialsIsEnabled Key = "authenticators.oauth2_client_credentials.enabled"

	// oauth2_token_introspection
	AuthenticatorOAuth2TokenIntrospectionIsEnabled Key = "authenticators.oauth2_introspection.enabled"

	// unauthorized
	AuthenticatorUnauthorizedIsEnabled Key = "authenticators.unauthorized.enabled"
)

Authenticators

const (
	ErrorsHandlers                 Key = "errors.handlers"
	ErrorsFallback                 Key = "errors.fallback"
	ErrorsJSONIsEnabled            Key = ErrorsHandlers + ".json.enabled"
	ErrorsRedirectIsEnabled        Key = ErrorsHandlers + ".redirect.enabled"
	ErrorsWWWAuthenticateIsEnabled Key = ErrorsHandlers + ".www_authenticate.enabled"
)

Errors

type KoanfProvider

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

func NewKoanfProvider

func NewKoanfProvider(ctx context.Context, flags *pflag.FlagSet, l *logrusx.Logger, opts ...configx.OptionModifier) (kp *KoanfProvider, err error)

func (*KoanfProvider) APIIdleTimeout

func (v *KoanfProvider) APIIdleTimeout() time.Duration

func (*KoanfProvider) APIReadTimeout

func (v *KoanfProvider) APIReadTimeout() time.Duration

func (*KoanfProvider) APIServeAddress

func (v *KoanfProvider) APIServeAddress() string

func (*KoanfProvider) APIWriteTimeout

func (v *KoanfProvider) APIWriteTimeout() time.Duration

func (*KoanfProvider) AccessRuleMatchingStrategy

func (v *KoanfProvider) AccessRuleMatchingStrategy() MatchingStrategy

AccessRuleMatchingStrategy returns current MatchingStrategy.

func (*KoanfProvider) AccessRuleRepositories

func (v *KoanfProvider) AccessRuleRepositories() []url.URL

func (*KoanfProvider) AddWatcher

func (v *KoanfProvider) AddWatcher(cb callback) SubscriptionID

AddWatcher ensures that the callback is called when the configuration changes. The returned subscription can be used to remove the watcher.

func (*KoanfProvider) AllSettings

func (v *KoanfProvider) AllSettings() map[string]interface{}

func (*KoanfProvider) AuthenticatorConfig

func (v *KoanfProvider) AuthenticatorConfig(id string, override json.RawMessage, dest interface{}) error

func (*KoanfProvider) AuthenticatorIsEnabled

func (v *KoanfProvider) AuthenticatorIsEnabled(id string) bool

func (*KoanfProvider) AuthenticatorJwtJwkMaxWait

func (v *KoanfProvider) AuthenticatorJwtJwkMaxWait() time.Duration

func (*KoanfProvider) AuthenticatorJwtJwkTtl

func (v *KoanfProvider) AuthenticatorJwtJwkTtl() time.Duration

func (*KoanfProvider) AuthorizerConfig

func (v *KoanfProvider) AuthorizerConfig(id string, override json.RawMessage, dest interface{}) error

func (*KoanfProvider) AuthorizerIsEnabled

func (v *KoanfProvider) AuthorizerIsEnabled(id string) bool

func (*KoanfProvider) CORS

func (v *KoanfProvider) CORS(iface string) (cors.Options, bool)

func (*KoanfProvider) CORSEnabled

func (v *KoanfProvider) CORSEnabled(iface string) bool

func (*KoanfProvider) CORSOptions

func (v *KoanfProvider) CORSOptions(iface string) cors.Options

func (*KoanfProvider) ErrorHandlerConfig

func (v *KoanfProvider) ErrorHandlerConfig(id string, override json.RawMessage, dest interface{}) error

func (*KoanfProvider) ErrorHandlerFallbackSpecificity

func (v *KoanfProvider) ErrorHandlerFallbackSpecificity() []string

func (*KoanfProvider) ErrorHandlerIsEnabled

func (v *KoanfProvider) ErrorHandlerIsEnabled(id string) bool

func (*KoanfProvider) Get

func (v *KoanfProvider) Get(k Key) interface{}

func (*KoanfProvider) JSONWebKeyURLs

func (v *KoanfProvider) JSONWebKeyURLs() []string

func (*KoanfProvider) MutatorConfig

func (v *KoanfProvider) MutatorConfig(id string, override json.RawMessage, dest interface{}) error

func (*KoanfProvider) MutatorIsEnabled

func (v *KoanfProvider) MutatorIsEnabled(id string) bool

func (*KoanfProvider) ParseURLs

func (v *KoanfProvider) ParseURLs(sources []string) ([]url.URL, error)

func (*KoanfProvider) PipelineConfig

func (v *KoanfProvider) PipelineConfig(prefix, id string, override json.RawMessage, dest interface{}) error

func (*KoanfProvider) PrometheusCollapseRequestPaths

func (v *KoanfProvider) PrometheusCollapseRequestPaths() bool

func (*KoanfProvider) PrometheusHideRequestPaths

func (v *KoanfProvider) PrometheusHideRequestPaths() bool

func (*KoanfProvider) PrometheusMetricsNamePrefix

func (v *KoanfProvider) PrometheusMetricsNamePrefix() string

func (*KoanfProvider) PrometheusMetricsPath

func (v *KoanfProvider) PrometheusMetricsPath() string

func (*KoanfProvider) PrometheusServeAddress

func (v *KoanfProvider) PrometheusServeAddress() string

func (*KoanfProvider) ProxyIdleTimeout

func (v *KoanfProvider) ProxyIdleTimeout() time.Duration

func (*KoanfProvider) ProxyReadTimeout

func (v *KoanfProvider) ProxyReadTimeout() time.Duration

func (*KoanfProvider) ProxyServeAddress

func (v *KoanfProvider) ProxyServeAddress() string

func (*KoanfProvider) ProxyWriteTimeout

func (v *KoanfProvider) ProxyWriteTimeout() time.Duration

func (*KoanfProvider) RemoveWatcher

func (v *KoanfProvider) RemoveWatcher(id SubscriptionID)

RemoveWatcher removes the watcher with the given subscription ID.

func (*KoanfProvider) SetForTest

func (v *KoanfProvider) SetForTest(t testing.TB, key string, value interface{})

func (*KoanfProvider) Source

func (v *KoanfProvider) Source() *configx.Provider

func (*KoanfProvider) String

func (v *KoanfProvider) String(k Key) string

func (*KoanfProvider) TLSConfig

func (v *KoanfProvider) TLSConfig(daemon string) *TLSConfig

func (*KoanfProvider) ToScopeStrategy

func (v *KoanfProvider) ToScopeStrategy(value string, key string) fosite.ScopeStrategy

func (*KoanfProvider) TracingJaegerConfig

func (v *KoanfProvider) TracingJaegerConfig() *tracing.JaegerConfig

func (*KoanfProvider) TracingProvider

func (v *KoanfProvider) TracingProvider() string

func (*KoanfProvider) TracingServiceName

func (v *KoanfProvider) TracingServiceName() string

func (*KoanfProvider) TracingZipkinConfig

func (v *KoanfProvider) TracingZipkinConfig() *tracing.ZipkinConfig

type MatchingStrategy

type MatchingStrategy string

MatchingStrategy defines matching strategy such as Regexp or Glob. Empty string defaults to "regexp".

const (
	Regexp                  MatchingStrategy = "regexp"
	Glob                    MatchingStrategy = "glob"
	DefaultMatchingStrategy                  = Regexp
)

Possible matching strategies.

type Provider

type Provider interface {
	Get(k Key) interface{}
	String(k Key) string
	AllSettings() map[string]interface{}
	Source() *configx.Provider

	AddWatcher(cb callback) SubscriptionID
	RemoveWatcher(id SubscriptionID)

	CORSEnabled(iface string) bool
	CORSOptions(iface string) cors.Options
	CORS(iface string) (cors.Options, bool)

	ProviderAuthenticators
	ProviderErrorHandlers
	ProviderAuthorizers
	ProviderMutators

	ProxyReadTimeout() time.Duration
	ProxyWriteTimeout() time.Duration
	ProxyIdleTimeout() time.Duration

	APIReadTimeout() time.Duration
	APIWriteTimeout() time.Duration
	APIIdleTimeout() time.Duration

	AccessRuleRepositories() []url.URL
	AccessRuleMatchingStrategy() MatchingStrategy

	ProxyServeAddress() string
	APIServeAddress() string

	PrometheusServeAddress() string
	PrometheusMetricsPath() string
	PrometheusMetricsNamePrefix() string
	PrometheusHideRequestPaths() bool
	PrometheusCollapseRequestPaths() bool

	ToScopeStrategy(value string, key string) fosite.ScopeStrategy
	ParseURLs(sources []string) ([]url.URL, error)
	JSONWebKeyURLs() []string

	TracingServiceName() string
	TracingProvider() string
	TracingJaegerConfig() *tracing.JaegerConfig
	TracingZipkinConfig() *tracing.ZipkinConfig

	TLSConfig(daemon string) *TLSConfig

	SetForTest(t testing.TB, key string, value interface{})
}

type ProviderAuthenticators

type ProviderAuthenticators interface {
	AuthenticatorConfig(id string, overrides json.RawMessage, destination interface{}) error
	AuthenticatorIsEnabled(id string) bool
	AuthenticatorJwtJwkMaxWait() time.Duration
	AuthenticatorJwtJwkTtl() time.Duration
}

type ProviderAuthorizers

type ProviderAuthorizers interface {
	AuthorizerConfig(id string, overrides json.RawMessage, destination interface{}) error
	AuthorizerIsEnabled(id string) bool
}

type ProviderErrorHandlers

type ProviderErrorHandlers interface {
	ErrorHandlerConfig(id string, override json.RawMessage, dest interface{}) error
	ErrorHandlerIsEnabled(id string) bool
	ErrorHandlerFallbackSpecificity() []string
}

type ProviderMutators

type ProviderMutators interface {
	MutatorConfig(id string, overrides json.RawMessage, destination interface{}) error
	MutatorIsEnabled(id string) bool
}

type SubscriptionID

type SubscriptionID uuid.UUID

type TLSConfig

type TLSConfig struct {
	Key  TLSData `mapstructure:"key"`
	Cert TLSData `mapstructure:"cert"`
}

type TLSData

type TLSData struct {
	Path   string `mapstructure:"path"`
	Base64 string `mapstructure:"base64"`
}

Jump to

Keyboard shortcuts

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