Refactor Policy Enforcer to Policy Checker
- 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.
This commit is contained in:
@@ -35,7 +35,7 @@ type stdHandler struct {
|
||||
registry definition.RegistryLookup
|
||||
km definition.KeyManager
|
||||
schemaValidator definition.SchemaValidator
|
||||
policyEnforcer definition.PolicyEnforcer
|
||||
policyChecker definition.PolicyChecker
|
||||
router definition.Router
|
||||
publisher definition.Publisher
|
||||
transportWrapper definition.TransportWrapper
|
||||
@@ -319,7 +319,7 @@ func (h *stdHandler) initPlugins(ctx context.Context, mgr PluginManager, cfg *Pl
|
||||
if h.transportWrapper, err = loadPlugin(ctx, "TransportWrapper", cfg.TransportWrapper, mgr.TransportWrapper); err != nil {
|
||||
return err
|
||||
}
|
||||
if h.policyEnforcer, err = loadPlugin(ctx, "PolicyEnforcer", cfg.PolicyEnforcer, mgr.PolicyEnforcer); err != nil {
|
||||
if h.policyChecker, err = loadPlugin(ctx, "PolicyChecker", cfg.PolicyChecker, mgr.PolicyChecker); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -354,8 +354,8 @@ func (h *stdHandler) initSteps(ctx context.Context, mgr PluginManager, cfg *Conf
|
||||
s, err = newValidateSchemaStep(h.schemaValidator)
|
||||
case "addRoute":
|
||||
s, err = newAddRouteStep(h.router)
|
||||
case "policyEnforcer":
|
||||
s, err = newEnforcePolicyStep(h.policyEnforcer)
|
||||
case "checkPolicy":
|
||||
s, err = newCheckPolicyStep(h.policyChecker)
|
||||
default:
|
||||
if customStep, exists := steps[step]; exists {
|
||||
s = customStep
|
||||
|
||||
Reference in New Issue
Block a user