RateLimitBundle:用于为 API 提供速率限制的 Symfony 包

时间:2021-06-12 07:37:51
【文件属性】:
文件名称:RateLimitBundle:用于为 API 提供速率限制的 Symfony 包
文件大小:27KB
文件格式:ZIP
更新时间:2021-06-12 07:37:51
PHP 周边速率限制捆绑 建立在独立的限速库之上 对这些 API 进行速率限制! 安装 $ composer.phar require perimeter/rate-limit-bundle:dev-develop 开始 这个库可以通过两种方式帮助你限制你的 API: 速率限制警告- 在响应中发出X-RATELIMIT-WARNING标头,否则调用不受影响。 超出速率限制- 返回 HTTP 状态代码429 Too Many Requests ,并限制调用。 配置您的仪表存储 最简单的选择是使用MemoryStorage进行仪表配置。 默认情况下,警告标头以80 个电话/小时发出,响应被限制在100 个电话/小时。 您可以在服务容器中更改这些基本默认值: < parameters> < parameter key = " perimeter.rate_limit.warn_thr
【文件预览】:
RateLimitBundle-develop
----composer.json(959B)
----.travis.yml(436B)
----DependencyInjection()
--------PerimeterRateLimitExtension.php(888B)
----Listener()
--------RateLimitListener.php(4KB)
----LICENSE(1KB)
----Resources()
--------config()
--------views()
----Resolver()
--------SecurityContextMeterResolver.php(1KB)
----Command()
--------MeterCommand.php(5KB)
----.gitignore(33B)
----Controller()
--------MeterApiController.php(6KB)
--------OverLimitController.php(1KB)
----Tests()
--------bootstrap.php(1KB)
--------Listener()
--------ContainerTest.php(2KB)
--------Resources()
--------Resolver()
--------ContainerLoader.php(1KB)
--------Command()
--------Controller()
----phpunit.xml.dist(566B)
----README.md(4KB)
----PerimeterRateLimitBundle.php(378B)

网友评论