-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a method to validate the policy rules without actually evaluating them against a particular input. For OPA, this validation amounts to a syntax check of the specified rules. This is intended for use by the forthcoming policy management API implementation. Signed-off-by: Sergei Trofimov <[email protected]>
- Loading branch information
Showing
13 changed files
with
153 additions
and
5 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package policy | ||
|
||
executables = APPROVED_RT |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package policy | ||
|
||
executables = ok |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[ | ||
{ | ||
"title": "malformed policy", | ||
"policy": "test/policies/malformed.rego", | ||
"error": "1 error occurred: 1 error occurred: policy.rego:1: rego_parse_error: unexpected : token\n\tbad_rule:;;\n\t ^" | ||
}, | ||
{ | ||
"title": "bad policy", | ||
"policy": "test/policies/bad.rego", | ||
"error": "1 error occurred: policy.rego:6: rego_unsafe_var_error: var y is unsafe" | ||
}, | ||
{ | ||
"title": "empty policy", | ||
"policy": "test/policies/empty.rego", | ||
"error": null | ||
}, | ||
{ | ||
"title": "empty string", | ||
"policy": "test/policies/null.rego", | ||
"error": "1 error occurred: policy.rego:0: rego_parse_error: empty module" | ||
}, | ||
{ | ||
"title": "undefined variable", | ||
"policy": "test/policies/undefined.rego", | ||
"error": "1 error occurred: policy.rego:3: rego_unsafe_var_error: var ok is unsafe" | ||
}, | ||
{ | ||
"title": "valid simple", | ||
"policy": "test/policies/simple.rego", | ||
"error": null | ||
}, | ||
{ | ||
"title": "valid complex", | ||
"policy": "test/policies/sw-up-to-dateness.rego", | ||
"error": null | ||
} | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.