Rack::Ip::Authorizer
Basic Rack middleware for checking Rails3 request remote 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-
Usage
Rails 3 apps
- Create a file named "ip_authorizations.yml" in the config directory
- Fill it with key as path and values as IPs:
admin:
- 192.168.0.1
- 192.168.0.2
- 192.168.0.3
superadmin:
- 192.168.0.1
- 192.168.0.2
Environment filter
Create an initializer and fill it with:
Rack::IpAuthorizer.env_to_check = ['staging','development']
Contributing
- Fork it
- Create your feature branch
- Commit your changes
- Push to the branch
- Create new Pull Request