json-jwt 1.7.2 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
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/json-jwt.gemspec +0 -1
- data/lib/json/jose.rb +1 -1
- data/lib/json/jwe.rb +4 -11
- data/lib/json/jws.rb +1 -1
- data/lib/json/jwt.rb +0 -1
- data/spec/spec_helper.rb +3 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b7a5b50715a737924990c594c6c250ec31f59d
|
4
|
+
data.tar.gz: 64dd632640ef8abe3c445c016fe5771e722d7bdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703cb245eba43a33a0c7127d3692edb293ce08d174da433e8e4f03c6d3419ebefc9f8367f231231129fd6f8bc07db0c4c3a884f2dfc92eb9e430d339c4b90411
|
7
|
+
data.tar.gz: 49e2fe3619e3d0e539fa42ac515643a710ec7f6011dc25051acc5b7c4d90f8ebefdc3d5ddfae731bb62a0c0f223cde260e447e1a486855f88d7c2dabaff757a4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.8.0
|
data/json-jwt.gemspec
CHANGED
@@ -11,7 +11,6 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
12
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
13
13
|
gem.require_paths = ["lib"]
|
14
|
-
gem.add_runtime_dependency "multi_json", ">= 1.3"
|
15
14
|
gem.add_runtime_dependency "url_safe_base64"
|
16
15
|
gem.add_runtime_dependency "activesupport"
|
17
16
|
gem.add_runtime_dependency "bindata"
|
data/lib/json/jose.rb
CHANGED
data/lib/json/jwe.rb
CHANGED
@@ -92,10 +92,6 @@ module JSON
|
|
92
92
|
|
93
93
|
# common
|
94
94
|
|
95
|
-
def gcm_supported?
|
96
|
-
RUBY_VERSION >= '2.0.0' && OpenSSL::OPENSSL_VERSION >= 'OpenSSL 1.0.1'
|
97
|
-
end
|
98
|
-
|
99
95
|
def gcm?
|
100
96
|
[:A128GCM, :A256GCM].include? encryption_method.try(:to_sym)
|
101
97
|
end
|
@@ -109,11 +105,8 @@ module JSON
|
|
109
105
|
end
|
110
106
|
|
111
107
|
def cipher
|
112
|
-
|
113
|
-
|
114
|
-
else
|
115
|
-
OpenSSL::Cipher.new cipher_name
|
116
|
-
end
|
108
|
+
raise "#{cipher_name} isn't supported" unless OpenSSL::Cipher.ciphers.include?(cipher_name)
|
109
|
+
@cipher ||= OpenSSL::Cipher.new cipher_name
|
117
110
|
end
|
118
111
|
|
119
112
|
def cipher_name
|
@@ -263,7 +256,7 @@ module JSON
|
|
263
256
|
UrlSafeBase64.decode64 segment
|
264
257
|
end
|
265
258
|
jwe.auth_data = input.split('.').first
|
266
|
-
jwe.header =
|
259
|
+
jwe.header = JSON.load(_header_json_).with_indifferent_access
|
267
260
|
jwe.decrypt! private_key_or_secret unless private_key_or_secret == :skip_decryption
|
268
261
|
jwe
|
269
262
|
end
|
@@ -286,4 +279,4 @@ module JSON
|
|
286
279
|
end
|
287
280
|
end
|
288
281
|
end
|
289
|
-
end
|
282
|
+
end
|
data/lib/json/jws.rb
CHANGED
@@ -140,7 +140,7 @@ module JSON
|
|
140
140
|
UrlSafeBase64.decode64 segment.to_s
|
141
141
|
end
|
142
142
|
header, claims = [header, claims].collect do |json|
|
143
|
-
|
143
|
+
JSON.load(json).with_indifferent_access
|
144
144
|
end
|
145
145
|
jws = new claims
|
146
146
|
jws.header = header
|
data/lib/json/jwt.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -15,7 +15,9 @@ RSpec.configure do |config|
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def gcm_supported?
|
18
|
-
|
18
|
+
['aes-128-gcm', 'aes-128-gcm'].all? do |alg|
|
19
|
+
OpenSSL::Cipher.ciphers.include? alg
|
20
|
+
end
|
19
21
|
end
|
20
22
|
|
21
23
|
require 'helpers/sign_key_fixture_helper'
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.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: 2017-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: multi_json
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.3'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.3'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: url_safe_base64
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|