- Renamed the `PolicyEnforcer` interface and related implementations to `PolicyChecker` for clarity and consistency. - Updated configuration keys in YAML files to reflect the new `checkPolicy` terminology. - Adjusted related code, tests, and documentation to support the new naming convention and ensure compatibility. - Enhanced comments and examples for the `checkPolicy` configuration to improve usability.
18 lines
424 B
Go
18 lines
424 B
Go
package definition
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/beckn-one/beckn-onix/pkg/model"
|
|
)
|
|
|
|
// PolicyChecker interface for policy checking on incoming messages.
|
|
type PolicyChecker interface {
|
|
CheckPolicy(ctx *model.StepContext) error
|
|
}
|
|
|
|
// PolicyCheckerProvider interface for creating policy checkers.
|
|
type PolicyCheckerProvider interface {
|
|
New(ctx context.Context, config map[string]string) (PolicyChecker, func(), error)
|
|
}
|