rack-ip-authorizer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7276aa411d774580759f3c27e3eb32205106da5f
4
- data.tar.gz: 43e5ae7de9fb58a0ec906d7c46d7a963aebecad3
5
- SHA512:
6
- metadata.gz: 14a09ff33288eb8b63bf7cbfeb6c12054013dd0e74bb4c522ba7fc3ea090b808d2699b68408bdd980a9aab1de783b8d8eae5ae997eabaf9c6c097f935a4a77ba
7
- data.tar.gz: c2c1363f3afb39e18b023295e9d01fa73242a007e1f2501de8c49521b75dbdc0b384a51f89e17e5f84bf019f8f0364715ecf911322f46e6bff3747260fbac3c1
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzI0ZjdhZTI1NTFmYTM0ODNiNzU5ZTgwN2VlZDdlYzBmMDE2NzZmZg==
5
+ data.tar.gz: !binary |-
6
+ ZjlhNjE3MWE4ZGI2YjM5YTdjZTFkOTA2MDNmYjYwZjIwYzdjOTQ1Mw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ODllNWZhNWM4ZjgwYTM2MWZlZWY4NzdjMDY2ZTQwZGRjZDQwODk5ZTc5ODI1
10
+ OGUxNTA4ZTg1OTQzODZkMTRmZjhhYTFiNGIyM2RhN2FjNmVlNWYwYmJjZmU0
11
+ MWNkY2UzNTNlNzAwZjdhNDFiZTMwMDNjZDFhNDcxNGZmMjY3MTA=
12
+ data.tar.gz: !binary |-
13
+ NjM4YjFkYjllODE1Y2M4ZDhkNWU1YzA3ZmQ1Y2NmN2UwMGI1ODM0NTJhNjE5
14
+ M2JkYzYzOWM5NGY2ODM1MjQ0MGUyMmExOTJkMmU3MTQxN2Y2OGVjZGVlNDIw
15
+ Y2MzMmJjNTgxODgwZjdiYTg3YmMwMTRlYTQyMWEzOGEzYWQxOGQ=
data/README.md CHANGED
@@ -20,28 +20,23 @@ Or install it yourself as:
20
20
 
21
21
  ### Rails 3 apps
22
22
 
23
- 1. Create a file named "ip_authorizations.yml" in config directory
24
- 2. Fill it with paths (keys) and IPs (values) see example below
23
+ 1. Create an initializer defining the environment you want to watch (production by default), example:
24
+ ```ruby
25
+ Rack::IpAuthorizer.env_to_check = ['staging','development']
26
+ ```
27
+ 2. Create a file named "ip_authorizations.yml" in config directory
28
+ 3. Fill it with paths (keys) and IPs (values) see example below
25
29
 
26
30
  ```yaml
27
31
  admin:
28
32
  - 192.168.0.1
29
33
  - 192.168.0.2
30
34
  - 192.168.0.3
31
- superadmin:
35
+ monitor:
32
36
  - 192.168.0.1
33
37
  - 192.168.0.2
34
38
  ```
35
-
36
- ### Environment filter
37
-
38
- Create an initializer and add:
39
-
40
- ```ruby
41
- Rack::IpAuthorizer.env_to_check = ['staging','development']
42
- ```
43
-
44
- Based on the file names in 'config/environments' you can use any of them including Rails defaults.
39
+ 4. According to this example, path to http://www.my-application.com/admin and http://www.my-application.com/monitor have access restricted by IP
45
40
 
46
41
  ## Contributing
47
42
 
@@ -1,8 +1,8 @@
1
- require "rack/version"
1
+ require 'rack/version'
2
2
 
3
3
  module Rack
4
4
  class IpAuthorizer
5
- @env_to_check = ["production"]
5
+ @env_to_check = ['production']
6
6
  class << self
7
7
  attr_accessor :env_to_check
8
8
  end
data/lib/rack/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RackIpAuthorizer
2
- VERSION = "0.0.3"
2
+ VERSION = '0.0.4'
3
3
  end
@@ -10,7 +10,7 @@ if defined? Rails
10
10
  if File.exists?(path)
11
11
  ip_authorizations_by_path = YAML.load_file(path)
12
12
  else
13
- raise "config/ip_authorizations.yml is missing"
13
+ raise 'config/ip_authorizations.yml is missing'
14
14
  end
15
15
  app.config.middleware.insert_after(ActionDispatch::RemoteIp, Rack::IpAuthorizer, ip_authorizations_by_path)
16
16
  }
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ip-authorizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault El Zamek, Cédric Darné, Lionel Oto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-26 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.6.2
69
- description: Basic Rack middleware for Rails 3 to authorize access to path by IP
69
+ description: Basic Rack middleware for Rails 3 to authorize access to path by IP using
70
+ YML config file
70
71
  email:
71
72
  - thibault.elzamek@c4mprod.com, cedric.darne@c4mprod.com, lionel.oto@c4mprod.com
72
73
  executables: []
@@ -75,8 +76,8 @@ extra_rdoc_files: []
75
76
  files:
76
77
  - LICENSE.txt
77
78
  - README.md
78
- - lib/rack/version.rb
79
79
  - lib/rack/ip_authorizer.rb
80
+ - lib/rack/version.rb
80
81
  - lib/rack-ip-authorizer.rb
81
82
  - spec/rake_ip_authorizer_spec.rb
82
83
  homepage: https://github.com/c4mprod/rack-ip-authorizer
@@ -89,20 +90,19 @@ require_paths:
89
90
  - lib
90
91
  required_ruby_version: !ruby/object:Gem::Requirement
91
92
  requirements:
92
- - - '>='
93
+ - - ! '>='
93
94
  - !ruby/object:Gem::Version
94
95
  version: '0'
95
96
  required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  requirements:
97
- - - '>='
98
+ - - ! '>='
98
99
  - !ruby/object:Gem::Version
99
100
  version: '0'
100
101
  requirements: []
101
102
  rubyforge_project:
102
- rubygems_version: 2.1.11
103
+ rubygems_version: 2.0.8
103
104
  signing_key:
104
105
  specification_version: 4
105
- summary: Basic Rack middleware for Rails 3 to authorize access to path by IP using
106
- YML config file
106
+ summary: Basic Rack middleware for Rails 3 to authorize access to path by IP
107
107
  test_files:
108
108
  - spec/rake_ip_authorizer_spec.rb