Class: LHC::Auth

Inherits:
Interceptor show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/lhc/interceptors/auth.rb

Instance Attribute Summary

Attributes inherited from Interceptor

#request

Instance Method Summary collapse

Methods inherited from Interceptor

#after_request, #all_interceptor_classes, #before_response, dup, #initialize, #response

Constructor Details

This class inherits a constructor from LHC::Interceptor

Instance Method Details

#after_responseObject



16
17
18
19
20
21
# File 'lib/lhc/interceptors/auth.rb', line 16

def after_response
  return unless configuration_correct?
  return unless reauthenticate?

  reauthenticate!
end

#before_raw_requestObject



7
8
9
# File 'lib/lhc/interceptors/auth.rb', line 7

def before_raw_request
  body_authentication! if auth_options[:body]
end

#before_requestObject



11
12
13
14
# File 'lib/lhc/interceptors/auth.rb', line 11

def before_request
  bearer_authentication! if auth_options[:bearer]
  basic_authentication! if auth_options[:basic]
end