zircote.com

development (in)action

Access Control by IP Address Ranges

Simple example of controlling access to resources based on origin IP address, this example validates origin is a private IP range.

I have also added the supporting unit test, note that I am reflecting the method inorder to set it to public visibility to allow testing of it. It should also be note that in order to generate the tests you must change the protected to public so that PHPUnit will recognize the annotated assertions and generate the desired tests.