openid_connect 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
@@ -13,7 +13,7 @@ module OpenIDConnect
|
|
13
13
|
_claims_ = {}
|
14
14
|
claims.each do |key, value|
|
15
15
|
_claims_[key] = case value.to_s
|
16
|
-
when 'optional'
|
16
|
+
when 'optional', 'voluntary'
|
17
17
|
{
|
18
18
|
:essential => false
|
19
19
|
}
|
@@ -39,12 +39,14 @@ module OpenIDConnect
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def required?(claim)
|
42
|
-
accessible?(claim) &&
|
42
|
+
accessible?(claim) && claims[claim].is_a?(Hash) && claims[claim][:essential]
|
43
43
|
end
|
44
|
+
alias_method :essential?, :required?
|
44
45
|
|
45
46
|
def optional?(claim)
|
46
|
-
accessible?(claim) &&
|
47
|
+
accessible?(claim) && !required?(claim)
|
47
48
|
end
|
49
|
+
alias_method :voluntary?, :optional?
|
48
50
|
|
49
51
|
def accessible?(claim)
|
50
52
|
claims.try(:include?, claim)
|
@@ -32,7 +32,7 @@ describe OpenIDConnect::RequestObject do
|
|
32
32
|
}
|
33
33
|
end
|
34
34
|
let(:jwtnized) do
|
35
|
-
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
|
35
|
+
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfaWQiOiJjbGllbnRfaWQiLCJyZXNwb25zZV90eXBlIjoidG9rZW4gaWRfdG9rZW4iLCJyZWRpcmVjdF91cmkiOiJodHRwczovL2NsaWVudC5leGFtcGxlLmNvbSIsInNjb3BlIjoib3BlbmlkIGVtYWlsIiwic3RhdGUiOiJzdGF0ZTEyMzQiLCJub25jZSI6Im5vbmNlMTIzNCIsImRpc3BsYXkiOiJ0b3VjaCIsInByb21wdCI6Im5vbmUiLCJpZF90b2tlbiI6eyJjbGFpbXMiOnsiYWNyIjp7InZhbHVlcyI6WyIyIiwiMyIsIjQiXX19LCJtYXhfYWdlIjoxMH0sInVzZXJpbmZvIjp7ImNsYWltcyI6eyJuYW1lIjp7ImVzc2VudGlhbCI6dHJ1ZX0sImVtYWlsIjp7ImVzc2VudGlhbCI6ZmFsc2V9fX19.MLTDQVPdhAdkJhboM06IRtjHJrvamJ_H2vFGRupXmTA'
|
36
36
|
end
|
37
37
|
let(:jsonized) do
|
38
38
|
{
|
@@ -54,9 +54,11 @@ describe OpenIDConnect::RequestObject do
|
|
54
54
|
},
|
55
55
|
:userinfo => {
|
56
56
|
:claims => {
|
57
|
-
:name =>
|
57
|
+
:name => {
|
58
|
+
:essential => true
|
59
|
+
},
|
58
60
|
:email => {
|
59
|
-
:
|
61
|
+
:essential => false
|
60
62
|
}
|
61
63
|
}
|
62
64
|
}
|
@@ -19,7 +19,7 @@ describe OpenIDConnect::ResponseObject::IdToken do
|
|
19
19
|
describe 'attributes' do
|
20
20
|
subject { klass }
|
21
21
|
its(:required_attributes) { should == [:iss, :user_id, :aud, :exp, :iat] }
|
22
|
-
its(:optional_attributes) { should == [:acr, :auth_time, :nonce, :at_hash] }
|
22
|
+
its(:optional_attributes) { should == [:acr, :auth_time, :nonce, :at_hash, :c_hash] }
|
23
23
|
end
|
24
24
|
|
25
25
|
describe '#verify!' do
|