aboutsummaryrefslogtreecommitdiff
path: root/auth_mtpostgresql.go
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-11-17 16:39:09 +0100
committerHimbeer <himbeer@disroot.org>2024-11-17 16:39:09 +0100
commit3b344731fff17f3c5255f278f8f14879e7610f7d (patch)
treef92726ba8364a21e450ff4b53fedfd285ab253e5 /auth_mtpostgresql.go
parentd0d39d2f9f3abb68eec146376b3233c8bc7c1cfa (diff)
Notify authentication backends of failed login attempts
Closes #157.
Diffstat (limited to 'auth_mtpostgresql.go')
-rw-r--r--auth_mtpostgresql.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/auth_mtpostgresql.go b/auth_mtpostgresql.go
index dc7f2f3..790a30f 100644
--- a/auth_mtpostgresql.go
+++ b/auth_mtpostgresql.go
@@ -5,7 +5,6 @@ import (
"database/sql"
"errors"
"fmt"
- "net"
"os"
"strings"
"time"
@@ -261,16 +260,21 @@ func (a *AuthMTPostgreSQL) Unban(id string) error {
// Banned reports whether a network address is banned.
// Error cases count as banned.
-func (a *AuthMTPostgreSQL) Banned(addr *net.UDPAddr) bool {
+func (a *AuthMTPostgreSQL) Banned(addr, name string) bool {
bans, err := a.readBans()
if err != nil {
return true
}
- _, ok := bans[addr.IP.String()]
+ _, ok := bans[addr]
return ok
}
+// RecordFail is a no-op.
+func (a *AuthMTPostgreSQL) RecordFail(addr, name string, sudo bool) error {
+ return nil
+}
+
// ImportBans adds the passed entries.
func (a *AuthMTPostgreSQL) ImportBans(in []Ban) error {
for _, b := range in {