google-cloud-web_security_scanner 1.4.1 → 2.0.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: 9ba367920ab0b2ec2df03c18ccdb127c4aa046861b4e14b2f1f1df85dbde5a95
4
- data.tar.gz: 9beb3f652123fca3e09df922f9588615c40c7d0aca9507a91d0d26c563ba5b3e
3
+ metadata.gz: 6b038fc403edf7cf23581f47ae3d130119556999d5671a15c634c25b7c8b41fa
4
+ data.tar.gz: 6b1cae0718be5329be3ee2127e8f20cc7c63fc06f462d26c42f42c7846cbb2bc
5
5
  SHA512:
6
- metadata.gz: 16584761fdcfc2f258a72cb942970b3899c3b349938a5bb70cfb4f5adcad828b3895d4a3ebb387a7720d56681a79e1583ae466dafde17a35f9cbda331105cec9
7
- data.tar.gz: b150a746c72949b219ce7fc54ea1232139e2114b6292f4b1f74982b0a4f400625e950c496239aaba8cdd183b3f16a8ad021f390968552d9e1b2efdb0cd438d71
6
+ metadata.gz: 98b1a731ed5a57f29596f9d1aabe111161ddf0ea56b9b9fc149716974c2adc364549973e38d7188a7dee99954f2a24a22459ffe4a5fdf4a66735aab9abbda6f6
7
+ data.tar.gz: 1d3236d540b82edff417b4e3c5ce1c4564b75cacf5908147b83c30200d001be2ea54d173394e97be042f52e4aedca64bde96c002f7e3fa4ba56a17e715f002ae
data/README.md CHANGED
@@ -16,8 +16,7 @@ for this library, google-cloud-web_security_scanner, to see the convenience meth
16
16
  constructing client objects. Reference documentation for the client objects
17
17
  themselves can be found in the client library documentation for the versioned
18
18
  client gems:
19
- [google-cloud-web_security_scanner-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest),
20
- [google-cloud-web_security_scanner-v1beta](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1beta/latest).
19
+ [google-cloud-web_security_scanner-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest).
21
20
 
22
21
  See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/)
23
22
  for more usage information.
@@ -35,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
35
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/websecurityscanner.googleapis.com)
36
35
  1. {file:AUTHENTICATION.md Set up authentication.}
37
36
 
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-web_security_scanner-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest).
66
+
38
67
  ## Supported Ruby Versions
39
68
 
40
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
41
70
 
42
71
  Google provides official support for Ruby versions that are actively supported
43
72
  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 WebSecurityScanner
23
- VERSION = "1.4.1"
23
+ VERSION = "2.0.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 WebSecurityScanner service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::WebSecurityScanner.web_security_scanner_available?}.
65
+ #
61
66
  # ## About WebSecurityScanner
62
67
  #
63
68
  # Web Security Scanner Service identifies security vulnerabilities in web
@@ -81,6 +86,37 @@ module Google
81
86
  service_module.const_get(:Client).new(&block)
82
87
  end
83
88
 
89
+ ##
90
+ # Determines whether the WebSecurityScanner service is supported by the current client.
91
+ # If true, you can retrieve a client object by calling {Google::Cloud::WebSecurityScanner.web_security_scanner}.
92
+ # If false, that method will raise an exception. This could happen if the given
93
+ # API version does not exist or does not support the WebSecurityScanner service,
94
+ # or if the versioned client gem needs an update to support the WebSecurityScanner service.
95
+ #
96
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
97
+ # Defaults to `:v1`.
98
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
99
+ # @return [boolean] Whether the service is available.
100
+ #
101
+ def self.web_security_scanner_available? version: :v1, transport: :grpc
102
+ require "google/cloud/web_security_scanner/#{version.to_s.downcase}"
103
+ package_name = Google::Cloud::WebSecurityScanner
104
+ .constants
105
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
106
+ .first
107
+ return false unless package_name
108
+ service_module = Google::Cloud::WebSecurityScanner.const_get package_name
109
+ return false unless service_module.const_defined? :WebSecurityScanner
110
+ service_module = service_module.const_get :WebSecurityScanner
111
+ if transport == :rest
112
+ return false unless service_module.const_defined? :Rest
113
+ service_module = service_module.const_get :Rest
114
+ end
115
+ service_module.const_defined? :Client
116
+ rescue ::LoadError
117
+ false
118
+ end
119
+
84
120
  ##
85
121
  # Configure the google-cloud-web_security_scanner library.
86
122
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-web_security_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 2.0.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-08-08 00:00:00.000000000 Z
10
+ date: 2025-02-13 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -28,42 +27,16 @@ dependencies:
28
27
  name: google-cloud-web_security_scanner-v1
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0.9'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: 2.a
37
- type: :runtime
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '0.9'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: 2.a
47
- - !ruby/object:Gem::Dependency
48
- name: google-cloud-web_security_scanner-v1beta
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0.8'
54
- - - "<"
30
+ - - "~>"
55
31
  - !ruby/object:Gem::Version
56
- version: 2.a
32
+ version: '1.2'
57
33
  type: :runtime
58
34
  prerelease: false
59
35
  version_requirements: !ruby/object:Gem::Requirement
60
36
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0.8'
64
- - - "<"
37
+ - - "~>"
65
38
  - !ruby/object:Gem::Version
66
- version: 2.a
39
+ version: '1.2'
67
40
  description: Web Security Scanner scans your Compute and App Engine apps for common
68
41
  web vulnerabilities.
69
42
  email: googleapis-packages@google.com
@@ -82,7 +55,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
82
55
  licenses:
83
56
  - Apache-2.0
84
57
  metadata: {}
85
- post_install_message:
86
58
  rdoc_options: []
87
59
  require_paths:
88
60
  - lib
@@ -90,15 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
62
  requirements:
91
63
  - - ">="
92
64
  - !ruby/object:Gem::Version
93
- version: '2.7'
65
+ version: '3.0'
94
66
  required_rubygems_version: !ruby/object:Gem::Requirement
95
67
  requirements:
96
68
  - - ">="
97
69
  - !ruby/object:Gem::Version
98
70
  version: '0'
99
71
  requirements: []
100
- rubygems_version: 3.5.6
101
- signing_key:
72
+ rubygems_version: 3.6.3
102
73
  specification_version: 4
103
74
  summary: API Client library for the Web Security Scanner API
104
75
  test_files: []