auth

package
v0.0.0-...-e006840 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 12 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 *logrus.Entry
	Redis  *redis.Client
}

func (*Auth) AbortWithError

func (auth *Auth) AbortWithError(c *gin.Context, args ...any)

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) 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