middleware

package
v0.0.0-...-37004a0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSignatureHeaderMissing = errutil.NewError(errutil.TypeMissingHeader, "signature header missing")
	ErrSignatureNotValid      = errutil.NewError(errutil.TypeBadRequest, "signature not valid")
)

predefined errors

Functions

func CORSHandler

func CORSHandler(config config.Config) func(h http.Handler) http.Handler

func Logger

func Logger(logger logrus.FieldLogger) func(h http.Handler) http.Handler

Logger returns a request logging middleware taken and adapted from https://github.com/chi-middleware/logrus-logger

func ValidateSignature

func ValidateSignature(log *log.Logger) func(http.Handler) http.Handler

ValidateSignature validates the signature header of the request. The signature header is expected to be in the following format: Signature: keyId="https://my-example.com/actor#main-key",headers="(request-target) host date",signature="Y2FiYW...IxNGRiZDk4ZA=="

Types

This section is empty.

Jump to

Keyboard shortcuts

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