-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add acceptance tests for multi-source input
Signed-off-by: Luiz Carvalho <[email protected]>
- Loading branch information
Showing
5 changed files
with
110 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ham | ||
|
||
import rego.v1 | ||
|
||
# METADATA | ||
# title: Ham | ||
# description: Ham ham ham | ||
# custom: | ||
# short_name: delicious | ||
# | ||
deny contains result if { | ||
value := object.get(input, "ham", "yucky") | ||
value != "delicious" | ||
result := { | ||
"msg": "ham is not delicious", | ||
"code": "ham.delicious", | ||
} | ||
} |
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,6 @@ | ||
--- | ||
sources: | ||
- policy: | ||
- "git::https://${GITHOST}/git/ham-policy" | ||
- policy: | ||
- "git::https://${GITHOST}/git/spam-policy" |
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,18 @@ | ||
package spam | ||
|
||
import rego.v1 | ||
|
||
# METADATA | ||
# title: Spam | ||
# description: Spam spam spam | ||
# custom: | ||
# short_name: valid | ||
# | ||
deny contains result if { | ||
value := object.get(input, "spam", false) | ||
not value | ||
result := { | ||
"msg": "spam is not true", | ||
"code": "spam.valid", | ||
} | ||
} |
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