Skip to content

Releases: google/cel-policy-templates-go

Release v0.1.5

25 Mar 05:13
b9eff83
Compare
Choose a tag to compare

What's Changed

  • Remove expression cost limit based on deprecated cel.EstimateCost method by @TristonianJones in #54

Full Changelog: v0.1.4...v0.1.5

Release v0.1.4

14 Mar 19:17
4f68a4a
Compare
Choose a tag to compare

Fixes

  • Ensure all cel.Env settings are plumbed through to expressions [#52]

Release v0.1.3

09 Dec 21:05
295ae6c
Compare
Choose a tag to compare

Fixes

  • Report compile issue of expr string only if strict flag is set (#49)
  • Add JSON conversion support for model list and struct values (#50)

Release v0.1.2

15 Jun 19:02
2ad8ac2
Compare
Choose a tag to compare

Fixes

  • Runtime template options available to validator, this allows validator to bind to custom functions during validation.

Release v0.1.1

11 Mar 23:59
756118d
Compare
Choose a tag to compare

Fixes

  • Production limit values now accept negative integers to specify that a feature usage is unlimited .
  • How a ListValue builds its indices for set containment is now concurrency safe and automatic.
  • ObjectValue equality has been fixed to compare all object fields not just the set fields.
  • time.Duration values are now properly supported within YAML instances at compile time.
  • Upgraded to cel-go-v0.7.2 to pick up fixes related to golang protobuf v2 API usage.

Release v0.1.0

16 Jan 00:15
4a0d190
Compare
Choose a tag to compare

Initial release of CEL Policy Templates

Policies are usually the combined effort of the following agents:

  • Administrators who are experts in how data fit within a particular knowledge domain.
  • Architects who write templates that perform logic on admin terms using the capabilities of a given platform.
  • Platforms expose variables and functions, an environment which Architects can use within their logic.

In CPT, Admin writes policy instances, Architects write templates, and Platforms define environments.
Each of these artifacts is its own YAML file, but the framework is abstract enough that it should be possible
to support other source formats. Expressions within the YAML files are written as CEL.

Overview

  • Define a template to declare the schema of an admin written policy.
  • Templates support a validation block to ensure admin provided instances are well-formed.
  • Templates must define an evaluation block to indicate how a policy is to be evaluated.
  • Evaluators may emit multiple policy decisions and may aggregate or short-circuit these decisions
    by configuring the policy engine with an aggregator for a given decision name.
  • The set of variables and functions available to a validation or evaluation block are declared within
    an environment yaml file.
  • The definitions for functions and variables declared within an environment must be provided at runtime
    to an instance of the policy/engine.go

You can find a series of example policy templates and instances in the test/testdata directories with the contents
being consumed within the policy/engine_test.go.