diff --git a/ChangeLog b/ChangeLog index 54441aea1..655704fab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +3.0.1: + - Add an insecure channel config flag 3.0.0: - Compatability with v2 of the API: https://developers.google.com/google-ads/api/docs/release-notes - Removed the symbol based lookup util, favoring a method based one: diff --git a/lib/google/ads/google_ads/config.rb b/lib/google/ads/google_ads/config.rb index edc58c93c..451e38461 100644 --- a/lib/google/ads/google_ads/config.rb +++ b/lib/google/ads/google_ads/config.rb @@ -39,6 +39,8 @@ class Config attr_accessor :treat_deprecation_warnings_as_errors attr_accessor :warn_on_all_deprecations + attr_accessor :use_insecure_channel + def initialize(&block) @refresh_token = nil @client_id = nil @@ -58,6 +60,8 @@ def initialize(&block) @treat_deprecation_warnings_as_errors = false @warn_on_all_deprecations = false + @use_insecure_channel = false + yield self if block_given? end diff --git a/lib/google/ads/google_ads/google_ads_client.rb b/lib/google/ads/google_ads/google_ads_client.rb index 74dca2c25..d5955bfad 100644 --- a/lib/google/ads/google_ads/google_ads_client.rb +++ b/lib/google/ads/google_ads/google_ads_client.rb @@ -155,9 +155,13 @@ def make_channel MAX_METADATA_SIZE => 16*1024*1024, } - call_creds = GRPC::Core::CallCredentials.new(get_credentials) - chan_creds = GRPC::Core::ChannelCredentials.new.compose(call_creds) - GRPC::Core::Channel.new(target, channel_args, chan_creds) + if !@config.use_insecure_channel + call_creds = GRPC::Core::CallCredentials.new(get_credentials) + chan_creds = GRPC::Core::ChannelCredentials.new.compose(call_creds) + GRPC::Core::Channel.new(target, channel_args, chan_creds) + else + GRPC::Core::Channel.new(target, channel_args, :this_channel_is_insecure) + end end def patch_lro_headers(class_to_return, headers) diff --git a/lib/google/ads/google_ads/version.rb b/lib/google/ads/google_ads/version.rb index 10c957bf8..12180434b 100644 --- a/lib/google/ads/google_ads/version.rb +++ b/lib/google/ads/google_ads/version.rb @@ -19,7 +19,7 @@ module Google module Ads module GoogleAds - CLIENT_LIB_VERSION = '3.0.0'.freeze + CLIENT_LIB_VERSION = '3.0.1'.freeze end end end