2017 © Pedro Peláez
 

library stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

image

darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  • Thursday, June 2, 2016
  • by zanderbaldwin
  • Repository
  • 1 Watchers
  • 1 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

IP Address Build Status

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges., (*1)

Installation

Use Composer:, (*2)

composer require darsyn/stack-ip-restrict

Requirements

Although this library should work with PHP 5.3, it is not officially supported since it reached end-of-life in 2014., (*3)

As of version 2.0.0, this library supports Symfony 3 but as a result the lowest version it supports is 2.8.0., (*4)

Example Usage

<?php

use Darsyn\Stack\IpRestrict\Blacklist;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Kernel;

$kernel = new Kernel();

$stackedApp = new Blacklist($kernel, $listedIpAddresses);
// Set a custom response object to send when access is denied, if you so wish:
$stackedApp->setAccessDeniedResponse(new Response(
    'Uh-uh, no website until you pay up!',
    402
));

$request = Request::createFromGlobals();
$response = $stackedApp->handle($request);
$response->send();
$kernel->terminate();

The IpRestrict HTTP Kernel middleware is compatible with StackPHP's Builder:, (*5)

<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Kernel;

$kernel = new Kernel();

$stackedApp = (new Stack\Builder)
    ->push('Darsyn\Stack\IpRestrict\Blacklist', $listedIpAddresses)
    // All your other middlewares...
    ->resolve($kernel);

$request = Request::createFromGlobals();
$response = $stackedApp->handle($request);
$response->send();
$kernel->terminate();

License

Please see the separate license file included in this repository for a full copy of the MIT license, which this project is licensed under., (*6)

Authors

If you make a contribution (submit a pull request), don't forget to add your name here!, (*7)

The Versions

02/06 2016

dev-develop

dev-develop https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

02/06 2016

dev-master

9999999-dev https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

02/06 2016

3.0.0

3.0.0.0 https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

22/04 2016

2.0.0

2.0.0.0 https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

04/09 2015

dev-feature/allow-all-datasets

dev-feature/allow-all-datasets https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

31/08 2015

1.0.2

1.0.2.0 https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

25/08 2015

1.0.1

1.0.1.0 https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist

25/08 2015

1.0.0

1.0.0.0 https://github.com/darsyn/stack-ip-restrict

HTTP Kernel middleware for restriction applications, both blacklisting and whitelisting, from IP ranges.

  Sources   Download

MIT

The Requires

 

The Development Requires

middleware stack library ip blacklist ipv6 ipv4 whitelist