<commit_before>![logo](http://eden.openovate.com/assets/images/cloud-social.png) Eve CSRF Plugin
====
CSRF checker for the Eve Framework
====
[![Build Status](https://api.travis-ci.org/eve-php/eve-plugin-csrf.png)](https://travis-ci.org/eve-php/eve-plugin-csrf)
====

- [Install](#install)
- [Usage](#usage)

====

<a name="install"></a>
## Install

`composer install eve-php/eve-plugin-csrf`

====

<a name="usage"></a>
## Usage

1. Add this in public/index.php towards the top of the bootstrap chain.

```
//CSRF
->add(Eve\Plugin\Csrf\Setup::i()->import('1234567890'))
```

`'1234567890'` is the escape key you use when writing tests for pages using this plugin.

2. For each route, determine whether a CSRF ID should be generated and/or checked as in
 
```
'/product/create' => array(
	'method' => 'ALL',<commit_msg>poser<commit_after>![logo](http://eden.openovate.com/assets/images/cloud-social.png) Eve CSRF Plugin
====
CSRF checker for the Eve Framework
====
[![Build Status](https://api.travis-ci.org/eve-php/eve-plugin-csrf.png)](https://travis-ci.org/eve-php/eve-plugin-csrf) [![Latest Stable Version](https://poser.pugx.org/eve-php/eve-plugin-csrf/v/stable)](https://packagist.org/packages/eve-php/eve-plugin-csrf) [![Total Downloads](https://poser.pugx.org/eve-php/eve-plugin-csrf/downloads)](https://packagist.org/packages/eve-php/eve-plugin-csrf) [![Latest Unstable Version](https://poser.pugx.org/eve-php/eve-plugin-csrf/v/unstable)](https://packagist.org/packages/eve-php/eve-plugin-csrf) [![License](https://poser.pugx.org/eve-php/eve-plugin-csrf/license)](https://packagist.org/packages/eve-php/eve-plugin-csrf)
====

- [Install](#install)
- [Usage](#usage)

====

<a name="install"></a>
## Install

`composer install eve-php/eve-plugin-csrf`

====

<a name="usage"></a>
## Usage

1. Add this in public/index.php towards the top of the bootstrap chain.

```
//CSRF
->add(Eve\Plugin\Csrf\Setup::i()->import('1234567890'))
```

`'1234567890'` is the escape key you use when writing tests for pages using this plugin.

2. For each route, determine whether a CSRF ID should be generated and/or checked as in
 
```
'/product/create' => array(
	'method' => 'ALL',
{'fraction_non_alphanumeric': 0.20423183072677092, 'fraction_numerical': 0.020239190432382703, 'mean_word_length': 4.576923076923077, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1102522', 'n_tokens_mistral': 839, 'n_tokens_neox': 783, 'n_words': 152}