Method: PulpContainerClient::ApiClient#basic_auth

Defined in:
lib/pulp_container_client/api_client.rb

#basic_auth(conn) ⇒ Object


240
241
242
243
244
245
246
247
248
# File 'lib/pulp_container_client/api_client.rb', line 240

def basic_auth(conn)
  if config.username && config.password
    if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
      conn.request(:authorization, :basic, config.username, config.password)
    else
      conn.request(:basic_auth, config.username, config.password)
    end
  end
end