Module: Rottweiler

Defined in:
lib/rottweiler.rb,
lib/rottweiler/version.rb,
lib/rottweiler/auth/result.rb,
lib/rottweiler/configs/jwt.rb,
lib/rottweiler/auth/settings.rb,
lib/rottweiler/configuration.rb,
lib/rottweiler/authentication.rb

Overview

frozen_string_literal true

Defined Under Namespace

Modules: Auth, Authentication, Configs Classes: Configuration, Error, InvalidJwtAlgorithmError, InvalidParamsError

Constant Summary collapse

VERSION =
'0.2.1'

Class Method Summary collapse

Class Method Details

.config(&block) ⇒ Object

Allows to configure Rottweiler gem:

Rottweiler.config do |config|
  config.token_header = 'Authorization'
  config.token_param = [:token]

  config.jwt.algorithm = 'RS256'
  config.jwt.decode_key = '--- RSA PUBLIC KEY ---'
end


24
25
26
27
28
29
30
31
32
# File 'lib/rottweiler.rb', line 24

def config(&block)
  config_instance = Configuration.instance

  if block_given?
    block.call(config_instance)
  else
    config_instance
  end
end