json-jwt 1.15.1 → 1.15.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57ea07157a9156dcf76d2b9f3841fee290e138f13951f278ea960e0fe1f4f304
4
- data.tar.gz: 21dd8d7ef8152698da900b8bd7feeb08877083e807bfbf62c211da774f2bd8a7
3
+ metadata.gz: 0bc8f7f5b23b61360c4b6a72c253b52beb5f7226ebf441d6a6561729155ea55d
4
+ data.tar.gz: 7175e7ea9121d74d633bb32ce6f88e2d50ddbc3b0109426c562508e40a119727
5
5
  SHA512:
6
- metadata.gz: f795d708cc633acbbb844ab082004bd3408d14774dfd74232f371da3c8e6c2d4fadf6bd24309c10005acee0ce56f5ceade59669f2ed79f3e7616dab7517045b0
7
- data.tar.gz: c5f41fda437761761c0590f4a5e35c49534b5e614c5341fe57d356ceb8be4fb64fb90de078ee03f63e8163e7155b742effa3667b65cdad507fda37e1cb400d8e
6
+ metadata.gz: f169ddb8eafd2b66e84c8fd32328793e040477a376ab7dfedef29990d330afa667f5f563bc540a0479b095cc2c16cb38b6bb7a7a6c9842656ea41425e63c87b7
7
+ data.tar.gz: 53e010725185c4acab07988025b1dd70d7def52f27c285ed502a21f1d8e8ad1eedca780db14378824ff7891fbd852265b06a2256281c5a07d40545487ad9241c
@@ -11,8 +11,8 @@ jobs:
11
11
  test:
12
12
  strategy:
13
13
  matrix:
14
- os: ['ubuntu-18.04', 'ubuntu-20.04']
15
- ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1']
14
+ os: ['ubuntu-20.04']
15
+ ruby-version: ['2.6', '2.7', '3.0', '3.1']
16
16
  # ubuntu 22.04 only supports ssl 3 and thus only ruby 3.1
17
17
  include:
18
18
  - os: 'ubuntu-22.04'
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ before_install:
3
3
  - git submodule update --init --recursive
4
4
 
5
5
  rvm:
6
+ - 2.6.10
6
7
  - 2.7.6
7
8
  - 3.0.4
8
9
  - 3.1.2
data/README.md CHANGED
@@ -49,6 +49,17 @@ input = "jwt_header.jwt_claims.jwt_signature"
49
49
  JSON::JWT.decode(input, public_key)
50
50
  ```
51
51
 
52
+ If you need to get a JWK from `jwks_uri` of OpenID Connect IdP, you can use `JSON::JWK::Set::Fetcher` to fetch (& optionally cache) it.
53
+
54
+ ```ruby
55
+ # JWK Set Fetching & Caching
56
+ # NOTE: Optionally by setting cache instance, JWKs are cached by kid.
57
+ JSON::JWK::Set::Fetcher.cache = Rails.cache
58
+
59
+ JSON::JWK::Set::Fetcher.fetch(jwks_uri, kid: kid)
60
+ # => returns JSON::JWK instance or raise JSON::JWK::Set::KidNotFound
61
+ ```
62
+
52
63
  For more details, read [Documentation Wiki](https://github.com/nov/json-jwt/wiki).
53
64
 
54
65
  ## Note on Patches/Pull Requests
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.15.1
1
+ 1.15.3
@@ -3,7 +3,7 @@ module JSON
3
3
  class Set
4
4
  module Fetcher
5
5
  class Cache
6
- def fetch(cache_key)
6
+ def fetch(cache_key, options = {})
7
7
  yield
8
8
  end
9
9
  end
@@ -60,7 +60,7 @@ module JSON
60
60
  end
61
61
  self.cache = Cache.new
62
62
 
63
- def self.fetch(jwks_uri, kid:, auto_detect: true)
63
+ def self.fetch(jwks_uri, kid:, auto_detect: true, **options)
64
64
  cache_key = [
65
65
  'json:jwk:set',
66
66
  OpenSSL::Digest::MD5.hexdigest(jwks_uri),
@@ -69,7 +69,7 @@ module JSON
69
69
 
70
70
  jwks = Set.new(
71
71
  JSON.parse(
72
- cache.fetch(cache_key) do
72
+ cache.fetch(cache_key, options) do
73
73
  http_client.get_content(jwks_uri)
74
74
  end
75
75
  )
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.15.1
4
+ version: 1.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -140,8 +140,7 @@ description: JSON Web Token and its family (JSON Web Signature, JSON Web Encrypt
140
140
  and JSON Web Key) in Ruby
141
141
  email:
142
142
  - nov@matake.jp
143
- executables:
144
- - console
143
+ executables: []
145
144
  extensions: []
146
145
  extra_rdoc_files: []
147
146
  files:
@@ -156,7 +155,6 @@ files:
156
155
  - README.md
157
156
  - Rakefile
158
157
  - VERSION
159
- - bin/console
160
158
  - json-jwt.gemspec
161
159
  - lib/json/jose.rb
162
160
  - lib/json/jwe.rb
@@ -171,7 +169,7 @@ homepage: https://github.com/nov/json-jwt
171
169
  licenses:
172
170
  - MIT
173
171
  metadata: {}
174
- post_install_message:
172
+ post_install_message:
175
173
  rdoc_options: []
176
174
  require_paths:
177
175
  - lib
@@ -187,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
185
  version: '0'
188
186
  requirements: []
189
187
  rubygems_version: 3.1.6
190
- signing_key:
188
+ signing_key:
191
189
  specification_version: 4
192
190
  summary: JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and
193
191
  JSON Web Key) in Ruby
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "json/jwt"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)