Documentation
¶
Index ¶
- Variables
- type AuthRPC
- func (auth *AuthRPC) CompareCombination(md metadata.MD, userID string, clientIP string) bool
- func (auth *AuthRPC) GenErrMsg(ctx context.Context, desc string, err error) error
- func (auth *AuthRPC) GenOkMsg(ctx context.Context, desc string) string
- func (auth *AuthRPC) ValidateSignature(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func (auth *AuthRPC) ValidateToken(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AuthRPC ¶
func (*AuthRPC) CompareCombination ¶
验证规则: 1. 当前请求IP或是header中的clientIP,与JWT中当初token签发IP相同 2. header中的userID与JWT中userID相同
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)
Click to show internal directories.
Click to hide internal directories.