google-ads-googleads 25.0.1 → 25.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/google_ads_config.rb +6 -0
- data/lib/google/ads/google_ads/config.rb +2 -0
- data/lib/google/ads/google_ads/google_ads_client.rb +0 -1
- data/lib/google/ads/google_ads/interceptors/logging_interceptor.rb +37 -1
- data/lib/google/ads/google_ads/service_lookup.rb +7 -3
- data/lib/google/ads/google_ads/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28443d70013ab5917dd103b40ae20c3e319ce1cd7577cb8d048e57547de4ed4
|
4
|
+
data.tar.gz: 19e3462910b2e7ecc34081a6993e3e09f8dfac2d835fd473e0c7bef504aa9128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce0d8a9795a7997afb45637e2d5dfe6ed2174ed3959bb1c916a83f5b4ceda80afe25419e503e826fc53041389e4fdcdb9328c307f1f87c3cb638682be9a3861b
|
7
|
+
data.tar.gz: ad1f8ea84fb93385619a403682ecf8f24e448337008ea2d1b132a073677f4d5dd896a5fc869d8004e71caf9b17c6470b22c07d06dfdadb3e2f49d89431823c74
|
data/google_ads_config.rb
CHANGED
@@ -26,6 +26,12 @@ Google::Ads::GoogleAds::Config.new do |c|
|
|
26
26
|
c.client_secret = 'INSERT_CLIENT_SECRET_HERE'
|
27
27
|
c.refresh_token = 'INSERT_REFRESH_TOKEN_HERE'
|
28
28
|
|
29
|
+
# Whether to use the Google Cloud Organization of your Google Cloud
|
30
|
+
# project instead of developer token to determine your Google Ads API access levels.
|
31
|
+
# Use this flag only if you are enrolled into a limited pilot that supports
|
32
|
+
# this configuration.
|
33
|
+
# c.use_cloud_org_for_api_access = false
|
34
|
+
|
29
35
|
# You can also authenticate using a service account. If "keyfile" is
|
30
36
|
# specified below, then service account authentication will be assumed and
|
31
37
|
# the above authentication fields ignored. Read more about service account
|
@@ -32,6 +32,7 @@ module Google
|
|
32
32
|
attr_accessor :developer_token
|
33
33
|
attr_accessor :login_customer_id
|
34
34
|
attr_accessor :linked_customer_id
|
35
|
+
attr_accessor :use_cloud_org_for_api_access
|
35
36
|
|
36
37
|
attr_accessor :log_level
|
37
38
|
attr_accessor :log_target
|
@@ -55,6 +56,7 @@ module Google
|
|
55
56
|
@developer_token = nil
|
56
57
|
@login_customer_id = nil
|
57
58
|
@linked_customer_id = nil
|
59
|
+
@use_cloud_org_for_api_access = false
|
58
60
|
|
59
61
|
@log_level = nil
|
60
62
|
@log_target = nil
|
@@ -225,7 +225,6 @@ module Google
|
|
225
225
|
# Provides a Google::Auth::Credentials initialized with a keyfile
|
226
226
|
# specified in the config.
|
227
227
|
def get_service_account_credentials
|
228
|
-
raise 'config.impersonate required if keyfile specified' unless @config.impersonate
|
229
228
|
keyfile = File.read(@config.keyfile)
|
230
229
|
keyfile = JSON.parse(keyfile)
|
231
230
|
Signet::OAuth2::Client.new(
|
@@ -37,7 +37,11 @@ module Google
|
|
37
37
|
customer_user_access.email_address|
|
38
38
|
customer_user_access_invitation.email_address|
|
39
39
|
change_event.user_email|
|
40
|
-
feed.places_location_feed_data.email_address
|
40
|
+
feed.places_location_feed_data.email_address|
|
41
|
+
local_services_lead.contact_details.phone_number|
|
42
|
+
local_services_lead.contact_details.email|
|
43
|
+
local_services_lead.contact_details.consumer_name|
|
44
|
+
local_services_lead_conversation.message_details.text
|
41
45
|
/x
|
42
46
|
|
43
47
|
MASK_REPLACEMENT = "REDACTED"
|
@@ -244,11 +248,43 @@ module Google
|
|
244
248
|
message["emailAddress"] = MASK_REPLACEMENT
|
245
249
|
end
|
246
250
|
message
|
251
|
+
elsif "LocalServicesLead" == message_class
|
252
|
+
# Sanitize sensitive fields when creating a LocalServiceLead.
|
253
|
+
message = clone_to_json(message)
|
254
|
+
sanitize_local_services_lead(message)
|
255
|
+
elsif "LocalServicesLeadConversation" == message_class
|
256
|
+
# Sanitize sensitive fields when creating a LocalServicesLeadConversation.
|
257
|
+
message = clone_to_json(message)
|
258
|
+
sanitize_local_services_lead_conversation(message)
|
247
259
|
else
|
248
260
|
message
|
249
261
|
end
|
250
262
|
end
|
251
263
|
|
264
|
+
def sanitize_local_services_lead_conversation(message)
|
265
|
+
if message.include?("messageDetails")
|
266
|
+
if message["messageDetails"].include?("text")
|
267
|
+
message["messageDetails"]["text"] = MASK_REPLACEMENT
|
268
|
+
end
|
269
|
+
end
|
270
|
+
message
|
271
|
+
end
|
272
|
+
|
273
|
+
def sanitize_local_services_lead(message)
|
274
|
+
if message.include?("contactDetails")
|
275
|
+
if message["contactDetails"].include?("email")
|
276
|
+
message["contactDetails"]["email"] = MASK_REPLACEMENT
|
277
|
+
end
|
278
|
+
if message["contactDetails"].include?("phoneNumber")
|
279
|
+
message["contactDetails"]["phoneNumber"] = MASK_REPLACEMENT
|
280
|
+
end
|
281
|
+
if message["contactDetails"].include?("consumerName")
|
282
|
+
message["contactDetails"]["consumerName"] = MASK_REPLACEMENT
|
283
|
+
end
|
284
|
+
end
|
285
|
+
message
|
286
|
+
end
|
287
|
+
|
252
288
|
def sanitize_customer_user_access(message)
|
253
289
|
if message.include?("emailAddress")
|
254
290
|
message["emailAddress"] = MASK_REPLACEMENT
|
@@ -62,9 +62,13 @@ module Google
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def headers
|
65
|
-
headers = {
|
66
|
-
|
67
|
-
|
65
|
+
headers = {}
|
66
|
+
|
67
|
+
# If config.use_cloud_org_for_api_access is not True, add the developer
|
68
|
+
# token to the request's metadata
|
69
|
+
if !config.use_cloud_org_for_api_access
|
70
|
+
headers[:"developer-token"] = config.developer_token
|
71
|
+
end
|
68
72
|
|
69
73
|
if config.login_customer_id
|
70
74
|
validate_customer_id(:login_customer_id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-ads-googleads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 25.0.
|
4
|
+
version: 25.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.20'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.20'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: google-protobuf
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|