middleware

package
v0.5.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TLSCommonNameContextKey contextKey = "tls-cn"

Variables

This section is empty.

Functions

func GrpcAuthMiddleware

func GrpcAuthMiddleware(ctx context.Context) (context.Context, error)

client has to present either client TLS certificate or valid Authorization header

func NewHTTPServer

func NewHTTPServer(router http.Handler, log logrus.FieldLogger, address string, cfg *config.Config) *http.Server

func NewHTTPServerWithTLSContext

func NewHTTPServerWithTLSContext(router http.Handler, log logrus.FieldLogger, address string, cfg *config.Config) *http.Server

func NewTLSListener

func NewTLSListener(address string, tlsConfig *tls.Config) (net.Listener, error)

NewTLSListener returns a new TLS listener. If the address is empty, it will listen on localhost's next available port.

func RequestSizeLimiter added in v0.4.0

func RequestSizeLimiter(maxURLLength int, maxNumHeaders int) func(http.Handler) http.Handler

RequestSizeLimiter returns a middleware that limits the URL length and the number of request headers.

func ValidateClientTlsCert

func ValidateClientTlsCert(ctx context.Context) (context.Context, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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