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