Class: Zaikio::JWTAuth::JWK

Inherits:
Object
  • Object
show all
Defined in:
lib/zaikio/jwt_auth/jwk.rb

Constant Summary collapse

CACHE_EXPIRES_AFTER =
1.hour.freeze

Class Method Summary collapse

Class Method Details

.loaderObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/zaikio/jwt_auth/jwk.rb', line 11

def loader
  lambda do |options|
    return TestHelper.jwk_set if JWTAuth.configuration.test_mode

    reload_keys if options[:invalidate]

    {
      keys: keys.map do |key_data|
        JWT::JWK.import(key_data.with_indifferent_access).export
      end
    }
  end
end