Documentation ¶
Index ¶
- Constants
- func BatchCompile(queue <-chan *policy.CompilationUnit, schemaMgr schema.Manager) error
- func Compile(unit *policy.CompilationUnit, schemaMgr schema.Manager) (rps *runtimev1.RunnablePolicySet, err error)
- func Condition(cond *policyv1.Condition) (*runtimev1.Condition, error)
- func MigrateCompiledPolicies(policies *runtimev1.RunnablePolicySet) error
- type CELCompileError
- type Conf
- type Error
- type ErrorList
- type Manager
- func NewManager(ctx context.Context, store storage.SourceStore, schemaMgr schema.Manager) (*Manager, error)
- func NewManagerFromConf(ctx context.Context, conf *Conf, store storage.SourceStore, ...) *Manager
- func NewManagerFromDefaultConf(ctx context.Context, store storage.SourceStore, schemaMgr schema.Manager) *Manager
- func (c *Manager) GetFirstMatch(ctx context.Context, candidates []namer.ModuleID) (*runtimev1.RunnablePolicySet, error)
- func (c *Manager) GetPolicySet(ctx context.Context, modID namer.ModuleID) (*runtimev1.RunnablePolicySet, error)
- func (c *Manager) OnStorageEvent(events ...storage.Event)
- func (c *Manager) SubscriberID() string
- type PolicyCompilationErr
Constants ¶
View Source
const AnyRoleVal = "*"
Variables ¶
This section is empty.
Functions ¶
func BatchCompile ¶
func BatchCompile(queue <-chan *policy.CompilationUnit, schemaMgr schema.Manager) error
func Compile ¶
func Compile(unit *policy.CompilationUnit, schemaMgr schema.Manager) (rps *runtimev1.RunnablePolicySet, err error)
func MigrateCompiledPolicies ¶ added in v0.30.0
func MigrateCompiledPolicies(policies *runtimev1.RunnablePolicySet) error
MigrateCompiledPolicies modifies a RunnablePolicySet compiled by a previous version of Cerbos to migrate it to the latest format.
Types ¶
type CELCompileError ¶ added in v0.9.0
type CELCompileError struct {
// contains filtered or unexported fields
}
CELCompileError holds CEL compilation errors.
func (*CELCompileError) Error ¶ added in v0.9.0
func (cce *CELCompileError) Error() string
func (*CELCompileError) Unwrap ¶ added in v0.9.0
func (cce *CELCompileError) Unwrap() error
type Conf ¶ added in v0.14.0
type Conf struct { // CacheSize is the number of compiled policies to cache in memory. CacheSize uint `yaml:"cacheSize" conf:",example=1024"` // CacheDuration is the duration to cache an entry. CacheDuration time.Duration `yaml:"cacheDuration" conf:",example=60s"` }
Conf is optional configuration for caches.
func DefaultConf ¶ added in v0.14.0
func DefaultConf() *Conf
DefaultConf creates a config with defaults.
func (*Conf) SetDefaults ¶ added in v0.14.0
func (c *Conf) SetDefaults()
type Error ¶
type Error struct {
*runtimev1.CompileErrors_Err
}
Error describes an error encountered during compilation.
func (*Error) MarshalJSON ¶
type ErrorList ¶
type ErrorList struct {
*runtimev1.CompileErrors
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManagerFromConf ¶ added in v0.15.0
func NewManagerFromDefaultConf ¶ added in v0.15.0
func (*Manager) GetFirstMatch ¶ added in v0.29.0
func (*Manager) GetPolicySet ¶ added in v0.20.0
func (*Manager) OnStorageEvent ¶
func (*Manager) SubscriberID ¶
type PolicyCompilationErr ¶ added in v0.9.0
type PolicyCompilationErr struct {
// contains filtered or unexported fields
}
func (PolicyCompilationErr) Error ¶ added in v0.9.0
func (pce PolicyCompilationErr) Error() string
func (PolicyCompilationErr) Is ¶ added in v0.27.0
func (pce PolicyCompilationErr) Is(target error) bool
func (PolicyCompilationErr) Unwrap ¶ added in v0.9.0
func (pce PolicyCompilationErr) Unwrap() error
Click to show internal directories.
Click to hide internal directories.