middleware

package
v1.6.17 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Basic constanta
	Basic = "basic"
)
View Source
const (
	// Bearer constanta
	Bearer = "bearer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	TokenValidator       interfaces.TokenValidator
	ACLPermissionChecker interfaces.ACLPermissionChecker
	// contains filtered or unexported fields
}

Middleware impl

func NewMiddleware

func NewMiddleware(tokenValidator interfaces.TokenValidator, aclPermissionChecker interfaces.ACLPermissionChecker) *Middleware

NewMiddleware create new middleware instance

func (*Middleware) Basic

func (m *Middleware) Basic(ctx context.Context, key string) error

Basic function basic auth

func (*Middleware) Bearer

func (m *Middleware) Bearer(ctx context.Context, tokenString string) (*candishared.TokenClaim, error)

Bearer token validator

func (*Middleware) GRPCBasicAuth

func (m *Middleware) GRPCBasicAuth(ctx context.Context) context.Context

GRPCBasicAuth method

func (*Middleware) GRPCBearerAuth

func (m *Middleware) GRPCBearerAuth(ctx context.Context) context.Context

GRPCBearerAuth method

func (*Middleware) GRPCPermissionACL

func (m *Middleware) GRPCPermissionACL(permissionCode string) types.MiddlewareFunc

GRPCPermissionACL grpc interceptor for check acl permission

func (*Middleware) GraphQLBasicAuth

func (m *Middleware) GraphQLBasicAuth(ctx context.Context) context.Context

GraphQLBasicAuth for graphql resolver

func (*Middleware) GraphQLBearerAuth

func (m *Middleware) GraphQLBearerAuth(ctx context.Context) context.Context

GraphQLBearerAuth for graphql resolver

func (*Middleware) GraphQLPermissionACL

func (m *Middleware) GraphQLPermissionACL(permissionCode string) types.MiddlewareFunc

GraphQLPermissionACL graphql resolver for check acl permission

func (*Middleware) HTTPBasicAuth

func (m *Middleware) HTTPBasicAuth(next http.Handler) http.Handler

HTTPBasicAuth http basic auth middleware

func (*Middleware) HTTPBearerAuth

func (m *Middleware) HTTPBearerAuth(next http.Handler) http.Handler

HTTPBearerAuth http jwt token middleware

func (*Middleware) HTTPMultipleAuth

func (m *Middleware) HTTPMultipleAuth(next http.Handler) http.Handler

HTTPMultipleAuth mix basic & bearer auth

func (*Middleware) HTTPPermissionACL

func (m *Middleware) HTTPPermissionACL(permissionCode string) func(http.Handler) http.Handler

HTTPPermissionACL http middleware for check acl permission

Jump to

Keyboard shortcuts

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