Skip to content

Instantly share code, notes, and snippets.

@tsandall
Last active February 5, 2018 18:40
Show Gist options
  • Select an option

  • Save tsandall/fd292e5bd16a23fcde6f1c49b20ca85a to your computer and use it in GitHub Desktop.

Select an option

Save tsandall/fd292e5bd16a23fcde6f1c49b20ca85a to your computer and use it in GitHub Desktop.
Examples for Partial Evaluation post on blog.openpolicyagent.org
allow {
risk_score = (input.num_deletes * 10) + input.num_adds
risk_score < risk_limit[input.user.title]
}
default allow = false
allow {
input.method = “PUT”
input.resource = “air-conditioner”
}
allow {
input.method = “GET”
input.resource = “security-camera”
}
allow {
input.method = “POST”
input.resource = “garage-door”
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment