Replies: 2 comments 1 reply
-
How about something like this: package example
import future.keywords.contains
import future.keywords.if
default allow := false
allow := deny == set()
deny contains msg if {
input.cSide.test.rows
input.cSide.test.rows != "DEFAULT"
msg := "rows was not the set to DEFAULT"
}
deny contains msg if {
input.cSide.test.columns
input.cSide.test.columns != "DEFAULT"
msg := "columns was not the set to DEFAULT"
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
IS there a way to integrate the below functions validate_rows(rows) = false {
rows != "DEFAULT"
}
validate_rows(rows) {
rows == "DEFAULT"
}
validate_columns(columns) = false {
columns != "DEFAULT"
}
validate_columns(columns) {
columns == "DEFAULT"
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The data is anonymized, and the example playground is here https://play.openpolicyagent.org/p/F5jzxTd173
In the below JSON body, the attributes
columns
androws
may present and may not present in the json body(optional attributes, sometimes one attribute present, both attributes present, or none).We need to validate those values if they present with exact text, the user may input the wrong values where we need to restrict API and not push the stack. Any suggestion how to handle this case?
Beta Was this translation helpful? Give feedback.
All reactions