Skip to content

Commit

Permalink
Update Secret struct field name for validation status
Browse files Browse the repository at this point in the history
  • Loading branch information
Baruch Odem committed Feb 19, 2024
1 parent fb82f36 commit c2985a6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions secrets/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ const (
)

type Secret struct {
ID string `json:"id"`
Source string `json:"source"`
RuleID string `json:"ruleId"`
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
StartColumn int `json:"startColumn"`
EndColumn int `json:"endColumn"`
Value string `json:"value"`
Validation ValidationResult `json:"validation,omitempty"`
ID string `json:"id"`
Source string `json:"source"`
RuleID string `json:"ruleId"`
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
StartColumn int `json:"startColumn"`
EndColumn int `json:"endColumn"`
Value string `json:"value"`
ValidationStatus ValidationResult `json:"validationStatus,omitempty"`
}

type validationFunc = func(*Secret) ValidationResult
Expand All @@ -38,9 +38,9 @@ var ruleIDToFunction = map[string]validationFunc{
func (s *Secret) Validate(wg *sync.WaitGroup) {
defer wg.Done()
if f, ok := ruleIDToFunction[s.RuleID]; ok {
s.Validation = f(s)
s.ValidationStatus = f(s)
} else {
s.Validation = Unknown
s.ValidationStatus = Unknown
}
}

Expand Down

0 comments on commit c2985a6

Please sign in to comment.