-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
Workflow engine v0.3.11 added a built-in step.authz_check step type (via the pipelinesteps plugin). When loading workflow-plugin-authz via engine.LoadPlugin(), the plugin loader rejects it because step.authz_check is already registered:
step type "step.authz_check" already registered
Context
The built-in step.authz_check in v0.3.11 uses a PolicyEngineModule interface, but the only implementation is a "mock" backend (the resolvePolicyEngine() function does a concrete type assertion to *PolicyEngineModule). The external plugin's Casbin-backed implementation is still needed for production use.
Workaround
We bypass engine.LoadPlugin() entirely and register the plugin's factories directly via engine.AddModuleType() / engine.AddStepType(), which silently overwrite the built-in types. See GoCodeAlone/workflow#262 for details.
Suggested Fix
The plugin could check whether its step types are already registered and either:
- Skip registration of conflicting types (if the built-in is sufficient)
- Use a different step type name (e.g.,
step.authz_check_casbin) - Coordinate with the engine to allow overrides (pending Plugin loader: allow external plugins to override built-in step types workflow#262)
Related: GoCodeAlone/workflow#262 which is being addressed in GoCodeAlone/workflow#263 (primary changes are already complete in that PR)