Documentation ¶
Index ¶
- Constants
- type Middleware
- func (m *Middleware) Basic(ctx context.Context, key string) error
- func (m *Middleware) Bearer(ctx context.Context, tokenString string) (*candishared.TokenClaim, error)
- func (m *Middleware) GRPCBasicAuth(ctx context.Context) context.Context
- func (m *Middleware) GRPCBearerAuth(ctx context.Context) context.Context
- func (m *Middleware) GRPCPermissionACL(permissionCode string) types.MiddlewareFunc
- func (m *Middleware) GraphQLBasicAuth(ctx context.Context) context.Context
- func (m *Middleware) GraphQLBearerAuth(ctx context.Context) context.Context
- func (m *Middleware) GraphQLPermissionACL(permissionCode string) types.MiddlewareFunc
- func (m *Middleware) HTTPBasicAuth(next http.Handler) http.Handler
- func (m *Middleware) HTTPBearerAuth(next http.Handler) http.Handler
- func (m *Middleware) HTTPMultipleAuth(next http.Handler) http.Handler
- func (m *Middleware) HTTPPermissionACL(permissionCode string) func(http.Handler) http.Handler
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 ¶
HTTPPermissionACL http middleware for check acl permission
Click to show internal directories.
Click to hide internal directories.