Download the PHP package yireo/magento2-graph-ql-rate-limiting without Composer

On this page you can find all versions of the php package yireo/magento2-graph-ql-rate-limiting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-graph-ql-rate-limiting

Yireo GraphQlRateLimiting

Magento 2 module to add rate limiting to GraphQL resources

WARNING: As of yet, the sunspikes/php-ratelimiter library is no longer being maintained. And because of this, this module is dead, until it is refactored to use another rate limiting tool.

This module implements the sunspikes/php-ratelimiter in Magento 2. It checks how many GraphQL mutations and/or GraphQL queries are sent from a specific client to a Magento instance and if the number of these requests exceeds a configured maximum, a GraphQL error is generated.

This module is specifically recommended for limiting mutations, so that your Magento shop is not flooded with fake requests to create sessions, customers or other data. Usually, in a headless environment, the amount of mutations is limited.

Usage

Install this extension:

composer require yireo/magento2-graph-ql-rate-limiting
bin/magento module:enable Yireo_GraphQlRateLimiting
bin/magento setup:upgrade

Next, login to the Magento Admin Panel, navigate to Store Configuration and then Yireo > Yireo GraphQlRateLimiting > Settings and modify the settings to your needs. The default might be fine though. The settings Enabled and Limit Mutations are definitely to be enabled, otherwise this extension is kind of pointless. Whether Limit Queries is useful up to you. The settings Maximum Queries and Maximum Mutations refer to the maximum amount of queries or mutations to be made within a certain timeframe (Timeframe) before a connection is denied for the remainder of that timeframe.

Finally, navigate to Cache Management and enable the cache GraphQL Rate Limiting:

bin/magento cache:enable graphql_rate_limiting

Testing to see if this works

Open up GraphiQL or some other client and create a simple request like the following:

Configure the following settings in this Magento module (under the Store Configuration):

After running the same query three-times an error should popup up:

Testing of the cache type

This extension adds a Cache Type GRAPHQL_RATE_LIMITING to the Magento cache frontends. To test whether the Cache Type is working, you can run the following Functional Test:

Other functional tests

To run other functional tests, the following can be used:

Please note that this resets your configuration. Do not do this on a live Magento site.

Todo


All versions of magento2-graph-ql-rate-limiting with dependencies

PHP Build Version
Package Version
Requires magento/framework Version ^100.1|^101.0|^102.0|^103.0
magento/module-checkout Version ^100.1
magento/module-quote Version ^100.1|^101.0
sunspikes/php-ratelimiter Version 1.2.1
php Version 7.4.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yireo/magento2-graph-ql-rate-limiting contains the following files

Loading the files please wait ....