- Added a new Policy Enforcer plugin to evaluate incoming messages against OPA policies. - Configurable via YAML with options for policy sources, actions, and query. - Integrated into existing configuration files for BAP and BPP. - Updated related tests and documentation for the new functionality. - Enhanced plugin manager to support Policy Enforcer instantiation.
19 lines
582 B
Rego
19 lines
582 B
Rego
package policy
|
|
|
|
import rego.v1
|
|
|
|
# Example policy: validate confirm action messages.
|
|
# This is a sample policy file. Replace with your actual business rules.
|
|
#
|
|
# The policy evaluates incoming beckn messages and produces a set of
|
|
# violation strings. If any violations exist, the adapter will NACK
|
|
# the request.
|
|
#
|
|
# Available inputs:
|
|
# - input: the full JSON message body
|
|
# - data.config: runtime config from the adapter config (e.g., minDeliveryLeadHours)
|
|
|
|
# violations is the set of policy violation messages.
|
|
# An empty set means the message is compliant.
|
|
violations := set()
|