Module: Grape::Jwt::Authentication::Extensions::Dependencies

Included in:
Grape::Jwt::Authentication
Defined in:
lib/grape/jwt/authentication/extensions/dependencies.rb

Overview

Root-level handling of dependencies.

Constant Summary collapse

KEYLESS_CONFIGURATION =

Specifies which configuration keys are shared between keyless and grape-jwt-authentication, so that we can easily pass through our configuration to keyless.

i[
  authenticator rsa_public_key_url rsa_public_key_caching
  rsa_public_key_expiration jwt_issuer jwt_beholder jwt_options
  jwt_verification_key
].freeze

Instance Method Summary collapse

Instance Method Details

#configure_dependenciesObject

(Re)configure our gem dependencies. We take care of setting up Keyless, which has been extracted from this gem.



20
21
22
# File 'lib/grape/jwt/authentication/extensions/dependencies.rb', line 20

def configure_dependencies
  configure_keyless
end

#configure_keylessObject

Configure the Keyless gem with our configuration.



25
26
27
28
29
30
31
32
33
# File 'lib/grape/jwt/authentication/extensions/dependencies.rb', line 25

def configure_keyless
  configuration = Grape::Jwt::Authentication.configuration

  Keyless.configure do |keyless|
    KEYLESS_CONFIGURATION.each do |option|
      keyless.send("#{option}=", configuration.send(option))
    end
  end
end