Parent
Sub-issue of #221
Summary
Align IPP's FactoryFunc signature with EPP's to use *json.Decoder instead of json.RawMessage, enabling strict parameter parsing via DisallowUnknownFields.
Context
This is independent of the CycleState → request attributes migration (#288) and can be done in parallel.
Current (IPP):
type FactoryFunc func(name string, parameters json.RawMessage, handle Handle) (Plugin, error)
Target (EPP):
type FactoryFunc func(name string, parameters *json.Decoder, handle Handle) (Plugin, error)
Changes
1. Import FactoryFunc and StrictDecoder from EPP
- Add
FactoryFunc = eppplugin.FactoryFunc type alias in epp.go (same pattern as Phase 1)
- Import
StrictDecoder from EPP (converts json.RawMessage → strict *json.Decoder)
2. Update all plugin factory implementations
- Change
json.Unmarshal(rawParameters, &config) to rawParameters.Decode(&config)
- Handle nil decoder (no parameters) instead of
len(rawParameters) == 0
- All 15 in-tree factories in
cmd/runner/runner.go need updating
3. Update config loader
- Use
StrictDecoder at the call site where raw config parameters are passed to factories
Acceptance criteria
Parent
Sub-issue of #221
Summary
Align IPP's
FactoryFuncsignature with EPP's to use*json.Decoderinstead ofjson.RawMessage, enabling strict parameter parsing viaDisallowUnknownFields.Context
This is independent of the CycleState → request attributes migration (#288) and can be done in parallel.
Current (IPP):
Target (EPP):
Changes
1. Import FactoryFunc and StrictDecoder from EPP
FactoryFunc = eppplugin.FactoryFunctype alias inepp.go(same pattern as Phase 1)StrictDecoderfrom EPP (convertsjson.RawMessage→ strict*json.Decoder)2. Update all plugin factory implementations
json.Unmarshal(rawParameters, &config)torawParameters.Decode(&config)len(rawParameters) == 0cmd/runner/runner.goneed updating3. Update config loader
StrictDecoderat the call site where raw config parameters are passed to factoriesAcceptance criteria
FactoryFuncimported from EPP via type alias*json.DecoderparameterStrictDecoderused at config loading call sitemake testpassesmake lintpasses