defender: allow to impose a delay between login attempts

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-05-17 20:48:18 +02:00
parent b2bea85add
commit 50a3c0d911
17 changed files with 174 additions and 82 deletions

View File

@@ -327,6 +327,13 @@ func Reload() error {
return nil
}
// DelayLogin applies the configured login delay
func DelayLogin(err error) {
if Config.defender != nil {
Config.defender.DelayLogin(err)
}
}
// IsBanned returns true if the specified IP address is banned
func IsBanned(ip, protocol string) bool {
if plugin.Handler.IsIPBanned(ip, protocol) {