Skip to content

Commit

Permalink
Re-introduce entity validation for rule types (mindersec#1662)
Browse files Browse the repository at this point in the history
I don't know why I commented that out, but this re-introduces that check.

Closes: mindersec#1659
  • Loading branch information
JAORMX authored Nov 15, 2023
1 parent 9f8eff5 commit f8d1322
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/api/protobuf/go/minder/v1/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ func (rt *RuleType) Validate() error {

// Validate validates a rule type definition
func (def *RuleType_Definition) Validate() error {
// if !entities.IsValidEntity(entities.FromString(def.InEntity)) {
// return fmt.Errorf("%w: invalid entity type: %s", ErrInvalidRuleTypeDefinition, def.InEntity)
// }
if !EntityFromString(def.InEntity).IsValid() {
return fmt.Errorf("%w: invalid entity type: %s", ErrInvalidRuleTypeDefinition, def.InEntity)
}

if def.RuleSchema == nil {
return fmt.Errorf("%w: rule schema is nil", ErrInvalidRuleTypeDefinition)
Expand Down

0 comments on commit f8d1322

Please sign in to comment.