Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Empty emptyGrouper
Empty is a grouper that returns not found for all groups.
var ErrNotFound = fmt.Errorf("not found")
ErrNotFound us used by Grouper implementations to signal a group is not found. Can be used as the cause in errors.Wrap if more context is required.
Use IsNotFound to detect this condition.
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the case of the error is ErrNotFound.
func Normalize ¶
Normalize returns the slice of subjects sorted and unique.
The underlying argument slice is preserved.
func SortSubjects ¶
Types ¶
type GroupMap ¶
GroupMap is simple map of group name to subjects.
Can be created with make or NewGroupMap.
func NewGroupMap ¶
NewGroupMap creates a group map from the provided map, ensuring that subjects are sorted and unique.
type Grouper ¶
Grouper returns the members of a group, as RBAC Subjects, given a group name.
If the group is unknown to the grouper, the error will return true for IsNotFound.