From d6bac628e428aad1e8dc394b1291659b888a1861 Mon Sep 17 00:00:00 2001 From: Sean O'Loughlin Date: Wed, 28 Feb 2024 14:24:47 -0700 Subject: [PATCH] version bump with conditional fix --- auth0_rs256_jwt_verifier.gemspec | 2 +- .../cached_certificates/jwk_set_downloader.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/auth0_rs256_jwt_verifier.gemspec b/auth0_rs256_jwt_verifier.gemspec index 3d0ba81..f36884b 100644 --- a/auth0_rs256_jwt_verifier.gemspec +++ b/auth0_rs256_jwt_verifier.gemspec @@ -1,7 +1,7 @@ # frozen_string_literal: true Gem::Specification.new do |s| s.name = "auth0_rs256_jwt_verifier" - s.version = "0.0.3" + s.version = "0.0.6" s.date = "2024-02-27" s.summary = "Auth0 JWT (RS256) verification library" s.description = <<-DESCRIPTION.gsub(/\s+/, " ").strip diff --git a/lib/auth0_rs256_jwt_verifier/cached_certificates/jwk_set_downloader.rb b/lib/auth0_rs256_jwt_verifier/cached_certificates/jwk_set_downloader.rb index cbc9cc7..e77b07a 100644 --- a/lib/auth0_rs256_jwt_verifier/cached_certificates/jwk_set_downloader.rb +++ b/lib/auth0_rs256_jwt_verifier/cached_certificates/jwk_set_downloader.rb @@ -11,7 +11,9 @@ def initialize(http) def download(url) url = String(url) body = @http.get(url) - json = {"keys" => JSON.parse(body) } + + json_body = JSON.parse(body) + json = json_body.instance_of?(Array) ? {"keys" => json_body } : json_body begin JWKSet.new(json) rescue JWKSet::ParseError