Documentation ¶
Index ¶
- func GetEntryFromRouteReader(r restful.RouteReader) http.Entry
- func GrpcAuthUnaryServerInterceptor(c *client.Client) grpc.UnaryServerInterceptor
- type HTTPAuther
- func (a *HTTPAuther) Auth(r *http.Request, entry httpb.Entry) (authInfo interface{}, err error)
- func (a *HTTPAuther) CheckPermission(ctx context.Context, tk *token.Token, e httpb.Entry) error
- func (a *HTTPAuther) GetClientService(ctx context.Context) (*micro.Micro, error)
- func (a *HTTPAuther) GinAuthHandlerFunc() gin.HandlerFunc
- func (a *HTTPAuther) PermHandlerFunc() gin.HandlerFunc
- func (a *HTTPAuther) RestfulAuthHandlerFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- func (a *HTTPAuther) SetAllows(allows ...fmt.Stringer)
- 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 GetEntryFromRouteReader ¶ added in v0.7.4
func GrpcAuthUnaryServerInterceptor ¶
func GrpcAuthUnaryServerInterceptor(c *client.Client) grpc.UnaryServerInterceptor
GrpcAuthUnaryServerInterceptor returns a new unary server interceptor for auth.
Types ¶
type HTTPAuther ¶
type HTTPAuther struct {
// contains filtered or unexported fields
}
internal todo
func (*HTTPAuther) CheckPermission ¶ added in v0.6.5
func (*HTTPAuther) GetClientService ¶ added in v0.6.5
func (*HTTPAuther) GinAuthHandlerFunc ¶ added in v0.7.5
func (a *HTTPAuther) GinAuthHandlerFunc() gin.HandlerFunc
Gin Auth Middleware
func (*HTTPAuther) PermHandlerFunc ¶ added in v0.7.4
func (a *HTTPAuther) PermHandlerFunc() gin.HandlerFunc
Gin Perm Middleware
func (*HTTPAuther) RestfulAuthHandlerFunc ¶ added in v0.7.5
func (a *HTTPAuther) RestfulAuthHandlerFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
func (*HTTPAuther) SetAllows ¶ added in v0.7.4
func (a *HTTPAuther) SetAllows(allows ...fmt.Stringer)
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.