Documentation ¶
Overview ¶
Package middleware allows adding custom middleware(s) to the RESTful API, such as, JWT based authentication.
Index ¶
- func PrometheusMiddleware(next http.Handler) http.Handler
- type Handler
- func HTTPRateLimiterMiddleware(logger logger.Logger, respWriter response.Writer, store limiter.Store) Handler
- func NewAuthenticationMiddleware(authenticator *auth.Authenticator, logger logger.Logger, ...) Handler
- func NewCommonHeadersMiddleware(headers map[string]string) Handler
- func NewRequireAuthenticatedCallerMiddleware(logger logger.Logger, respWriter response.Writer) Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
Handler is used for returning middleware functions
func HTTPRateLimiterMiddleware ¶
func HTTPRateLimiterMiddleware( logger logger.Logger, respWriter response.Writer, store limiter.Store, ) Handler
HTTPRateLimiterMiddleware creates a handler for HTTP rate limiting.
func NewAuthenticationMiddleware ¶
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 ¶
NewCommonHeadersMiddleware creates an instance of CommonHeadersMiddleware
Click to show internal directories.
Click to hide internal directories.