add support for a basic built-in defender

It can help to prevent DoS and brute force password guessing
This commit is contained in:
Nicola Murino
2021-01-02 14:05:09 +01:00
parent 30eb3c4a99
commit 037d89a320
23 changed files with 1530 additions and 131 deletions

View File

@@ -106,7 +106,7 @@ var (
// ErrNoInitRequired defines the error returned by InitProvider if no inizialization/update is required
ErrNoInitRequired = errors.New("The data provider is already up to date")
// ErrInvalidCredentials defines the error to return if the supplied credentials are invalid
ErrInvalidCredentials = errors.New("Invalid credentials")
ErrInvalidCredentials = errors.New("invalid credentials")
webDAVUsersCache sync.Map
config Config
provider Provider
@@ -352,7 +352,7 @@ type RecordNotFoundError struct {
}
func (e *RecordNotFoundError) Error() string {
return fmt.Sprintf("Not found: %s", e.err)
return fmt.Sprintf("not found: %s", e.err)
}
// GetQuotaTracking returns the configured mode for user's quota tracking