diff --git a/lib/plivo/base_client.rb b/lib/plivo/base_client.rb index 90f53968..4cd36907 100644 --- a/lib/plivo/base_client.rb +++ b/lib/plivo/base_client.rb @@ -1,6 +1,5 @@ require 'json' require 'faraday' -require 'faraday_middleware' require_relative 'exceptions' require_relative 'utils' @@ -78,7 +77,7 @@ def send_request(resource_path, method = 'GET', data = {}, timeout = nil, use_mu process_response(method, response.to_hash) end end - + private def auth_token @@ -137,7 +136,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -150,7 +149,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -163,7 +162,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -176,7 +175,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -189,7 +188,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -202,7 +201,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -255,7 +254,7 @@ def send_post(resource_path, data, timeout, use_multipart_conn, options = nil) faraday.request :multipart faraday.request :url_encoded - faraday.request(:basic_auth, auth_id, auth_token) + faraday.request(:authorization, :basic, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ diff --git a/lib/plivo/resources/call_feedback.rb b/lib/plivo/resources/call_feedback.rb index 8da30bc7..500b2bdc 100644 --- a/lib/plivo/resources/call_feedback.rb +++ b/lib/plivo/resources/call_feedback.rb @@ -1,6 +1,5 @@ require 'json' require 'faraday' -require 'faraday_middleware' module Plivo module Resources @@ -21,7 +20,7 @@ def initialize(client, resource_list_json = nil) end def create(call_uuid, rating, issues = [], notes = "") - + valid_param?(:call_uuid, call_uuid, String, true) valid_param?(:rating, rating, [Integer, Float], true) @@ -32,7 +31,7 @@ def create(call_uuid, rating, issues = [], notes = "") if rating < 1 or rating > 5 raise_invalid_request("Rating has to be a float between 1 - 5") end - + params = { rating: rating, } @@ -52,4 +51,4 @@ def create(call_uuid, rating, issues = [], notes = "") end end end -end \ No newline at end of file +end diff --git a/lib/plivo/version.rb b/lib/plivo/version.rb index f852a73c..ad82ace8 100644 --- a/lib/plivo/version.rb +++ b/lib/plivo/version.rb @@ -1,3 +1,3 @@ module Plivo - VERSION = "4.45.0".freeze + VERSION = "4.46.0".freeze end diff --git a/plivo.gemspec b/plivo.gemspec index 0db3240b..236c5d11 100644 --- a/plivo.gemspec +++ b/plivo.gemspec @@ -31,8 +31,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 2.0.0' - spec.add_dependency 'faraday', '~> 1.0' - spec.add_dependency 'faraday_middleware', '~> 1.0' + spec.add_dependency 'faraday', '~> 2.7.8' spec.add_dependency 'htmlentities' spec.add_dependency 'jwt'