Files
auth-proxy/cleanup.go
db123-test f525eaa8f3 feat: enhance auth, add input validation and pagination
- Add IP validation in auth handler with detailed logging
- Implement apiKeyMiddleware helper for API key verification
- Add IP and CIDR validation for whitelist operations
- Support pagination for listing temp and permanent entries
- Add parsePagination helper to extract limit and offset
- Include comprehensive unit tests for IsIP, IsCIDR, and IPMatch
2026-05-05 11:34:35 +03:30

22 lines
330 B
Go

package main
import (
"context"
"database/sql"
"time"
)
func cleanupLoop(ctx context.Context, db *sql.DB, interval time.Duration) {
ticker := time.NewTicker(interval)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return
case <-ticker.C:
_ = CleanupExpiredTemp(db)
_ = RotateAuditLog(db, 0)
}
}
}