diff --git a/modconfig/flowpipe_pipeline_step.go b/modconfig/flowpipe_pipeline_step.go index faa1355c..df25b8f4 100644 --- a/modconfig/flowpipe_pipeline_step.go +++ b/modconfig/flowpipe_pipeline_step.go @@ -2491,6 +2491,7 @@ func (p *PipelineStepInput) GetInputs(evalContext *hcl.EvalContext) (map[string] } } } + } return results, nil diff --git a/modconfig/parsed_property_path.go b/modconfig/parsed_property_path.go index 8fade3cb..912bc0c2 100644 --- a/modconfig/parsed_property_path.go +++ b/modconfig/parsed_property_path.go @@ -47,7 +47,7 @@ func ParseResourcePropertyPath(propertyPath string) (*ParsedPropertyPath, error) parts := strings.Split(propertyPath, ".") if len(parts) < 2 { - return nil, perr.BadRequestWithMessage("invalid property path passed to ParseResourcePropertyPath: " + propertyPath) + return nil, perr.BadRequestWithMessage("invalid property path: " + propertyPath) } // special case handling for runtime dependencies which may have use the "self" qualifier @@ -61,6 +61,11 @@ func ParseResourcePropertyPath(propertyPath string) (*ParsedPropertyPath, error) // put empty mod as first part parts = append([]string{""}, parts...) } + + if len(parts) < 3 { + return nil, perr.BadRequestWithMessage("invalid property path: " + propertyPath) + } + switch len(parts) { case 3: // no property path specified diff --git a/parse/pipeline_decode.go b/parse/pipeline_decode.go index 08a2d139..1e1ed098 100644 --- a/parse/pipeline_decode.go +++ b/parse/pipeline_decode.go @@ -44,17 +44,17 @@ func decodeStep(mod *modconfig.Mod, block *hcl.Block, parseCtx *ModParseContext, stepOptions, diags := block.Body.Content(pipelineStepBlockSchema) if diags.HasErrors() { - return nil, diags + return step, diags } diags = step.SetAttributes(stepOptions.Attributes, parseCtx.EvalCtx) if len(diags) > 0 { - return nil, diags + return step, diags } diags = step.SetBlockConfig(stepOptions.Blocks, parseCtx.EvalCtx) if len(diags) > 0 { - return nil, diags + return step, diags } if errorBlocks := stepOptions.Blocks.ByType()[schema.BlockTypeError]; len(errorBlocks) > 0 { @@ -69,7 +69,7 @@ func decodeStep(mod *modconfig.Mod, block *hcl.Block, parseCtx *ModParseContext, attributes, diags := errorBlock.Body.JustAttributes() if len(diags) > 0 { - return nil, diags + return step, diags } ignore := false @@ -78,12 +78,12 @@ func decodeStep(mod *modconfig.Mod, block *hcl.Block, parseCtx *ModParseContext, if attr, exists := attributes[schema.AttributeTypeIgnore]; exists { val, diags := attr.Expr.Value(nil) if len(diags) > 0 { - return nil, diags + return step, diags } var target bool if err := gocty.FromCtyValue(val, &target); err != nil { - return nil, hcl.Diagnostics{&hcl.Diagnostic{ + return step, hcl.Diagnostics{&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Error decoding ignore attribute", Detail: err.Error(), @@ -96,12 +96,12 @@ func decodeStep(mod *modconfig.Mod, block *hcl.Block, parseCtx *ModParseContext, if attr, exists := attributes[schema.AttributeTypeRetries]; exists { val, diags := attr.Expr.Value(nil) if len(diags) > 0 { - return nil, diags + return step, diags } var target int if err := gocty.FromCtyValue(val, &target); err != nil { - return nil, hcl.Diagnostics{&hcl.Diagnostic{ + return step, hcl.Diagnostics{&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Error decoding retries attribute", Detail: err.Error(), @@ -132,7 +132,7 @@ func decodeStep(mod *modconfig.Mod, block *hcl.Block, parseCtx *ModParseContext, for _, outputBlock := range outputBlocks { attributes, diags := outputBlock.Body.JustAttributes() if len(diags) > 0 { - return nil, diags + return step, diags } if attr, exists := attributes[schema.AttributeTypeValue]; exists {