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() func(next http.Handler) http.Handler
- func (a Authorizer) RequireAuthenticatedUser() func(next http.Handler) http.Handler
- func (a Authorizer) RequireOneOf(funcs ...func(r *http.Request) bool) 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.
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() func(next http.Handler) http.Handler
func (Authorizer) RequireAuthenticatedUser ¶ added in v0.11.0
func (a Authorizer) RequireAuthenticatedUser() func(next http.Handler) http.Handler
func (Authorizer) RequireOneOf ¶ added in v0.11.1
Click to show internal directories.
Click to hide internal directories.