Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Empty emptyGrouper
Empty is a grouper that returns not found for all groups.
var ErrCanceled = fmt.Errorf("cancled request for memberships")
ErrCanceled is used by Grouper implementations when the request was canceled before the group memberships could be determined.
var ErrNotFound = fmt.Errorf("not found")
ErrNotFound is 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.
var ErrTimeout = fmt.Errorf("timeout retrieving memberships")
ErrTimeout is used by Grouper implementations to signal the grouper was unable to retrieve the memberships before the timeout was exceeded.
var ErrUnknown = fmt.Errorf("temporary error determining membership")
ErrUnknown is used by Grouper implementations to signal there was an error retrieving the group information with an unknown root cause. Can be used as the cause in errors.Wrap if more context is required.
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the case of the error is ErrNotFound.
func IsUnknownMemberships ¶ added in v1.1.0
IsUnknownMemberships returns true if it is an intermittent error and should not change the memberships. Errors in the of this type may (timeouts) or may not resolve themselves (authentication issues). They indicate that the response data received is not reflective of the actual memberships.
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.