No commit activity in last 3 years
No release in over 3 years
Basic Rack middleware for Rails 3 to authorize access to path by IP using YML config file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.6.2
>= 1.0

Runtime

>= 1.0
 Project Readme

Rack::Ip::Authorizer

Basic Rack middleware for Rails 3 to authorize access to path by IP

Installation

Add this line to your application's Gemfile:

gem 'rack-ip-authorizer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-ip-authorizer

Usage

Rails 3 apps

  1. Create an initializer defining the environment you want to watch (production by default), example:
Rack::IpAuthorizer.env_to_check = ['staging','development']
  1. Create a file named "ip_authorizations.yml" in config directory
  2. Fill it with paths (keys) and IPs (values) see example below
admin:
    - 192.168.0.1
    - 192.168.0.2
    - 192.168.0.3
monitor:
    - 192.168.0.1
    - 192.168.0.2
  1. According to this example, path to http://www.my-application.com/admin and http://www.my-application.com/monitor have access restricted by IP

Contributing

  1. Fork it
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create new Pull Request