hash-auth 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -136,6 +136,7 @@ hash-auth initializer:
136
136
 
137
137
  **_Options in hash-auth initializer_**
138
138
 
139
+ * IP Filtering *
139
140
  Enable ip or reverse dns filtering
140
141
 
141
142
  ```ruby
@@ -150,7 +151,9 @@ Enable ip or reverse dns filtering
150
151
  end
151
152
  ```
152
153
 
153
- Reverse DNS filtering caches the result. You have the option to namespace how that data gets stored. Note: client.
154
+ Note: if a client has no valid_ips or valid_domains associated with it, then no filtering will occur.
155
+
156
+ Reverse DNS filtering caches the result. You have the option to namespace how that data gets stored.
154
157
 
155
158
  ```ruby
156
159
  HashAuth.configure do
@@ -163,6 +166,8 @@ Reverse DNS filtering caches the result. You have the option to namespace how th
163
166
  # Defaults to "hash-auth"
164
167
  ```
165
168
 
169
+ * Custom & Default Values*
170
+
166
171
  Any custom client field can be initialized with a default value through method missing (set_default_*)
167
172
 
168
173
  HashAuth.configure do
@@ -53,11 +53,13 @@ module HashAuth
53
53
  end
54
54
 
55
55
  def check_ip(ip)
56
+ return true if @client.valid_ips.length == 0
56
57
  @client.valid_ips.each { |valid_ip| return true if ip == valid_ip }
57
58
  false
58
59
  end
59
60
 
60
61
  def check_host(host)
62
+ return true if @client.valid_domains.length == 0
61
63
  @client.valid_domains.each do |d|
62
64
  match = regexp_from_host(d).match(host)
63
65
  return true if match != nil
@@ -1,3 +1,3 @@
1
1
  module HashAuth
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,4 +1,4 @@
1
- require 'rails/all'
1
+ require 'rails'
2
2
  require 'active_support/all'
3
3
  require 'action_controller/railtie'
4
4
  require 'hash-auth'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: