middleware

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(next http.Handler) http.Handler

func ParseToken

func ParseToken(r *http.Request) (*jwt.RegisteredClaims, error)

Try to find the access token in the request. Returns error if the user is not authorized. If `nil` is returned instead of an error, it is safe to display protected content.

func RequireAuth

func RequireAuth(next http.Handler) http.Handler

func SecurityHeadersMiddleware

func SecurityHeadersMiddleware(next http.Handler) http.Handler

Adds several headers to the response to improve security. For example, headers prevent embedding a site and passing information about the referrer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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