gog/recaptcha-firewall

此包已废弃且不再维护。未建议替代包。

安装数: 5,255

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 11

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.2 2015-11-02 12:25 UTC

This package is not auto-updated.

Last update: 2018-05-15 00:51:09 UTC


README

这是一个简单的组件,通过添加ReCaptcha验证来保护路由。

安装

使用composer安装

$ composer require gog/recaptcha-firewall

然后在AppKernel.php文件中注册这个bundle

public function registerBundles()
{
    $bundles = array(
        // ...
        new GOG\Security\RecaptchaFirewall\Bundle\GOGSecurityRecaptchaFirewallBundle(),
        // ...
    );

    return $bundles;
}

配置

只需将以下行添加到您的config.yml文件中即可配置bundle。

gog_security_recaptcha_firewall:
    secret: your_secret
    site_key: your_site_key
    routes:
        - route_name1
        - route_name2

它是如何工作的?

配置树中添加的每个路由都会检查有效的g-recaptcha-response令牌。如果验证失败,您将在检查的路由上收到一个403 JSON响应。