fix: removed unnecessary api user

This commit is contained in:
2026-05-04 08:16:49 +03:30
parent f0e6c09bce
commit 16dc738c1f

View File

@@ -20,8 +20,7 @@ func initDB(dbPath string) (*sql.DB, error) {
action TEXT NOT NULL,
ip TEXT NOT NULL,
ttl_seconds INTEGER DEFAULT 0,
reason TEXT,
api_user TEXT
reason TEXT
);
CREATE INDEX IF NOT EXISTS idx_timestamp ON whitelist_audit(timestamp);
`
@@ -34,9 +33,9 @@ func initDB(dbPath string) (*sql.DB, error) {
func logWhitelistEvent(db *sql.DB, action, ip string, ttl int, reason, apiUser string) {
_, err := db.Exec(
`INSERT INTO whitelist_audit(timestamp, action, ip, ttl_seconds, reason, api_user)
VALUES(?, ?, ?, ?, ?, ?)`,
time.Now(), action, ip, ttl, reason, apiUser,
`INSERT INTO whitelist_audit(timestamp, action, ip, ttl_seconds, reason)
VALUES(?, ?, ?, ?, ?)`,
time.Now(), action, ip, ttl, reason,
)
if err != nil {
slog.Error("failed to log whitelist event", "error", err)