From 1f3b634b957ba6125252a9985db9ed6d5ef1b8ca Mon Sep 17 00:00:00 2001 From: narayana Date: Wed, 13 Sep 2023 12:50:10 +0530 Subject: [PATCH 1/4] version upgrade --- CHANGELOG.md | 3 +++ README.md | 2 +- lib/plivo/base_client.rb | 15 +++++++-------- lib/plivo/resources/call_feedback.rb | 1 - lib/plivo/version.rb | 2 +- plivo.gemspec | 3 +-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a033a112..20700ee6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## [4.49.0](https://github.com/plivo/plivo-ruby/tree/v4.49.0) (2023-09-13) +**Removing the faraday_middleware dependency and upgrade to farady latest version + ## [4.48.0](https://github.com/plivo/plivo-ruby/tree/v4.48.0) (2023-08-25) **Feature - Added New Param 'carrier_fees', 'carrier_fees_rate', 'destination_network' in Get Message and List Message APIs** - Added new params on message get and list response diff --git a/README.md b/README.md index 0cc76503..1ea69f61 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a Add this line to your application's Gemfile: ```ruby -gem 'plivo', '>= 4.48.0' +gem 'plivo', '>= 4.49.0' ``` And then execute: diff --git a/lib/plivo/base_client.rb b/lib/plivo/base_client.rb index 90f53968..9a73f9f5 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' @@ -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, 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, 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, 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, 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, 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, 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, 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..e10ce1df 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 diff --git a/lib/plivo/version.rb b/lib/plivo/version.rb index 3d183c33..5632aab2 100644 --- a/lib/plivo/version.rb +++ b/lib/plivo/version.rb @@ -1,3 +1,3 @@ module Plivo - VERSION = "4.48.0".freeze + VERSION = "4.49.0".freeze end diff --git a/plivo.gemspec b/plivo.gemspec index 0db3240b..5ef10865 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' spec.add_dependency 'htmlentities' spec.add_dependency 'jwt' From 3fa7b409cfc3ffc95f0836fac761b3a9d6ed5666 Mon Sep 17 00:00:00 2001 From: narayana Date: Wed, 13 Sep 2023 13:14:32 +0530 Subject: [PATCH 2/4] support 2.6 and above --- .github/workflows/unitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index bd94635e..4029f80a 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: [ '2.4', '2.5', '2.6' ,'2.7', '3.0' ] + ruby-version: [ '2.6' ,'2.7', '3.0' ] steps: - name: Checkout From 46a56005a351959761811ecaeb44e765c496dd4f Mon Sep 17 00:00:00 2001 From: narayana Date: Wed, 13 Sep 2023 14:24:07 +0530 Subject: [PATCH 3/4] test --- lib/plivo/base_client.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/plivo/base_client.rb b/lib/plivo/base_client.rb index 9a73f9f5..957158f1 100644 --- a/lib/plivo/base_client.rb +++ b/lib/plivo/base_client.rb @@ -136,7 +136,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request(:basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -149,7 +149,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request( :basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -162,7 +162,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request( :basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -175,7 +175,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request( :basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -188,7 +188,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request( :basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -201,7 +201,7 @@ def configure_connection # DANGER: Basic auth should always come after headers, else # The headers will replace the basic_auth - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request( :basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -254,7 +254,7 @@ def send_post(resource_path, data, timeout, use_multipart_conn, options = nil) faraday.request :multipart faraday.request :url_encoded - faraday.request(:authorization, :basic_auth, auth_id, auth_token) + faraday.request( :basic_auth, auth_id, auth_token) faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ From dab7fa2b555d21ff697392d1da3eb11d9cc37ca7 Mon Sep 17 00:00:00 2001 From: narayana Date: Wed, 13 Sep 2023 14:54:42 +0530 Subject: [PATCH 4/4] fix --- lib/plivo/base_client.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/plivo/base_client.rb b/lib/plivo/base_client.rb index 957158f1..764dbbc5 100644 --- a/lib/plivo/base_client.rb +++ b/lib/plivo/base_client.rb @@ -136,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -149,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -162,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -175,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -188,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -201,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/ @@ -254,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.headers['Authorization'] = "Basic #{Base64.strict_encode64("#{auth_id}:#{auth_token}")}" faraday.proxy=@proxy_hash if @proxy_hash faraday.response :json, content_type: /\bjson$/