mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-09 16:25:15 +03:00
defender: allow to set a different score for "no auth tried" events
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -24,6 +24,11 @@ const (
|
||||
"sftpgo serve -c \"<path to dir containing the default config file and templates directory>\""
|
||||
)
|
||||
|
||||
// errors definitions
|
||||
var (
|
||||
ErrNotFound = NewRecordNotFoundError("")
|
||||
)
|
||||
|
||||
// ValidationError raised if input data is not valid
|
||||
type ValidationError struct {
|
||||
err string
|
||||
@@ -55,6 +60,12 @@ func (e *RecordNotFoundError) Error() string {
|
||||
return fmt.Sprintf("not found: %s", e.err)
|
||||
}
|
||||
|
||||
// Is reports if target matches
|
||||
func (e *RecordNotFoundError) Is(target error) bool {
|
||||
_, ok := target.(*RecordNotFoundError)
|
||||
return ok
|
||||
}
|
||||
|
||||
// NewRecordNotFoundError returns a not found error
|
||||
func NewRecordNotFoundError(error string) *RecordNotFoundError {
|
||||
return &RecordNotFoundError{
|
||||
|
||||
Reference in New Issue
Block a user