auth

package
v0.0.0-...-6a8978f Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 15 Imported by: 0

README

服务端端 认证中间件

那些接口需要什么用户类型才能访问

http: go-restful-> 使用go-restful的认证中间件:

Go Restful的路由是支持装饰(meta 就是装饰): 我们添加额外的标识, 来控制权限,比如 CreateUser meta{"user_type": supper}

判断权限的逻辑: 基于路由装饰的权限中间件

  • 通过token获取用户身份
  • 判断用户的身份和meta的定义是否匹配

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcAuthUnaryServerInterceptor

func GrpcAuthUnaryServerInterceptor() grpc.UnaryServerInterceptor

GrpcAuthUnaryServerInterceptor returns a new unary server interceptor for auth.

Types

type Auther

type Auther struct {
	// contains filtered or unexported fields
}

func NewAuther

func NewAuther() *Auther

func (*Auther) GoRestfulAuthFunc

func (a *Auther) GoRestfulAuthFunc(req *restful.Request, resp *restful.Response, next *restful.FilterChain)

Jump to

Keyboard shortcuts

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