google-cloud-web_risk 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1815338bd510339d75b00025b45dd2a3d6121c96192622ad1df54ee0a279bf3e
4
- data.tar.gz: 6f950ff653bdc3f33138e914043149df611fd04c8d9ed18a1db227fd387dcc50
3
+ metadata.gz: 7032e15ef926e1eb3bbc74825ab42a96b86523bf0d893883a2fb770a290bcfdb
4
+ data.tar.gz: d5f914e2df509cbe083a4f28eca3631f8c6ea1fa96ccb6ec734e08e19eab1da8
5
5
  SHA512:
6
- metadata.gz: e38a181209f238c7653fdfcabd786a3f46b391ad43425054acf1c908fb10f05f10d6eff98554f919cc79e2a47f96f0b256d41e35ef8282a1cc8165543db01b87
7
- data.tar.gz: cb11f617e255098ad75782ad034813932865546fec533234059580ba72b42f43b2bad963d9d964d45cc6ae30692b2ec9634f2df8655a510f9223effdfc8b2c5a
6
+ metadata.gz: ee2d01b44d249612dcb10ae7ee9a878565ecd57359e2a4c9a2e8474636ece15cccecac9b20b7fa1dbb4d45ff32402de3bcba9853c66813808cf6bf2711af1ff4
7
+ data.tar.gz: e003e409a120313dd02348ff6a6065f4c1bf15fd71da68c578e835eb040c0ceba833f5f2e4e751698f6e6cb978df823d0eb8e11097df6c394480511e23ad300e
data/README.md CHANGED
@@ -43,9 +43,40 @@ and includes substantial interface changes. Existing code written for earlier
43
43
  versions of this library will likely require updates to use this version.
44
44
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
45
45
 
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ Debug logging also requires that the versioned clients for this service be
72
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
73
+ working, try updating the versioned clients in your bundle or installed gems:
74
+ [google-cloud-web_risk-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1/latest),
75
+ [google-cloud-web_risk-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1beta1/latest).
76
+
46
77
  ## Supported Ruby Versions
47
78
 
48
- This library is supported on Ruby 2.7+.
79
+ This library is supported on Ruby 3.0+.
49
80
 
50
81
  Google provides official support for Ruby versions that are actively supported
51
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module WebRisk
23
- VERSION = "1.6.0"
23
+ VERSION = "1.7.0"
24
24
  end
25
25
  end
26
26
  end
@@ -58,6 +58,11 @@ module Google
58
58
  # You can also specify a different transport by passing `:rest` or `:grpc` in
59
59
  # the `transport` parameter.
60
60
  #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the WebRiskService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::WebRisk.web_risk_service_available?}.
65
+ #
61
66
  # ## About WebRiskService
62
67
  #
63
68
  # Web Risk API defines an interface to detect malicious URLs on your
@@ -80,6 +85,37 @@ module Google
80
85
  service_module.const_get(:Client).new(&block)
81
86
  end
82
87
 
88
+ ##
89
+ # Determines whether the WebRiskService service is supported by the current client.
90
+ # If true, you can retrieve a client object by calling {Google::Cloud::WebRisk.web_risk_service}.
91
+ # If false, that method will raise an exception. This could happen if the given
92
+ # API version does not exist or does not support the WebRiskService service,
93
+ # or if the versioned client gem needs an update to support the WebRiskService service.
94
+ #
95
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
96
+ # Defaults to `:v1`.
97
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
98
+ # @return [boolean] Whether the service is available.
99
+ #
100
+ def self.web_risk_service_available? version: :v1, transport: :grpc
101
+ require "google/cloud/web_risk/#{version.to_s.downcase}"
102
+ package_name = Google::Cloud::WebRisk
103
+ .constants
104
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
105
+ .first
106
+ return false unless package_name
107
+ service_module = Google::Cloud::WebRisk.const_get package_name
108
+ return false unless service_module.const_defined? :WebRiskService
109
+ service_module = service_module.const_get :WebRiskService
110
+ if transport == :rest
111
+ return false unless service_module.const_defined? :Rest
112
+ service_module = service_module.const_get :Rest
113
+ end
114
+ service_module.const_defined? :Client
115
+ rescue ::LoadError
116
+ false
117
+ end
118
+
83
119
  ##
84
120
  # Configure the google-cloud-web_risk library.
85
121
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-web_risk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -83,7 +82,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
83
82
  licenses:
84
83
  - Apache-2.0
85
84
  metadata: {}
86
- post_install_message:
87
85
  rdoc_options: []
88
86
  require_paths:
89
87
  - lib
@@ -91,15 +89,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
89
  requirements:
92
90
  - - ">="
93
91
  - !ruby/object:Gem::Version
94
- version: '2.7'
92
+ version: '3.0'
95
93
  required_rubygems_version: !ruby/object:Gem::Requirement
96
94
  requirements:
97
95
  - - ">="
98
96
  - !ruby/object:Gem::Version
99
97
  version: '0'
100
98
  requirements: []
101
- rubygems_version: 3.5.6
102
- signing_key:
99
+ rubygems_version: 3.6.2
103
100
  specification_version: 4
104
101
  summary: API Client library for the Web Risk API
105
102
  test_files: []