make GetScope normalize the scope when we can
This commit is contained in:
parent
ecb5562b57
commit
86cf353456
1 changed files with 13 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (a *Alert) HasRemediation() bool {
|
||||
return true
|
||||
}
|
||||
|
@ -8,7 +12,15 @@ func (a *Alert) GetScope() string {
|
|||
if a.Source.Scope == nil {
|
||||
return ""
|
||||
}
|
||||
return *a.Source.Scope
|
||||
//Normalize scope when we can
|
||||
switch strings.ToLower(*a.Source.Scope) {
|
||||
case "ip":
|
||||
return "Ip"
|
||||
case "range":
|
||||
return "Range"
|
||||
default:
|
||||
return *a.Source.Scope
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Alert) GetValue() string {
|
||||
|
|
Loading…
Reference in a new issue