auth

package
v0.0.0-...-02a526c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthSet = wire.NewSet(wire.Struct(new(Auth), "*"))

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Logger core.ILogger
	Redis  *redis.Client
}

func (*Auth) CompareCombination

func (auth *Auth) CompareCombination(c *gin.Context, userID string, clientIP string) bool

验证规则: 1. 当前请求IP或是header中的clientIP,与JWT中当初token签发IP相同 2. header中的userID与JWT中userID相同

func (*Auth) GenErrMsg

func (auth *Auth) GenErrMsg(c *gin.Context, desc string, err error) error

func (*Auth) GenOkMsg

func (auth *Auth) GenOkMsg(c *gin.Context, desc string) string

func (*Auth) ValidateSignature

func (auth *Auth) ValidateSignature() gin.HandlerFunc

func (*Auth) ValidateToken

func (auth *Auth) ValidateToken() gin.HandlerFunc

Jump to

Keyboard shortcuts

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