Skip to content

Commit

Permalink
fixed script test app
Browse files Browse the repository at this point in the history
  • Loading branch information
joreiche committed Apr 13, 2024
1 parent 3aa5fc7 commit 4ec01d2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
4 changes: 1 addition & 3 deletions pkg/script/expressions/true-expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ type TrueExpression struct {
func (what *TrueExpression) ParseBool(script any) (common.BoolExpression, any, error) {
what.literal = common.ToLiteral(script)

what.literal = common.ToLiteral(script)

item, errorScript, itemError := new(ExpressionList).ParseAny(script.(map[string]any))
item, errorScript, itemError := new(ExpressionList).ParseAny(script)
if itemError != nil {
return nil, errorScript, fmt.Errorf("failed to parse true-expression: %v", itemError)
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/security/types/technology.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ const (
)

type Technology struct {
Name string `yaml:"name,omitempty"`
Parent string `yaml:"parent,omitempty"`
Description string `yaml:"description,omitempty"`
Aliases []string `yaml:"aliases,omitempty"`
Examples []string `yaml:"examples,omitempty"`
Attributes map[string]bool `yaml:"attributes,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Parent string `yaml:"parent,omitempty" json:"parent,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Aliases []string `yaml:"aliases,omitempty" json:"aliases,omitempty"`
Examples []string `yaml:"examples,omitempty" json:"examples,omitempty"`
Attributes map[string]bool `yaml:"attributes,omitempty" json:"attributes,omitempty"`
}

func (what Technology) String() string {
Expand Down
24 changes: 14 additions & 10 deletions test/risk-category.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,20 @@ script:
match:
parameter: tech_asset
do:
if:
and:
- false: "{tech_asset.out_of_scope}"
- contains:
item: "{tech_asset.technology}"
in:
- sourcecode-repository
- artifact-registry
then:
return: true
- if:
"true": "{tech_asset.out_of_scope}"
then:
return: false
- loop:
item: technology
in: "{tech_asset.technologies}"
do:
if:
or:
- true: "{technology.attributes.sourcecode-repository}"
- true: "{technology.attributes.artifact-registry}"
then:
return: true

utils:
get_title:
Expand Down

0 comments on commit 4ec01d2

Please sign in to comment.