middleware

package
v0.0.0-...-6d513be Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAuthHeader      = errors.New("Authorization header is missing")
	ErrInvalidAuthHeader = errors.New("Authorization header is malformed")
	ErrClaimsInvalid     = errors.New("Provided claims do not match expected scopes")
)

Functions

func CORSMiddleware

func CORSMiddleware() gin.HandlerFunc

func GetJWSFromRequest

func GetJWSFromRequest(req *http.Request) (string, error)

GetJWSFromRequest extracts a JWS string from an Authorization: Bearer <jws> header

func HandleOpenAPIError

func HandleOpenAPIError(c *gin.Context, message string, statusCode int)

func HandleOpenApiAuthentication

func HandleOpenApiAuthentication(ctx context.Context, jwt2 *pkgjwt.JWTConfig, input *openapi3filter.AuthenticationInput) error

func RecoveryMiddleware

func RecoveryMiddleware() gin.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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