Sha256: 0b2259898eb9e90cd15ccb31e9107f084bc268d3d6442f0cf70002db47b143bb

Contents?: true

Size: 936 Bytes

Versions: 4

Compression:

Stored size: 936 Bytes

Contents

# frozen_string_literal: true
require 'faraday' unless defined? Faraday

module FinApps
  module Middleware
    autoload :AcceptJson, 'finapps/middleware/request/accept_json'
    autoload :UserAgent, 'finapps/middleware/request/user_agent'
    autoload :NoEncodingBasicAuthentication, 'finapps/middleware/request/no_encoding_basic_authentication'
    autoload :TenantAuthentication, 'finapps/middleware/request/tenant_authentication'
    autoload :CustomLogger, 'finapps/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

4 entries across 4 versions & 1 rubygems

Version Path
finapps-2.1.4 lib/finapps/middleware/middleware.rb
finapps-2.1.3 lib/finapps/middleware/middleware.rb
finapps-2.1.2 lib/finapps/middleware/middleware.rb
finapps-2.1.1 lib/finapps/middleware/middleware.rb