json-jwt 1.16.5 → 1.16.7
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/jwt.rb +8 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff9257afeb38d25d140c0c79a61a2cab02988de75c22fc28287d2e5ffb31e56c
|
4
|
+
data.tar.gz: 991d63f84efdd78c07285f1af5b7e9e4eb4d676c4183da5c838a036789598a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7768f064e72788a1dfd20e79790bd8d8ca73b8909fd48425a57e1aead11df1c93bf71d91bb72060fedb08bc6e082a77785fe7aa55138bbefc5ec8b003c36b81f
|
7
|
+
data.tar.gz: ea64d0752787f2ea267c7afe3917af9a81899263c6328617cc6233a80ab15b8e36759990e7cd0583f1ffb8e7b2f66629dfa8498e849ebcd4314c3f299049b4d7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.16.
|
1
|
+
1.16.7
|
data/lib/json/jwt.rb
CHANGED
@@ -26,12 +26,12 @@ module JSON
|
|
26
26
|
@content_type = 'application/jwt'
|
27
27
|
self.typ = :JWT
|
28
28
|
self.alg = :none
|
29
|
+
update claims
|
29
30
|
unless claims.nil?
|
30
31
|
[:exp, :nbf, :iat].each do |key|
|
31
|
-
|
32
|
+
self[key] = self[key].to_i if self[key]
|
32
33
|
end
|
33
34
|
end
|
34
|
-
update claims
|
35
35
|
end
|
36
36
|
|
37
37
|
def sign(private_key_or_secret, algorithm = :autodetect)
|
@@ -109,7 +109,11 @@ module JSON
|
|
109
109
|
when JWS::NUM_OF_SEGMENTS
|
110
110
|
JWS.decode_compact_serialized jwt_string, key_or_secret, algorithms, allow_blank_payload
|
111
111
|
when JWE::NUM_OF_SEGMENTS
|
112
|
-
|
112
|
+
if allow_blank_payload
|
113
|
+
raise InvalidFormat.new("JWE w/ blank payload is not supported.")
|
114
|
+
else
|
115
|
+
JWE.decode_compact_serialized jwt_string, key_or_secret, algorithms, encryption_methods
|
116
|
+
end
|
113
117
|
else
|
114
118
|
raise InvalidFormat.new("Invalid JWT Format. JWT should include #{JWS::NUM_OF_SEGMENTS} or #{JWE::NUM_OF_SEGMENTS} segments.")
|
115
119
|
end
|
@@ -138,4 +142,4 @@ require 'json/jwe'
|
|
138
142
|
require 'json/jwk'
|
139
143
|
require 'json/jwk/jwkizable'
|
140
144
|
require 'json/jwk/set'
|
141
|
-
require 'json/jwk/set/fetcher'
|
145
|
+
require 'json/jwk/set/fetcher'
|
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.16.
|
4
|
+
version: 1.16.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
|
-
rubygems_version: 3.
|
214
|
+
rubygems_version: 3.5.16
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and
|