Documentation ¶
Index ¶
- Variables
- func NewBasicAuthSessionLoader(validator basic.Validator, sessionGroups []string, preferEmail bool) alice.Constructor
- func NewHealthCheck(paths, userAgents []string) alice.Constructor
- func NewJwtSessionLoader(sessionLoaders []middlewareapi.TokenToSessionFunc) alice.Constructor
- func NewMetricsHandler(registerer prometheus.Registerer, gatherer prometheus.Gatherer) http.Handler
- func NewMetricsHandlerWithDefaultRegistry() http.Handler
- func NewReadynessCheck(path string, verifiable Verifiable) alice.Constructor
- func NewRedirectToHTTPS(httpsPort string) alice.Constructor
- func NewRequestHeaderInjector(headers []options.Header) (alice.Constructor, error)
- func NewRequestLogger() alice.Constructor
- func NewRequestMetrics(registerer prometheus.Registerer) alice.Constructor
- func NewRequestMetricsWithDefaultRegistry() alice.Constructor
- func NewResponseHeaderInjector(headers []options.Header) (alice.Constructor, error)
- func NewScope(reverseProxy bool, idHeader string) alice.Constructor
- func NewStoredSessionLoader(opts *StoredSessionLoaderOptions) alice.Constructor
- type StoredSessionLoaderOptions
- type Verifiable
Constants ¶
This section is empty.
Variables ¶
var DefaultMetricsHandler = NewMetricsHandlerWithDefaultRegistry()
DefaultMetricsHandler is the default http.Handler for serving metrics from the default prometheus.Registry
Functions ¶
func NewHealthCheck ¶
func NewHealthCheck(paths, userAgents []string) alice.Constructor
func NewJwtSessionLoader ¶
func NewJwtSessionLoader(sessionLoaders []middlewareapi.TokenToSessionFunc) alice.Constructor
func NewMetricsHandler ¶
func NewMetricsHandler(registerer prometheus.Registerer, gatherer prometheus.Gatherer) http.Handler
NewMetricsHandler creates a new http.Handler for serving metrics from the provided prometheus.Registerer and prometheus.Gatherer
func NewMetricsHandlerWithDefaultRegistry ¶
NewMetricsHandlerWithDefaultRegistry creates a new http.Handler for serving metrics from the default prometheus.Registry.
func NewReadynessCheck ¶
func NewReadynessCheck(path string, verifiable Verifiable) alice.Constructor
NewReadynessCheck returns a middleware that performs deep health checks (verifies the connection to any underlying store) on a specific `path`
func NewRedirectToHTTPS ¶
func NewRedirectToHTTPS(httpsPort string) alice.Constructor
NewRedirectToHTTPS creates a new redirectToHTTPS middleware that will redirect HTTP requests to HTTPS
func NewRequestHeaderInjector ¶
func NewRequestHeaderInjector(headers []options.Header) (alice.Constructor, error)
func NewRequestLogger ¶
func NewRequestLogger() alice.Constructor
NewRequestLogger returns middleware which logs requests It uses a custom ResponseWriter to track status code & response size details
func NewRequestMetrics ¶
func NewRequestMetrics(registerer prometheus.Registerer) alice.Constructor
NewRequestMetrics returns a middleware that will record metrics for HTTP requests to the provided prometheus.Registerer
func NewRequestMetricsWithDefaultRegistry ¶
func NewRequestMetricsWithDefaultRegistry() alice.Constructor
NewRequestMetricsWithDefaultRegistry returns a middleware that will record metrics for HTTP requests to the default prometheus.Registry
func NewResponseHeaderInjector ¶
func NewResponseHeaderInjector(headers []options.Header) (alice.Constructor, error)
func NewStoredSessionLoader ¶
func NewStoredSessionLoader(opts *StoredSessionLoaderOptions) alice.Constructor
NewStoredSessionLoader creates a new storedSessionLoader which loads sessions from the session store. If no session is found, the request will be passed to the nex handler. If a session was loader by a previous handler, it will not be replaced.
Types ¶
type StoredSessionLoaderOptions ¶
type StoredSessionLoaderOptions struct { // Session storage backend SessionStore sessionsapi.SessionStore // How often should sessions be refreshed RefreshPeriod time.Duration // Provider based session refreshing RefreshSession func(context.Context, *sessionsapi.SessionState) (bool, error) // Provider based session validation. // If the sesssion is older than `RefreshPeriod` but the provider doesn't // refresh it, we must re-validate using this validation. ValidateSession func(context.Context, *sessionsapi.SessionState) bool }
StoredSessionLoaderOptions contains all of the requirements to construct a stored session loader. All options must be provided.
type Verifiable ¶
Verifiable an interface for an object that has a connection to external data source and exports a function to validate that connection