ebyratu
ebyratu

Reputation: 293

Limit of API requests on Symfony, how best to implement?

I try to make the API service logically need to somehow provide for the limit of requests to its methods. They do not say this in the guides. How to implement it correctly, if you do it yourself? Perhaps you are using something ready for this? It is necessary to limit access for authorized users by their ID number of requests per minute / hour for different methods in different ways

Upvotes: 1

Views: 4602

Answers (1)

Mikhail Prosalov
Mikhail Prosalov

Reputation: 4345

Please take a look at NoxlogicRateLimitBundle. Probably it'll fit your requirements.

<?php

use Noxlogic\RateLimitBundle\Annotation\RateLimit;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

/**
 * @Route(...)
 *
 * @RateLimit(limit=1000, period=3600)
 */
public function someApiAction()
{
}

Upvotes: 6

Related Questions