MCPcopy Index your code
hub / github.com/coder/coder / NewCachingAuthorizer

Function NewCachingAuthorizer

coderd/rbac/authz.go:310–312  ·  view source on GitHub ↗

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)'.

(registry prometheus.Registerer)

Source from the content-addressed store, hash-verified

308// caching. To utilize the caching, the context passed to Authorize() must be
309// created with 'WithCacheCtx(ctx)'.
310func NewCachingAuthorizer(registry prometheus.Registerer) Authorizer {
311 return Cacher(NewAuthorizer(registry))
312}
313
314// NewStrictCachingAuthorizer is mainly just for testing.
315func NewStrictCachingAuthorizer(registry prometheus.Registerer) Authorizer {

Callers 2

NewFunction · 0.92
NewFunction · 0.92

Calls 2

CacherFunction · 0.85
NewAuthorizerFunction · 0.85

Tested by

no test coverage detected