diff options
| author | Jakob L. Kreuze | 2023-11-15 14:59:30 -0500 |
|---|---|---|
| committer | Jakob L. Kreuze | 2023-11-15 14:59:30 -0500 |
| commit | dd0b3db4525170ec0a6f4ae7c9ccc3bda60d7597 (patch) | |
| tree | 989b83523fa1c04dab7d98bd1350ca972acd650f | |
| parent | fd40392d5d6b796a85637bc96c564a6e173e8858 (diff) | |
Add semantics for obligation/advice expressions
| -rw-r--r-- | xacml-translation/match.rego | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/xacml-translation/match.rego b/xacml-translation/match.rego index a92a679..947c857 100644 --- a/xacml-translation/match.rego +++ b/xacml-translation/match.rego @@ -272,6 +272,29 @@ evaluate_expression({ "expression": "function", "function": name }) := x if { } ######################################################################## +# Obligations and Advice +######################################################################## + +evaluate_attribute_assignment_expression(expr) := assignment { + { "kind": "primitive", "value": inner } = evaluate_expression(expr.expression) + assignment := { "category": expr.category, + "identifier": expr.identifier, + "issuer": expr.issuer, + "value": inner } +} + +evaluate_obligation_expression(obligation_expression) := obligation { + assignments := [evaluate_attribute_assignment_expression(expr) | expr := obligation_expression.assignments[_]] + obligation := { "assignments": assignments, "identifier": obligation_expression.identifier } +} + +evaluate_advice_expression(advice_expression) := advice { + assignments := [evaluate_attribute_assignment_expression(expr) | expr := advice_expression.assignments[_]] + advice := { "assignments": assignments, "identifier": advice_expression.identifier } +} + + +######################################################################## # Rule ######################################################################## |