glynnforrest / blockade
An easy to use firewall and security library for PHP and the Symfony HttpKernel.
Installs: 1 076
Dependents: 2
Suggesters: 1
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
- symfony/event-dispatcher: 2.4.*
- symfony/http-foundation: 2.4.*
- symfony/http-kernel: 2.4.*
This package is not auto-updated.
Last update: 2022-02-01 12:34:30 UTC
README
Blockade is an easy to use firewall and security library for PHP and the Symfony HttpKernel.
It uses the kernel.exception
event to listen for instances of
BlockadeException
and return a response, depending on the type of
exception thrown. These exceptions can be thrown at any point in the
request, and it's straightforward to create custom exceptions.
Resolvers are responsible for converting an exception to a response,
such as an access denied page or a redirect to a login form. A single
resolver doesn't have to support every exception or return a
response. For example, a resolver that logs unauthorized requests
would only listens for AuthorizationException
, leaving another
resolver to create a response.
A FirewallListener
can be set up to check incoming requests and
throw AuthenticationException
, AuthorizationException
and
AnonymousException
for you.
Installation
Blockade is installed via Composer. To add it to your project, simply add it to your composer.json file:
{ "require": { "glynnforrest/blockade": "0.2.*" } }
And run composer to update your dependencies:
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
License
MIT, see LICENSE for details.
Copyright 2014 Glynn Forrest