-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rego v1 capabilities and keywords update (#7216)
* Separating v0- and v1 keywords * Adding `rego_v1` capability feature Signed-off-by: Johan Fylling <[email protected]>
- Loading branch information
1 parent
82b2214
commit 563321d
Showing
38 changed files
with
7,252 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
package files_test | ||
|
||
import future.keywords.in | ||
import rego.v1 | ||
|
||
import data.files.deny | ||
|
||
test_deny_invalid_yaml_file { | ||
test_deny_invalid_yaml_file if { | ||
expected := "invalid.yaml is an invalid YAML file: {null{}}" | ||
expected in deny with data.files.yaml_file_contents as {"invalid.yaml": "{null{}}"} | ||
with data.files.changes as {"invalid.yaml": {"status": "modified"}} | ||
} | ||
|
||
test_allow_valid_yaml_file { | ||
test_allow_valid_yaml_file if { | ||
count(deny) == 0 with data.files.yaml_file_contents as {"valid.yaml": "foo: bar"} | ||
with data.files.changes as {"valid.yaml": {"status": "modified"}} | ||
} | ||
|
||
test_deny_invalid_json_file { | ||
test_deny_invalid_json_file if { | ||
expected := "invalid.json is an invalid JSON file: }}}" | ||
expected in deny with data.files.json_file_contents as {"invalid.json": "}}}"} | ||
with data.files.changes as {"invalid.json": {"status": "modified"}} | ||
} | ||
|
||
test_allow_valid_json_file { | ||
test_allow_valid_json_file if { | ||
count(deny) == 0 with data.files.json_file_contents as {"valid.json": "{\"foo\": \"bar\"}"} | ||
with data.files.changes as {"valid.json": {"status": "modified"}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.