https://github.com/thecodingmachine/csrf-header-check-middleware-universal-module
Cross-framework module for thecodingmachine/csrf-header-check-middleware
https://github.com/thecodingmachine/csrf-header-check-middleware-universal-module
Last synced: 3 months ago
JSON representation
Cross-framework module for thecodingmachine/csrf-header-check-middleware
- Host: GitHub
- URL: https://github.com/thecodingmachine/csrf-header-check-middleware-universal-module
- Owner: thecodingmachine
- Created: 2017-06-08T16:57:19.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T16:56:23.000Z (over 8 years ago)
- Last Synced: 2025-02-16T12:30:25.899Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)
[](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)
[](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)
# TheCodingMachine's CSRF header checker middleware universal module
This package integrates the [TheCodingMachine's CSRF header checker middleware](https://github.com/thecodingmachine/csrf-header-check-middleware) in any [container-interop](https://github.com/container-interop/service-provider) compatible framework/container.
## Installation
```
composer require thecodingmachine/csrf-header-check-middleware-universal-module
```
Once installed, you need to register the [`TheCodingMachine\Middlewares\CsrfHeaderCheckMiddlewareServiceProvider`](src/CsrfHeaderCheckMiddlewareServiceProvider.php) into your container.
If your container supports [thecodingmachine/discovery](https://github.com/thecodingmachine/discovery) integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register *service providers*.
## Introduction
This middleware checks HTTP header to prevent CSRF attacks.
This service provider adds the middleware at the beginning of the stack.
## Provided services
This *service provider* provides the following services:
| Service name | Description |
|-----------------------------|--------------------------------------|
| `TheCodingMachine\Middlewares\CsrfHeaderCheckMiddlewareServiceProvider` | The CSRF checker middleware |
## Extended services
This *service provider* extends those services:
| Name | Compulsory | Description |
|-----------------------------|------------|----------------------------------------|
| `MiddlewareListServiceProvider::MIDDLEWARES_QUEUE` | *no* | This service providers inserts the CSRF middleware in the middleware queue. |