diff --git a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl index 2f115558c5..9ce975f7c0 100644 --- a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl +++ b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl @@ -6,15 +6,10 @@ This is an important message to let you know that you have exceeded your daily P Client Name: ${clientName} Client ID: ${clientId} -Please remember that the ORCID Public API is free for non-commercial use by individuals as stated in the Public APIs Terms of Service (https://info.orcid.org/public-client-terms-of-service). By “non-commercial” we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service. +Please remember that the ORCID Public API is free for non-commercial use by individuals as stated in the Public APIs Terms of Service (https://info.orcid.org/public-client-terms-of-service). By "non-commercial" we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service. Based on your API usage, we highly recommend you consider becoming an ORCID member for access to our Member API (https://info.orcid.org/documentation/features/member-api/). Not only will it allow you to access a higher Rate Limits and an unrestricted Usage Quota, but you will be able to access Trusted Party data in ORCID records and contribute data to ORCID records from your institutional systems. To minimize any disruption to your ORCID integration in the future, we would recommend that you reach out to our Engagement Team by replying to this email to discuss our ORCID membership options. - -Warm Regards, -ORCID Support Team -https://support.orcid.org - <#include "email_footer.ftl"/> diff --git a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl index 703541df9f..90c53a23ca 100644 --- a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl +++ b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl @@ -14,17 +14,10 @@

Client Name: ${clientName}

Client ID: ${clientId}


-

Please remember that the ORCID Public API is free for non-commercial use by individuals as stated in the Public APIs Terms of Service. By “non-commercial” we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service.

+

Please remember that the ORCID Public API is free for non-commercial use by individuals as stated in the Public APIs Terms of Service. By "non-commercial" we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service.

Based on your API usage, we highly recommend you consider becoming an ORCID member for access to our Member API. Not only will it allow you to access a higher Rate Limits and an unrestricted Usage Quota, but you will be able to access Trusted Party data in ORCID records and contribute data to ORCID records from your institutional systems.

To minimize any disruption to your ORCID integration in the future, we would recommend that you reach out to our Engagement Team by replying to this email to discuss our ORCID membership options. -
-

- Warm Regards, - ORCID Support Team - https://support.orcid.org -

- -

+

<#include "email_footer_html.ftl"/>

diff --git a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java index 7a72f9301e..ea5e200cdd 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java @@ -3,10 +3,7 @@ import java.io.IOException; import java.io.PrintWriter; import java.time.LocalDate; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.CompletableFuture; import javax.annotation.Resource; @@ -103,7 +100,7 @@ public class ApiRateLimitFilter extends OncePerRequestFilter { private List papiIpWhiteList; private List papiClientIdWhiteList; - private static final String TOO_MANY_REQUESTS_MSG = "Too Many Requests. You have exceeded the daily quota for anonymous usage of this API. \\n" + private static final String TOO_MANY_REQUESTS_MSG = "Too Many Requests. You have exceeded the daily quota for anonymous usage of this API. \n" + "You can increase your daily quota by registering for and using Public API client credentials " + "(https://info.orcid.org/documentation/integration-guide/registering-a-public-api-client/)"; @@ -160,6 +157,7 @@ public void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletR LOG.error("Papi Limiting Filter unexpected error, ignore and chain request.", ex); } } + filterChain.doFilter(httpServletRequest, httpServletResponse); } diff --git a/orcid-pub-web/src/test/java/org/orcid/api/filters/ApiRateLimitFilterTest.java b/orcid-pub-web/src/test/java/org/orcid/api/filters/ApiRateLimitFilterTest.java index cc4fa6684a..064e759043 100644 --- a/orcid-pub-web/src/test/java/org/orcid/api/filters/ApiRateLimitFilterTest.java +++ b/orcid-pub-web/src/test/java/org/orcid/api/filters/ApiRateLimitFilterTest.java @@ -203,6 +203,6 @@ public void doFilterInternal_checkLimitReachedTest() throws ServletException, IO assertEquals(429, httpServletResponseMock.getStatus()); String content = httpServletResponseMock.getContentAsString(); - assertEquals("Too Many Requests. You have exceeded the daily quota for anonymous usage of this API. \\nYou can increase your daily quota by registering for and using Public API client credentials (https://info.orcid.org/documentation/integration-guide/registering-a-public-api-client/)", content); + assertEquals("Too Many Requests. You have exceeded the daily quota for anonymous usage of this API. \nYou can increase your daily quota by registering for and using Public API client credentials (https://info.orcid.org/documentation/integration-guide/registering-a-public-api-client/)", content); } } \ No newline at end of file