Sha256: 4a840143e85100796db6c3c336a8bd445fa1a44110ba92d565d306713e8f8cac

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

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 :RequestId, 'finapps_core/middleware/request/request_id'
    autoload :XConsumerId, 'finapps_core/middleware/request/x_consumer_id'

    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 },
        request_id: -> { RequestId },
        x_consumer_id: -> { XConsumerId }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
finapps_core-5.0.11 lib/finapps_core/middleware/middleware.rb
finapps_core-5.0.10 lib/finapps_core/middleware/middleware.rb
finapps_core-5.0.9 lib/finapps_core/middleware/middleware.rb
finapps_core-5.0.8 lib/finapps_core/middleware/middleware.rb