Skip to content

Commit

Permalink
update: mediator ecosystem case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
teodor-yanev committed Sep 26, 2023
1 parent 891a59e commit 4b347c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/github/rule-types/pr_vulnerability_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def:
ecosystems:
- name: npm
depfile: package-lock.json
- name: Go
- name: go
depfile: go.sum
# Defines the configuration for evaluating data ingested against the given policy
eval:
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/ingester/diff/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
// DepEcosystemNPM is the npm dependency ecosystem
DepEcosystemNPM DependencyEcosystem = "npm"
// DepEcosystemGo is the go dependency ecosystem
DepEcosystemGo DependencyEcosystem = "Go"
DepEcosystemGo DependencyEcosystem = "go"
// DepEcosystemNone is the fallback value
DepEcosystemNone DependencyEcosystem = ""
)
Expand Down
8 changes: 4 additions & 4 deletions internal/engine/ingester/diff/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (
type ecosystemParser func(string) ([]*pb.Dependency, error)

func newEcosystemParser(eco DependencyEcosystem) ecosystemParser {
switch eco {
case DepEcosystemNPM:
switch strings.ToLower(string(eco)) {
case string(DepEcosystemNPM):
return npmParse
case DepEcosystemGo:
case string(DepEcosystemGo):
return goParse
case DepEcosystemNone:
case string(DepEcosystemNone):
return nil
default:
return nil
Expand Down

0 comments on commit 4b347c1

Please sign in to comment.