- 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.
18 lines
425 B
Go
18 lines
425 B
Go
package definition
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/beckn-one/beckn-onix/pkg/model"
|
|
)
|
|
|
|
// PolicyEnforcer interface for policy enforcement on incoming messages.
|
|
type PolicyEnforcer interface {
|
|
Run(ctx *model.StepContext) error
|
|
}
|
|
|
|
// PolicyEnforcerProvider interface for creating policy enforcers.
|
|
type PolicyEnforcerProvider interface {
|
|
New(ctx context.Context, config map[string]string) (PolicyEnforcer, func(), error)
|
|
}
|