Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Created June 16, 2020 08:39
Show Gist options
  • Save developer-guy/1c801d6fb5ba25fdac82687bd5acc2b9 to your computer and use it in GitHub Desktop.
Save developer-guy/1c801d6fb5ba25fdac82687bd5acc2b9 to your computer and use it in GitHub Desktop.
opa test
# example.rego
package authz
allow {
input.path == ["users"]
input.method == "POST"
}
# example_test.rego
test_post_allowed {
allow with input as {"path": ["users"], "method": "POST"}
}
$ opa test . -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment