/
RestApiRateLimitTerminator

RestApiRateLimitTerminator

GitHub - magesuite/rest-api-rate-limit-terminator

The purpose of this module is to override the Magento Rest API items limit in order to prevent issues with communication via API.

Installation

This module is part of MageSuite metapackage

 

Installation if metapackage is not used:

composer require "creativestyle/magesuite-rest-api-rate-limit-terminator" ^1.0.0

Admin settings

Store → Configuration → MageSuite → REST Api Rate Limit Terminator

image-20250305-100735.png

To ensure that specific endpoints are restricted by default and only accessible upon successful authorization, you can define their access control in the REST configuration. If an endpoint should require authorization, you need to add a corresponding entry to the REST permissions table and specify an appropriate ACL rule. This ACL will determine whether access is granted based on the user's permissions. If no ACL is provided, the endpoint will be blocked for unauthorized requests by default.

To mitigate excessive shopping cart creation by bots on your site, you can implement a fingerprinting mechanism to restrict cart creation within a defined time frame. By generating a unique fingerprint for each visitor—based on device attributes, IP address, or browser characteristics—you can track and limit the number of carts created per user. If multiple cart creation requests are detected within a short period, further requests can be temporarily blocked, effectively reducing automated abuse.

Backend

The only functionality in this module is the override of Magento Rest API items limit in rest-api-rate-limit-terminator/etc/di.xml file:

<type name="Magento\Framework\Webapi\Validator\EntityArrayValidator"> <arguments> <argument name="complexArrayItemLimit" xsi:type="number">999999</argument> </arguments> </type> <type name="Magento\Framework\Webapi\Validator\SearchCriteriaValidator"> <arguments> <argument name="maximumPageSize" xsi:type="number">999999</argument> </arguments> </type> <type name="Magento\Framework\GraphQl\Query\Resolver\Argument\Validator\SearchCriteriaValidator"> <arguments> <argument name="maxPageSize" xsi:type="number">999999</argument> </arguments> </type>

 

Frontend

There are no frontend functionalities in this module.

 

 

 

Related content