Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupsFromToken ¶
GroupsFromToken returns the groups claimed by the token
func SetDefaults ¶
SetDefaults sets everything up for default matchers.
Types ¶
type Config ¶
type Config struct { // Roles every user has. Base []string // Rules to determine a user's roles. Rules []Rule }
Config is a simple RBAC configuration.
func (*Config) MatchRequest ¶
type Interface ¶
type Interface interface { Match(role string, user *User) bool MatchRequest(role string, req *http.Request, validationCrt []byte) (authn, authz bool) }
Interface of an RBAC backend
type User ¶
User describes a user for the simple RBAC backend
func UserFromRequest ¶
UserFromRequest returns a User object from the given request or `nil` if the token is not found or invalid.
func UserFromToken ¶
UserFromToken returns a User object from the given token.
Click to show internal directories.
Click to hide internal directories.