openid_connect 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +18 -19
- data/VERSION +1 -1
- data/lib/openid_connect/response_object/id_token.rb +3 -3
- data/lib/openid_connect/response_object/user_info/open_id.rb +7 -7
- data/spec/mock_response/public_keys/jwk.json +2 -2
- data/spec/mock_response/user_info/openid.json +1 -1
- data/spec/openid_connect/response_object/id_token_spec.rb +2 -2
- data/spec/openid_connect/response_object/user_info/open_id_spec.rb +6 -6
- metadata +7 -1
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openid_connect (0.
|
4
|
+
openid_connect (0.4.1)
|
5
5
|
activemodel (>= 3)
|
6
6
|
attr_required (>= 0.0.5)
|
7
7
|
json (>= 1.4.3)
|
@@ -15,10 +15,10 @@ PATH
|
|
15
15
|
GEM
|
16
16
|
remote: http://rubygems.org/
|
17
17
|
specs:
|
18
|
-
activemodel (3.2.
|
19
|
-
activesupport (= 3.2.
|
18
|
+
activemodel (3.2.9)
|
19
|
+
activesupport (= 3.2.9)
|
20
20
|
builder (~> 3.0.0)
|
21
|
-
activesupport (3.2.
|
21
|
+
activesupport (3.2.9)
|
22
22
|
i18n (~> 0.6)
|
23
23
|
multi_json (~> 1.0)
|
24
24
|
addressable (2.3.2)
|
@@ -35,18 +35,17 @@ GEM
|
|
35
35
|
httpclient (2.3.0.1)
|
36
36
|
i18n (0.6.1)
|
37
37
|
json (1.7.5)
|
38
|
-
json (
|
39
|
-
json-jwt (0.3.3)
|
38
|
+
json-jwt (0.4.0)
|
40
39
|
activesupport (>= 2.3)
|
41
40
|
i18n
|
42
41
|
json (>= 1.4.3)
|
43
42
|
url_safe_base64
|
44
|
-
mail (2.
|
43
|
+
mail (2.5.3)
|
45
44
|
i18n (>= 0.4.0)
|
46
45
|
mime-types (~> 1.16)
|
47
46
|
treetop (~> 1.4.8)
|
48
47
|
mime-types (1.19)
|
49
|
-
multi_json (1.
|
48
|
+
multi_json (1.5.0)
|
50
49
|
polyglot (0.3.3)
|
51
50
|
rack (1.4.1)
|
52
51
|
rack-oauth2 (1.0.0)
|
@@ -56,32 +55,32 @@ GEM
|
|
56
55
|
i18n
|
57
56
|
multi_json (>= 1.3.6)
|
58
57
|
rack (>= 1.1)
|
59
|
-
rake (0.
|
60
|
-
rspec (2.
|
61
|
-
rspec-core (~> 2.
|
62
|
-
rspec-expectations (~> 2.
|
63
|
-
rspec-mocks (~> 2.
|
64
|
-
rspec-core (2.
|
65
|
-
rspec-expectations (2.
|
58
|
+
rake (10.0.2)
|
59
|
+
rspec (2.12.0)
|
60
|
+
rspec-core (~> 2.12.0)
|
61
|
+
rspec-expectations (~> 2.12.0)
|
62
|
+
rspec-mocks (~> 2.12.0)
|
63
|
+
rspec-core (2.12.1)
|
64
|
+
rspec-expectations (2.12.0)
|
66
65
|
diff-lcs (~> 1.1.3)
|
67
|
-
rspec-mocks (2.
|
66
|
+
rspec-mocks (2.12.0)
|
68
67
|
swd (0.2.1)
|
69
68
|
activesupport (>= 3)
|
70
69
|
attr_required (>= 0.0.5)
|
71
70
|
httpclient (>= 2.2.1)
|
72
71
|
i18n
|
73
72
|
json (>= 1.4.3)
|
74
|
-
treetop (1.4.
|
73
|
+
treetop (1.4.12)
|
75
74
|
polyglot
|
76
75
|
polyglot (>= 0.3.1)
|
77
|
-
tzinfo (0.3.
|
76
|
+
tzinfo (0.3.35)
|
78
77
|
url_safe_base64 (0.2.1)
|
79
78
|
validate_email (0.1.6)
|
80
79
|
activemodel (>= 3.0)
|
81
80
|
mail (>= 2.2.5)
|
82
81
|
validate_url (0.2.0)
|
83
82
|
activemodel (>= 3.0.0)
|
84
|
-
webmock (1.
|
83
|
+
webmock (1.9.0)
|
85
84
|
addressable (>= 2.2.7)
|
86
85
|
crack (>= 0.1.7)
|
87
86
|
yamler (0.1.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
@@ -72,8 +72,8 @@ module OpenIDConnect
|
|
72
72
|
def self_issued(attributes = {})
|
73
73
|
attributes[:user_jwk] ||= JSON::JWK.new attributes.delete(:public_key)
|
74
74
|
_attributes_ = {
|
75
|
-
iss:
|
76
|
-
user_id:
|
75
|
+
iss: 'https://self-issued.me',
|
76
|
+
user_id: self_issued_user_id(attributes[:user_jwk])
|
77
77
|
}.merge(attributes)
|
78
78
|
new _attributes_
|
79
79
|
end
|
@@ -81,7 +81,7 @@ module OpenIDConnect
|
|
81
81
|
def self_issued_user_id(jwk)
|
82
82
|
user_id_base_string = case jwk[:alg].to_s
|
83
83
|
when 'RSA'
|
84
|
-
[jwk[:
|
84
|
+
[jwk[:n], jwk[:e]].join
|
85
85
|
when 'EC'
|
86
86
|
raise NotImplementedError.new('Not Implemented Yet')
|
87
87
|
else
|
@@ -5,23 +5,23 @@ module OpenIDConnect
|
|
5
5
|
attr_optional(
|
6
6
|
:user_id,
|
7
7
|
:name,
|
8
|
-
:family_name,
|
9
8
|
:given_name,
|
9
|
+
:family_name,
|
10
10
|
:middle_name,
|
11
11
|
:nickname,
|
12
12
|
:preferred_username,
|
13
13
|
:profile,
|
14
14
|
:picture,
|
15
15
|
:website,
|
16
|
+
:email,
|
17
|
+
:email_verified,
|
16
18
|
:gender,
|
17
|
-
:
|
19
|
+
:birthdate,
|
18
20
|
:zoneinfo,
|
19
21
|
:locale,
|
20
|
-
:
|
21
|
-
:email,
|
22
|
-
:email_verified,
|
22
|
+
:phone_number,
|
23
23
|
:address,
|
24
|
-
:
|
24
|
+
:updated_time
|
25
25
|
)
|
26
26
|
|
27
27
|
validates :email_verified, inclusion: {in: [true, false]}, allow_nil: true
|
@@ -57,6 +57,6 @@ module OpenIDConnect
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
Dir[File.dirname(__FILE__) + '/open_id/*.rb'].each do |file|
|
60
|
+
Dir[File.dirname(__FILE__) + '/open_id/*.rb'].each do |file|
|
61
61
|
require file
|
62
62
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"keys": [{
|
3
3
|
"alg": "RSA",
|
4
|
-
"
|
5
|
-
"
|
4
|
+
"e": "AQAB",
|
5
|
+
"n": "u4liYNFzgsRr1ERdUY7CY6r4nefi3RzIhK5fdPgdZSMEEflACWAuJu21_TcDpbZ1-6Kbq7zShFsVTAnBkWdO7EP1Rsn11fZpi9m_zEq_uRY-4RpNwp3S9xSdoQ4F3-js1EMaDQ6km0-c0gvr_TyhFqDj_6w_Bb0vFptfGXwfKewPPnhsi7GJ62ihZ32PzxOvEIYcaoXr9xaeudYD3BzWSDmjKGA7PMaEuBhScdUAoibCmsKB-yAGsz2amHnUhcl4B_EBs6wk65Y7ge0ZQJUOGPdUQL49VuALKmr7cMhHKh5KuQmPAi_20K2uZL_EFDaObDWZrclx98s0DmfTRKINtw"
|
6
6
|
}]
|
7
7
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"picture": "http://example.com/johndoe/me.jpg",
|
12
12
|
"website": "http://john.doe.blogs.example.net/",
|
13
13
|
"gender": "male",
|
14
|
-
"
|
14
|
+
"birthdate": "05/02/0000",
|
15
15
|
"zoneinfo": "America/Los_Angeles",
|
16
16
|
"locale": "en_US",
|
17
17
|
"phone_number": "+1 (425) 555-1212",
|
@@ -225,7 +225,7 @@ describe OpenIDConnect::ResponseObject::IdToken do
|
|
225
225
|
context 'when self-issued' do
|
226
226
|
context 'when valid' do
|
227
227
|
let(:self_issued) do
|
228
|
-
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.
|
228
|
+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NlbGYtaXNzdWVkLm1lIiwidXNlcl9pZCI6ImY2UW1VLVFEbEtmanlwMHd3UmNnRms3QUhIYVMyZnFud2lIMlRCdDl5WDgiLCJhdWQiOiJiYWZkOGI3ODdhMDQyOWRiZDBiNmY5ZTE4Mzk3OThjNDFkNGQxOTJhYWYzMTFhZGY0MGRhMmM0ZDQxNGU1OGZkIiwiZXhwIjoxMzUwMzI1OTg3LCJpYXQiOjEzNTAzMjIzODcsInVzZXJfandrIjp7ImFsZyI6IlJTQSIsImUiOiJBUUFCIiwibiI6Im9iSGdFR01ITU9JVU1OZmkxMFY1RXhCai10d3ljY0txV0hhb2tvaUs4TGRGazdTNnpLYndjUUUtaGRXc0NvT0xfZVhaU2VZRHp1UjhGbG1NcVYxdzB5LUlkdERaRmFBcHgxLTJhWWVnRGJwQmxRc29UWURvU09xVmpfeFRPNTlQX2s0bHk0WHk4bUp0UUktX1dlR3lLZXV2SXItQzVUV1RnYnBobkZaVjA4a29KOHE1WHZRRjJpdndoZ1cweXRvYi1fdzNtWkFOb1FDUGxhSWV3WUFXSGdMdFZ6OElweVVhTWlDWU5kVkZoQjlzMjdRLU1CVGw3OHMtcm01VjhJZXZWZE1jcFVGTDhNSktGaC0ydklhcHljZjhCVmtGUmUzYW42eV9BY2c3eEQ4RFFSc3N3SHRlMkFiT3FENkZrLTJMM255SUdyOVJUM0tKY3ByaFlwYkJndyJ9fQ.H4lZwnV4nY3eWPTSi3anelcQPvAs7zzwChYuHWnKGUSalLO53vQ9XNV8klrEAq8UQntNMtIly-DeCVBU6Hcg3W_ZBuB2EXn1X4Lc6vRRCPeHBFwt085m6zanQsvuiTllUJssUjTnFJvBO9juopMJvisJX7cxDfHpZQF52bWYXuDp5UEFs-8TXQuDpn02BaOnzW32vaf1Vx871EdlGj-NrOpzwWaqnDM0p0o6j8tQPl76WJIB8LIGWxA7sNMnt8YCykzZXofK17veogrFd4tsLYbzFp80oqz0vsCsw4Q3WgLBRgOfoCGB8wfFt7Wdu6clotDIviPqmfPPx1gls2_JJw'
|
229
229
|
end
|
230
230
|
|
231
231
|
context 'when key == :self_issued' do
|
@@ -297,7 +297,7 @@ describe OpenIDConnect::ResponseObject::IdToken do
|
|
297
297
|
it do
|
298
298
|
user_id = klass.self_issued_user_id jwk
|
299
299
|
user_id.should == UrlSafeBase64.encode64(
|
300
|
-
OpenSSL::Digest::SHA256.digest([jwk[:
|
300
|
+
OpenSSL::Digest::SHA256.digest([jwk[:n], jwk[:e]].join)
|
301
301
|
)
|
302
302
|
end
|
303
303
|
end
|
@@ -12,23 +12,23 @@ describe OpenIDConnect::ResponseObject::UserInfo::OpenID do
|
|
12
12
|
should == [
|
13
13
|
:user_id,
|
14
14
|
:name,
|
15
|
-
:family_name,
|
16
15
|
:given_name,
|
16
|
+
:family_name,
|
17
17
|
:middle_name,
|
18
18
|
:nickname,
|
19
19
|
:preferred_username,
|
20
20
|
:profile,
|
21
21
|
:picture,
|
22
22
|
:website,
|
23
|
+
:email,
|
24
|
+
:email_verified,
|
23
25
|
:gender,
|
24
|
-
:
|
26
|
+
:birthdate,
|
25
27
|
:zoneinfo,
|
26
28
|
:locale,
|
27
|
-
:
|
28
|
-
:email,
|
29
|
-
:email_verified,
|
29
|
+
:phone_number,
|
30
30
|
:address,
|
31
|
-
:
|
31
|
+
:updated_time
|
32
32
|
]
|
33
33
|
end
|
34
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openid_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -328,12 +328,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
328
328
|
- - ! '>='
|
329
329
|
- !ruby/object:Gem::Version
|
330
330
|
version: '0'
|
331
|
+
segments:
|
332
|
+
- 0
|
333
|
+
hash: -3886993201268064457
|
331
334
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
332
335
|
none: false
|
333
336
|
requirements:
|
334
337
|
- - ! '>='
|
335
338
|
- !ruby/object:Gem::Version
|
336
339
|
version: '0'
|
340
|
+
segments:
|
341
|
+
- 0
|
342
|
+
hash: -3886993201268064457
|
337
343
|
requirements: []
|
338
344
|
rubyforge_project:
|
339
345
|
rubygems_version: 1.8.24
|