mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user