class AppleID::JWKS

Public Class Methods

cache() click to toggle source
# File lib/apple_id/jwks.rb, line 12
def self.cache
  @@cache
end
cache=(cache) click to toggle source
# File lib/apple_id/jwks.rb, line 9
def self.cache=(cache)
  @@cache = cache
end
fetch(cache_key) click to toggle source
# File lib/apple_id/jwks.rb, line 17
def self.fetch(cache_key)
  jwks = cache.fetch("apple_id:jwks:#{cache_key}") do
    new(
      JSON.parse(
        OpenIDConnect.http_client.get_content(JWKS_URI)
      ).with_indifferent_access[:keys]
    )
  end
end