feat: Turn on rbac check caching (#6202)

* chore: Turn on rbac check caching.

Should not affect much unless authz_querier experiment is
enabled
This commit is contained in:
Steven Masley
2023-02-15 08:56:07 -06:00
committed by GitHub
parent fac7c02eeb
commit 4cbbd1376d
9 changed files with 61 additions and 9 deletions

View File

@ -20,6 +20,8 @@ type cachedCalls struct {
// multiple calls are made to the Authorizer for the same subject, action, and
// object. The cache is on each `ctx` and is not shared between requests.
// If no cache is found on the context, the Authorizer is called as normal.
//
// Cacher is safe for multiple actors.
func Cacher(authz Authorizer) Authorizer {
return &cachedCalls{authz: authz}
}