Documentation ¶
Index ¶
- func AuthenticatedUser(r *http.Request) bool
- func Role(role model.Role) func(r *http.Request) bool
- type Authorizer
- func (a Authorizer) Require(funcs ...func(r *http.Request) bool) func(next http.Handler) http.Handler
- func (a Authorizer) RequireAdminRole(next http.Handler) http.Handler
- func (a Authorizer) RequireAuthenticatedUser(next http.Handler) http.Handler
- func (a Authorizer) RequireOneOf(funcs ...func(r *http.Request) bool) func(next http.Handler) http.Handler
- func (a Authorizer) RequireRole(role model.Role) func(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticatedUser ¶
AuthenticatedUser authorizes any authenticated user.
Note that authenticated API key is not linked to any user, therefore this check will fail. Also note that when auth is disabled this check also fails
Types ¶
type Authorizer ¶ added in v0.11.0
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶ added in v0.11.0
func NewAuthorizer(logger logrus.FieldLogger, httpUtils httputils.Utils) Authorizer
func (Authorizer) RequireAdminRole ¶ added in v0.11.0
func (a Authorizer) RequireAdminRole(next http.Handler) http.Handler
func (Authorizer) RequireAuthenticatedUser ¶ added in v0.11.0
func (a Authorizer) RequireAuthenticatedUser(next http.Handler) http.Handler
func (Authorizer) RequireOneOf ¶ added in v0.11.1
func (Authorizer) RequireRole ¶ added in v0.34.0
Click to show internal directories.
Click to hide internal directories.