middlewares

package
v0.0.0-...-d30cded Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmapApiProxyAuthCookie

func AmapApiProxyAuthCookie(c *core.Context, config *settings.Config)

AmapApiProxyAuthCookie adds amap api proxy auth cookie to cookies in response

func JWTAuthorization

func JWTAuthorization(c *core.Context)

JWTAuthorization verifies whether current request is valid by jwt token in header

func JWTAuthorizationByCookie

func JWTAuthorizationByCookie(c *core.Context)

JWTAuthorizationByCookie verifies whether current request is valid by jwt token in cookie

func JWTAuthorizationByQueryString

func JWTAuthorizationByQueryString(c *core.Context)

JWTAuthorizationByQueryString verifies whether current request is valid by jwt token in query string

func JWTResetPasswordAuthorization

func JWTResetPasswordAuthorization(c *core.Context)

JWTResetPasswordAuthorization verifies whether current request is password reset

func JWTTwoFactorAuthorization

func JWTTwoFactorAuthorization(c *core.Context)

JWTTwoFactorAuthorization verifies whether current request is valid by 2fa passcode

func Recovery

func Recovery(c *core.Context)

Recovery logs error message when error occurs

func RequestId

func RequestId(config *settings.Config) core.MiddlewareHandlerFunc

RequestId generates a new request id and add it to context and response header

func RequestLog

func RequestLog(c *core.Context)

RequestLog logs the http request log

func ServerSettingsCookie

func ServerSettingsCookie(config *settings.Config) core.MiddlewareHandlerFunc

ServerSettingsCookie adds server settings to cookies in response

Types

type TokenSourceType

type TokenSourceType byte

TokenSourceType represents token source

const (
	TOKEN_SOURCE_TYPE_HEADER   TokenSourceType = 1
	TOKEN_SOURCE_TYPE_ARGUMENT TokenSourceType = 2
	TOKEN_SOURCE_TYPE_COOKIE   TokenSourceType = 3
)

Token source types

Jump to

Keyboard shortcuts

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