Documentation
¶
Overview ¶
Package echoadapter provides an RBAC middleware for Echo v5.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(enforcer *rbacgo.Enforcer, opts ...Option) echo.MiddlewareFunc
Middleware builds an Echo middleware. Register it with:
e.Use(echoadapter.Middleware(enforcer, echoadapter.WithUserID(...)))
Types ¶
type Option ¶
type Option func(*Options)
Option mutates Options.
func WithDeniedHandler ¶
WithDeniedHandler overrides the default 403 handler.
func WithResourceAction ¶
WithResourceAction sets the function that derives (resource, action) from the request. Defaults to (URL path, HTTP method).
func WithUnauthorizedHandler ¶
WithUnauthorizedHandler overrides the default 401 handler.
Click to show internal directories.
Click to hide internal directories.