class Auth0RS256JWTVerifier::JWKSetDownloader

Constants

InvalidJWKSetError

Public Class Methods

new(http) click to toggle source
# File lib/auth0_rs256_jwt_verifier/jwk_set_downloader.rb, line 6
def initialize(http)
  @http = http
end

Public Instance Methods

download(url) click to toggle source
# File lib/auth0_rs256_jwt_verifier/jwk_set_downloader.rb, line 10
def download(url)
  url = String(url)
  body = @http.get(url)
  json = JSON.parse(body)
  begin
    JWKSet.new(json)
  rescue JWKSet::ParseError
    raise InvalidJWKSetError
  end
end