Upgrading to Cerbos 0.14.0
This release introduces matrix tests for policy tests and existing test files require minor changes to be compatible with the new test runner.
input section-
resourcefield has been replaced with a list field namedresourcesthat must contain one or more resources to use as input to the test. -
A new list field named
principalshas been added to define the list of principals to be used as input to the test. -
requestIDfield has been removed.
expected section-
resourceis a new, required field that must be populated to indicate which resource is being referred to in the expectation. -
Only resource and principal combinations that are expected to produce an
ALLOWresult needs to be defined in theexpectedsection. If no pair is defined, it is assumed to produce aDENYresult.
The example below illustrates how to convert an existing test to the new format.
| Before Cerbos 0.14.0 | After Cerbos 0.14.0 |
|---|---|
yaml |
yaml |