rack-auth-simples 0.0.7 → 0.0.8
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/lib/rack/auth/simples/rules.rb +7 -0
- data/lib/rack-auth-simples/version.rb +1 -1
- metadata +2 -2
|
@@ -15,6 +15,7 @@ module Rack
|
|
|
15
15
|
@triggers = []
|
|
16
16
|
@exceptions = []
|
|
17
17
|
@codes = []
|
|
18
|
+
@fb = false
|
|
18
19
|
|
|
19
20
|
@opts = {
|
|
20
21
|
:secret => 'SET_VIA_CONFIG',
|
|
@@ -42,6 +43,10 @@ module Rack
|
|
|
42
43
|
@ips << '127.0.0.1'
|
|
43
44
|
end
|
|
44
45
|
|
|
46
|
+
def allow_facebook
|
|
47
|
+
@fb = true
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
def add_trigger_url url
|
|
46
51
|
@triggers << url
|
|
47
52
|
end
|
|
@@ -52,6 +57,8 @@ module Rack
|
|
|
52
57
|
|
|
53
58
|
def parse env, app
|
|
54
59
|
|
|
60
|
+
return app.call(env) if @fb && env['HTTP_USER_AGENT'] =~ /facebookexternalhit/
|
|
61
|
+
|
|
55
62
|
if @opts[:fail] == :forbidden
|
|
56
63
|
fail = [403, {'Content-Type' => 'text/plain' }, ['Forbidden'] ]
|
|
57
64
|
else
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-auth-simples
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-01-
|
|
12
|
+
date: 2013-01-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: ipaddr_list
|