openid_connect 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/openid_connect.rb +20 -10
- data/spec/openid_connect_spec.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96fafd3eb7736041bdf5095494885111a934d6ee
|
4
|
+
data.tar.gz: 6dbcf5e2c2bc38151707b5aae05260ebaa3e7324
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32676583d740a314dc97c5c0e7311b83584e26df6aad0f6f037ba2fa7cd53d39f7a3f0d9d0c745fdeb0a8d53589d672e2dffe6ddc353cccabf3a3d43561583f3
|
7
|
+
data.tar.gz: 65b85979a7d62275d5dfe727b1e821132e94115a3b589cf9d76d917459e2b9515ca7e447a77b5f3644c57b69ce55771d9a0c8820907299fd30071476d30e4879
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/lib/openid_connect.rb
CHANGED
@@ -27,28 +27,37 @@ module OpenIDConnect
|
|
27
27
|
self.logger = Logger.new(STDOUT)
|
28
28
|
self.logger.progname = 'OpenIDConnect'
|
29
29
|
|
30
|
+
@sub_protocols = [
|
31
|
+
SWD,
|
32
|
+
WebFinger,
|
33
|
+
Rack::OAuth2
|
34
|
+
]
|
30
35
|
def self.debugging?
|
31
36
|
@@debugging
|
32
37
|
end
|
33
38
|
def self.debugging=(boolean)
|
34
|
-
|
35
|
-
|
39
|
+
@sub_protocols.each do |klass|
|
40
|
+
klass.debugging = boolean
|
41
|
+
end
|
36
42
|
@@debugging = boolean
|
37
43
|
end
|
38
44
|
def self.debug!
|
39
|
-
|
40
|
-
|
45
|
+
@sub_protocols.each do |klass|
|
46
|
+
klass.debug!
|
47
|
+
end
|
41
48
|
self.debugging = true
|
42
49
|
end
|
43
50
|
def self.debug(&block)
|
44
|
-
|
45
|
-
|
51
|
+
sub_protocol_originals = @sub_protocols.inject({}) do |sub_protocol_originals, klass|
|
52
|
+
sub_protocol_originals.merge!(klass => klass.debugging?)
|
53
|
+
end
|
46
54
|
original = self.debugging?
|
47
55
|
debug!
|
48
56
|
yield
|
49
57
|
ensure
|
50
|
-
|
51
|
-
|
58
|
+
@sub_protocols.each do |klass|
|
59
|
+
klass.debugging = sub_protocol_originals[klass]
|
60
|
+
end
|
52
61
|
self.debugging = original
|
53
62
|
end
|
54
63
|
self.debugging = false
|
@@ -62,8 +71,9 @@ module OpenIDConnect
|
|
62
71
|
_http_client_
|
63
72
|
end
|
64
73
|
def self.http_config(&block)
|
65
|
-
|
66
|
-
|
74
|
+
@sub_protocols.each do |klass|
|
75
|
+
klass.http_config &block unless klass.http_config
|
76
|
+
end
|
67
77
|
@@http_config ||= block
|
68
78
|
end
|
69
79
|
end
|
data/spec/openid_connect_spec.rb
CHANGED
@@ -15,6 +15,7 @@ describe OpenIDConnect do
|
|
15
15
|
it 'should enable debugging within given block' do
|
16
16
|
OpenIDConnect.debug do
|
17
17
|
SWD.debugging?.should be_true
|
18
|
+
WebFinger.debugging?.should be_true
|
18
19
|
Rack::OAuth2.debugging?.should be_true
|
19
20
|
OpenIDConnect.debugging?.should be_true
|
20
21
|
end
|
@@ -25,14 +26,17 @@ describe OpenIDConnect do
|
|
25
26
|
|
26
27
|
it 'should not force disable debugging' do
|
27
28
|
SWD.debug!
|
29
|
+
WebFinger.debug!
|
28
30
|
Rack::OAuth2.debug!
|
29
31
|
OpenIDConnect.debug!
|
30
32
|
OpenIDConnect.debug do
|
31
33
|
SWD.debugging?.should be_true
|
34
|
+
WebFinger.debugging?.should be_true
|
32
35
|
Rack::OAuth2.debugging?.should be_true
|
33
36
|
OpenIDConnect.debugging?.should be_true
|
34
37
|
end
|
35
38
|
SWD.debugging?.should be_true
|
39
|
+
WebFinger.debugging?.should be_true
|
36
40
|
Rack::OAuth2.debugging?.should be_true
|
37
41
|
OpenIDConnect.debugging?.should be_true
|
38
42
|
end
|
@@ -46,7 +50,7 @@ describe OpenIDConnect do
|
|
46
50
|
end
|
47
51
|
end
|
48
52
|
it 'should configure OpenIDConnect, SWD and Rack::OAuth2\'s http_client' do
|
49
|
-
[OpenIDConnect, SWD, Rack::OAuth2].each do |klass|
|
53
|
+
[OpenIDConnect, SWD, WebFinger, Rack::OAuth2].each do |klass|
|
50
54
|
klass.http_client.ssl_config.verify_mode.should == OpenSSL::SSL::VERIFY_NONE
|
51
55
|
end
|
52
56
|
end
|