middleware

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package middleware package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrometheusMiddleware

func PrometheusMiddleware(next http.Handler) http.Handler

PrometheusMiddleware adds basic metrics to a handler

Types

type Handler

type Handler func(next http.Handler) http.Handler

Handler is used for returning middleware functions

func HTTPRateLimiterMiddleware added in v0.11.0

func HTTPRateLimiterMiddleware(
	logger logger.Logger,
	respWriter response.Writer,
	store ratelimitstore.Store,
) Handler

HTTPRateLimiterMiddleware creates a handler for HTTP rate limiting.

func NewAuthenticationMiddleware added in v0.11.0

func NewAuthenticationMiddleware(
	authenticator *auth.Authenticator,
	logger logger.Logger,
	respWriter response.Writer,
) Handler

NewAuthenticationMiddleware resolves whether the caller has authenticated. If so, it sets the caller on the context. In either case, it sets the subject string on the context.

func NewCommonHeadersMiddleware added in v0.6.0

func NewCommonHeadersMiddleware(
	headers map[string]string,
) Handler

NewCommonHeadersMiddleware creates an instance of CommonHeadersMiddleware

func NewRequireAuthenticatedCallerMiddleware added in v0.11.0

func NewRequireAuthenticatedCallerMiddleware(
	logger logger.Logger,
	respWriter response.Writer,
) Handler

NewRequireAuthenticatedCallerMiddleware requires an authenticated caller.

Jump to

Keyboard shortcuts

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