json-jwt 0.7.1 → 0.8.0
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.
Potentially problematic release.
This version of json-jwt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/json/jwt.rb +6 -2
- data/spec/json/jwt_spec.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c915d6a8de83f170d97ca50cb41ce59daf27109
|
4
|
+
data.tar.gz: e07327aad3ed0772746939176c4941011cf53301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e45a3641dacb886fc1b4984f9fe53d5b0189e66225bb05957ab60cc932075bf94e651d96387fdad26dec8fa4f99d7ed5c085706625f14d5043c5e9f1862a2e8
|
7
|
+
data.tar.gz: f49791f3062639f6cbd0bf09e24d4720566c012f4a81c122903d8b4432735d2efe83d647693acfe6ceb797a515696d7a60220b3fcd46f3081791ccf5c177f17d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.8.0
|
data/lib/json/jwt.rb
CHANGED
@@ -102,8 +102,12 @@ module JSON
|
|
102
102
|
jwe.header = MultiJson.load(
|
103
103
|
UrlSafeBase64.decode64 jwt_string.split('.').first
|
104
104
|
).with_indifferent_access
|
105
|
-
|
106
|
-
|
105
|
+
if key_or_secret == :skip_decryption
|
106
|
+
jwe
|
107
|
+
else
|
108
|
+
jwe.decrypt! key_or_secret
|
109
|
+
JSON::JWT.decode jwe.plain_text, :skip_verification
|
110
|
+
end
|
107
111
|
else
|
108
112
|
raise InvalidFormat.new("Invalid JWT Format. JWT should include #{JWS::NUM_OF_SEGMENTS} or #{JWE::NUM_OF_SEGMENTS} segments.")
|
109
113
|
end
|
data/spec/json/jwt_spec.rb
CHANGED
@@ -160,13 +160,14 @@ describe JSON::JWT do
|
|
160
160
|
let(:shared_key) { SecureRandom.hex 16 } # default shared key is too short
|
161
161
|
|
162
162
|
it 'should decryptable' do
|
163
|
-
JSON::JWT.decode(input, private_key).should
|
163
|
+
JSON::JWT.decode(input, private_key).should be_instance_of JSON::JWT
|
164
164
|
end
|
165
165
|
|
166
166
|
context 'when :skip_decryption given as secret/key' do
|
167
167
|
it 'should skip verification' do
|
168
168
|
expect do
|
169
169
|
jwe = JSON::JWT.decode input, :skip_decryption
|
170
|
+
jwe.should be_instance_of JSON::JWE
|
170
171
|
jwe.header.should == {'alg' => 'RSA1_5', 'enc' => 'A128CBC-HS256'}
|
171
172
|
end.not_to raise_error
|
172
173
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
requirements: []
|
199
199
|
rubyforge_project:
|
200
|
-
rubygems_version: 2.
|
200
|
+
rubygems_version: 2.4.5
|
201
201
|
signing_key:
|
202
202
|
specification_version: 4
|
203
203
|
summary: JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and
|