| 1 |
<?php |
| 2 |
namespace Depicter\Security; |
| 3 |
|
| 4 |
use WPEmerge\Csrf\Csrf as CsrfBase; |
| 5 |
|
| 6 |
|
| 7 |
class CSRF extends CsrfBase |
| 8 |
{ |
| 9 |
const EDITOR_ACTION = 'depicter-editor'; |
| 10 |
const DASHBOARD_ACTION = 'depicter-dashboard'; |
| 11 |
const ASSET_ACTION = 'depicter-asset'; |
| 12 |
const REPORT_ACTION = 'depicter-report'; |
| 13 |
|
| 14 |
/** |
| 15 |
* Convenience header to check for the token. |
| 16 |
* |
| 17 |
* @var string |
| 18 |
*/ |
| 19 |
protected $header = 'X-DEPICTER-CSRF'; |
| 20 |
|
| 21 |
/** |
| 22 |
* Constructor. |
| 23 |
* |
| 24 |
* @codeCoverageIgnore |
| 25 |
* @param string $key |
| 26 |
* @param integer $maximum_lifetime |
| 27 |
*/ |
| 28 |
public function __construct( $key = 'depicter-csrf', $maximum_lifetime = 2 ) { |
| 29 |
$this->key = $key; |
| 30 |
$this->maximum_lifetime = $maximum_lifetime; |
| 31 |
} |
| 32 |
} |
| 33 |
|