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 +6 -1
- data/lib/hash-auth/controllers/helpers.rb +2 -0
- data/lib/hash-auth/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +1 -1
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
|
-
|
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
|
data/lib/hash-auth/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED