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
+7
View File
@@ -158,6 +158,13 @@ var (
partialQuery rego.PreparedPartialQuery
)
// NewCachingAuthorizer returns a new RegoAuthorizer that supports context based
// caching. To utilize the caching, the context passed to Authorize() must be
// created with 'WithCacheCtx(ctx)'.
func NewCachingAuthorizer(registry prometheus.Registerer) Authorizer {
return Cacher(NewAuthorizer(registry))
}
func NewAuthorizer(registry prometheus.Registerer) *RegoAuthorizer {
queryOnce.Do(func() {
var err error