Sha256: deb7fd17d3fb4dc98da40c3d3d642853963a6f827a67df392834f27b466fa71c

Contents?: true

Size: 966 Bytes

Versions: 3

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true

require 'faraday' unless defined? Faraday

module FinAppsCore
  module Middleware
    autoload :AcceptJson, 'finapps_core/middleware/request/accept_json'
    autoload :UserAgent, 'finapps_core/middleware/request/user_agent'
    autoload :NoEncodingBasicAuthentication, 'finapps_core/middleware/request/no_encoding_basic_authentication'
    autoload :TenantAuthentication, 'finapps_core/middleware/request/tenant_authentication'
    autoload :CustomLogger, 'finapps_core/middleware/response/custom_logger'

    if Faraday::Middleware.respond_to? :register_middleware
      Faraday::Request.register_middleware \
        accept_json: -> { AcceptJson },
        user_agent: -> { UserAgent },
        no_encoding_basic_authentication: -> { NoEncodingBasicAuthentication },
        tenant_authentication: -> { TenantAuthentication }
      Faraday::Response.register_middleware \
        custom_logger: -> { CustomLogger }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
finapps_core-3.0.1 lib/finapps_core/middleware/middleware.rb
finapps_core-2.1.2 lib/finapps_core/middleware/middleware.rb
finapps_core-2.1.1 lib/finapps_core/middleware/middleware.rb