middlewares

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmapApiProxyAuthCookie added in v0.4.0

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 added in v0.4.0

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 JWTEmailVerifyAuthorization added in v0.4.0

func JWTEmailVerifyAuthorization(c *core.Context)

JWTEmailVerifyAuthorization verifies whether current request is email verification

func JWTResetPasswordAuthorization added in v0.4.0

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 added in v0.3.0

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