middlewares

package
v4.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCacheControl

func SetCacheControl(cc string) gin.HandlerFunc

SetCacheControl ...

func ValidateAuthentication

func ValidateAuthentication() gin.HandlerFunc

ValidateAuthentication validates `req.Cookies.id_token` if id_token, which is a JWT, is invalid, and then return 401 status code

func ValidateAuthorization

func ValidateAuthorization() gin.HandlerFunc

ValidateAuthorization checks the jwt token in the Authorization header is valid or not

func ValidateUserID

func ValidateUserID() gin.HandlerFunc

ValidateUserID checks claim userID in the jwt with :userID param in the request url. if the two values are not the same, return the 401 response

func ValidateUserIDInReqBody

func ValidateUserIDInReqBody() gin.HandlerFunc

Types

type JWTMiddleware

type JWTMiddleware interface {
	ValidateAuthorization() gin.HandlerFunc
}

func GetMailServiceMiddleware

func GetMailServiceMiddleware() JWTMiddleware

Jump to

Keyboard shortcuts

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