Documentation ¶
Index ¶
- func GetEntryFromRouteReader(r restful.RouteReader) http.Entry
- 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 ¶
Types ¶
type HTTPAuther ¶
type HTTPAuther struct {
// contains filtered or unexported fields
}
internal todo
func NewAutherFromGRPC ¶
func NewAutherFromGRPC(c *rpc.Client) *HTTPAuther
NewAutherFromGRPC 基于rpc的鉴权中间件
func (*HTTPAuther) CheckPermission ¶
func (*HTTPAuther) GetClientService ¶
func (*HTTPAuther) GinAuthHandlerFunc ¶
func (a *HTTPAuther) GinAuthHandlerFunc() gin.HandlerFunc
Gin Auth Middleware
func (*HTTPAuther) PermHandlerFunc ¶
func (a *HTTPAuther) PermHandlerFunc() gin.HandlerFunc
Gin Perm Middleware
func (*HTTPAuther) RestfulAuthHandlerFunc ¶
func (a *HTTPAuther) RestfulAuthHandlerFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
func (*HTTPAuther) SetAllows ¶
func (a *HTTPAuther) SetAllows(allows ...fmt.Stringer)
func (*HTTPAuther) SetPermissionCheckMode ¶
func (a *HTTPAuther) SetPermissionCheckMode(m PermissionCheckMode)
func (*HTTPAuther) ValidateIdentity ¶
func (*HTTPAuther) ValidatePermissionByACL ¶
func (*HTTPAuther) ValidatePermissionByPRBAC ¶
type PermissionCheckMode ¶
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.