Skip to content

Commit ee16515

Browse files
committed
Added back the saving the exceeded limits to panoply for unknown users
1 parent 0af6a47 commit ee16515

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java

+6
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ private void rateLimitAnonymousRequest(String ipAddress, LocalDate today, HttpSe
199199
dailyLimitsObj.put(PapiRateLimitRedisClient.KEY_LAST_MODIFIED, System.currentTimeMillis());
200200
papiRedisClient.setTodayLimitsForClient(ipAddress, dailyLimitsObj);
201201
if (Features.ENABLE_PAPI_RATE_LIMITING.isActive() && (limitValue + 1) >= anonymousRequestLimit) {
202+
if (enablePanoplyPapiExceededRateInProduction) {
203+
PanoplyPapiDailyRateExceededItem item = new PanoplyPapiDailyRateExceededItem();
204+
item.setIpAddress(ipAddress);
205+
item.setRequestDate(today);
206+
setPapiRateExceededItemInPanoply(item);
207+
}
202208
httpServletResponse.setStatus(HttpStatus.TOO_MANY_REQUESTS.value());
203209
if (!httpServletResponse.isCommitted()) {
204210
try (PrintWriter writer = httpServletResponse.getWriter()) {

0 commit comments

Comments
 (0)