Documentation ¶
Index ¶
- func GrpcAuthUnaryServerInterceptor(c *client.Client) grpc.UnaryServerInterceptor
- func SendOperateEvent(req, resp interface{}, hd *event.Header, od *event.OperateEventData) error
- type HTTPAuther
- func (a *HTTPAuther) Auth(r *http.Request, entry httpb.Entry) (authInfo interface{}, err error)
- func (a *HTTPAuther) CheckPermission(ctx context.Context, mod PermissionCheckMode, tk *token.Token, e httpb.Entry) error
- func (a *HTTPAuther) GetClientService(ctx context.Context) (*micro.Micro, error)
- func (a *HTTPAuther) ResponseHook(w http.ResponseWriter, r *http.Request, entry httpb.Entry)
- func (a *HTTPAuther) SetLogger(l logger.Logger)
- func (a *HTTPAuther) SetPermissionCheckMode(m PermissionCheckMode)
- func (a *HTTPAuther) ValidateIdentity(ctx context.Context, accessToken string) (*token.Token, error)
- func (a *HTTPAuther) ValidatePermissionByACL(ctx context.Context, tk *token.Token, e httpb.Entry) error
- func (a *HTTPAuther) ValidatePermissionByPRBAC(ctx context.Context, tk *token.Token, e httpb.Entry) error
- type PermissionCheckMode
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 (*HTTPAuther) CheckPermission ¶ added in v0.6.5
func (a *HTTPAuther) CheckPermission(ctx context.Context, mod PermissionCheckMode, tk *token.Token, e httpb.Entry) error
func (*HTTPAuther) GetClientService ¶ added in v0.6.5
func (*HTTPAuther) ResponseHook ¶
func (a *HTTPAuther) ResponseHook(w http.ResponseWriter, r *http.Request, entry httpb.Entry)
func (*HTTPAuther) SetPermissionCheckMode ¶ added in v0.6.5
func (a *HTTPAuther) SetPermissionCheckMode(m PermissionCheckMode)
func (*HTTPAuther) ValidateIdentity ¶
func (*HTTPAuther) ValidatePermissionByACL ¶ added in v0.6.5
func (*HTTPAuther) ValidatePermissionByPRBAC ¶ added in v0.6.5
type PermissionCheckMode ¶ added in v0.6.5
type PermissionCheckMode int
const ( // PRBAC_MODE 基于策略的权限校验 PRBAC_MODE PermissionCheckMode = 1 // ACL_MODE 基于用户类型的权限校验 ACL_MODE = 2 )
Click to show internal directories.
Click to hide internal directories.