2017 © Pedro Peláez
 

symfony-bundle csrf-validator-bundle

Validate CSRF token via annotation

image

korotovsky/csrf-validator-bundle

Validate CSRF token via annotation

  • Thursday, December 22, 2016
  • by korotovsky
  • Repository
  • 2 Watchers
  • 9 Stars
  • 41,485 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

Intro to KrtvCsrfValidatorBundle

  • PHP >=5.5
  • KrtvCsrfValidatorBundle's master compatible with symfony (>=2.5 versions).
  • Doctrine is required

Features:

  • Add extra annotation for auto validation CSRF-tokens to your controller actions

Installation and configuration:

Pretty simple with Composer, add:, (*1)

{
    "require": {
        "korotovsky/csrf-validator-bundle": "0.3.*"
    }
}

For latest version (UNSTABLE) use, (*2)

{
    "require": {
        "korotovsky/csrf-validator-bundle": "dev-master"
    }
}

, (*3)

Configuration example

  • No specific configuration is needed!

Add KrtvCsrfValidatorBundle to your application kernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Krtv\Bundle\CsrfValidatorBundle\KrtvCsrfValidatorBundle(),
        // ...
    );
}

Usage examples:

Just add annotation to your controller action, (*4)

// Acme\MainBundle\Controller\DefaultController.php

use Krtv\Bundle\CsrfValidatorBundle\Annotations as Krtv;

/**
 * @Krtv\Csrf(intention="your_intention")
 * @return Response
 */
public function importantZoneAction()
{
    // some code here ...

    return new Response();
}

View

<a href="{{ path('_some_route', {'token': csrf_token('your_intention')}) }}">Subscribe!</a>

The Versions

18/11 2014

0.3.0

0.3.0.0 http://korotovsky.io

Validate CSRF token via annotation

  Sources   Download

MIT

The Requires

 

by Dmitry Korotovsky

validation security csrf

02/06 2014

0.2.0

0.2.0.0 http://korotovsky.io

Validate CSRF token via annotation

  Sources   Download

MIT

The Requires

 

by Dmitry Korotovsky

validation security csrf

11/04 2014

0.1.1

0.1.1.0 http://korotovsky.io

Validate CSRF token via annotation

  Sources   Download

MIT

The Requires

 

by Dmitry Korotovsky

validation security csrf

11/04 2014

0.1.0

0.1.0.0

Validate CSRF token via annotation

  Sources   Download

BSD

The Requires

  • php >=5.5