feat: Add cachable authorizer to elimate duplicate rbac calls (#6107)

* feat: Add cachable authorizer to elimate duplicate rbac calls

Cache is context bound, so only prevents duplicate rbac calls in
the same request context.
This commit is contained in:
Steven Masley
2023-02-09 20:14:31 -06:00
committed by GitHub
parent 6f3f7f2937
commit e6da7afd33
6 changed files with 331 additions and 99 deletions

View File

@ -9,3 +9,8 @@ const (
ActionUpdate Action = "update"
ActionDelete Action = "delete"
)
// AllActions is a helper function to return all the possible actions types.
func AllActions() []Action {
return []Action{ActionCreate, ActionRead, ActionUpdate, ActionDelete}
}