json-jwt 1.10.2 → 1.11.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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/json/jwe.rb +1 -1
- data/lib/json/jws.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87ba6f4c95c228a09cc0867fad5dd1caba1a106a8c74624b8a962aeead5eacb4
|
|
4
|
+
data.tar.gz: 7de48d6108afac993872d87fa5444668cc88903a5c621d3b3d95dfe27168523c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7f8d35bedbc9e09e284aeebcff276c6c4380cd037cb7ec44d08cdcd3d592c1fae0ef541e837ecdb13593d1719af5879910f674eda5a659249f8eab2720d0e75
|
|
7
|
+
data.tar.gz: ae640c9d0326593ec91cef8ff7eba66a44eeacb69f53058f1eebe8625a9359a921dae601cdaa0651438e10ab8237635cb2bfbeee9b6651200ce375b4c6d34213
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.11.0
|
data/lib/json/jwe.rb
CHANGED
|
@@ -254,7 +254,7 @@ module JSON
|
|
|
254
254
|
raise InvalidFormat.new("Invalid JWE Format. JWE should include #{NUM_OF_SEGMENTS} segments.")
|
|
255
255
|
end
|
|
256
256
|
jwe = new
|
|
257
|
-
_header_json_, jwe.jwe_encrypted_key, jwe.iv, jwe.cipher_text, jwe.authentication_tag = input.split('.').collect do |segment|
|
|
257
|
+
_header_json_, jwe.jwe_encrypted_key, jwe.iv, jwe.cipher_text, jwe.authentication_tag = input.split('.', NUM_OF_SEGMENTS).collect do |segment|
|
|
258
258
|
begin
|
|
259
259
|
Base64.urlsafe_decode64 segment
|
|
260
260
|
rescue ArgumentError
|
data/lib/json/jws.rb
CHANGED
|
@@ -179,7 +179,7 @@ module JSON
|
|
|
179
179
|
unless input.count('.') + 1 == NUM_OF_SEGMENTS
|
|
180
180
|
raise InvalidFormat.new("Invalid JWS Format. JWS should include #{NUM_OF_SEGMENTS} segments.")
|
|
181
181
|
end
|
|
182
|
-
header, claims, signature = input.split('.',
|
|
182
|
+
header, claims, signature = input.split('.', NUM_OF_SEGMENTS).collect do |segment|
|
|
183
183
|
Base64.urlsafe_decode64 segment.to_s
|
|
184
184
|
end
|
|
185
185
|
header = JSON.parse(header).with_indifferent_access
|
|
@@ -191,7 +191,7 @@ module JSON
|
|
|
191
191
|
jws = new claims
|
|
192
192
|
jws.header = header
|
|
193
193
|
jws.signature = signature
|
|
194
|
-
jws.signature_base_string = input.split('.')[0,
|
|
194
|
+
jws.signature_base_string = input.split('.')[0, NUM_OF_SEGMENTS - 1].join('.')
|
|
195
195
|
jws.verify! public_key_or_secret, algorithms unless public_key_or_secret == :skip_verification
|
|
196
196
|
jws
|
|
197
197
|
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: 1.
|
|
4
|
+
version: 1.11.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: 2019-
|
|
11
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|