interceptor

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcAuthUnaryServerInterceptor

func GrpcAuthUnaryServerInterceptor(c *client.Client) grpc.UnaryServerInterceptor

GrpcAuthUnaryServerInterceptor returns a new unary server interceptor for auth.

func SendOperateEvent

func SendOperateEvent(req, resp interface{}, hd *event.Header, od *event.OperateEventData) error

Types

type HTTPAuther

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

internal todo

func NewHTTPAuther

func NewHTTPAuther(c *client.Client) *HTTPAuther

NewInternalAuther 内部使用的auther

func (*HTTPAuther) Auth

func (a *HTTPAuther) Auth(r *http.Request, entry httpb.Entry) (
	authInfo interface{}, err error)

func (*HTTPAuther) ResponseHook

func (a *HTTPAuther) ResponseHook(w http.ResponseWriter, r *http.Request, entry httpb.Entry)

func (*HTTPAuther) SetLogger

func (a *HTTPAuther) SetLogger(l logger.Logger)

SetLogger todo

func (*HTTPAuther) ValidateIdentity

func (a *HTTPAuther) ValidateIdentity(ctx context.Context, accessToken string) (*token.Token, error)

func (*HTTPAuther) ValidatePermission

func (a *HTTPAuther) ValidatePermission(ctx context.Context, tk *token.Token, e httpb.Entry) error

Jump to

Keyboard shortcuts

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