auth

package
v0.0.0-...-b8103a1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthRPCSet = wire.NewSet(wire.Struct(new(AuthRPC), "*"))

Functions

This section is empty.

Types

type AuthRPC

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

func (*AuthRPC) CompareCombination

func (auth *AuthRPC) CompareCombination(md metadata.MD, userID string, clientIP string) bool

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

func (*AuthRPC) GenErrMsg

func (auth *AuthRPC) GenErrMsg(ctx context.Context, desc string, err error) error

func (*AuthRPC) GenOkMsg

func (auth *AuthRPC) GenOkMsg(ctx context.Context, desc string) string

func (*AuthRPC) ValidateSignature

func (auth *AuthRPC) ValidateSignature(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

func (*AuthRPC) ValidateToken

func (auth *AuthRPC) ValidateToken(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

Jump to

Keyboard shortcuts

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