changes pipeline

This commit is contained in:
Anthony Stirling
2023-12-20 19:29:13 +00:00
parent 1ea3fb209b
commit eab9e3cffc
15 changed files with 289 additions and 100 deletions

View File

@@ -0,0 +1,18 @@
package stirling.software.SPDF.config.security;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class RateLimitResetScheduler {
private final IPRateLimitingFilter rateLimitingFilter;
public RateLimitResetScheduler(IPRateLimitingFilter rateLimitingFilter) {
this.rateLimitingFilter = rateLimitingFilter;
}
@Scheduled(cron = "0 0 0 * * MON") // At 00:00 every Monday
public void resetRateLimit() {
rateLimitingFilter.resetRequestCounts();
}
}