Implement Policy Enforcer Plugin
- 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.
This commit is contained in:
18
policies/compliance.rego
Normal file
18
policies/compliance.rego
Normal file
@@ -0,0 +1,18 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user