google-cloud-security_center 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73e6c318004b754c0aed56bee96c79dc86375f7b61baf56b7adbaa1114826731
4
- data.tar.gz: 5bf36c55e72428e4e29ced7bc5f054a9f8ad88bc7f4af75e30ed52ddff24e958
3
+ metadata.gz: b13d69219bd0fd0be12c3f548a2c02c6241d3e9b8ca71413bd23382631d2d9bf
4
+ data.tar.gz: 9c5e5d04acce77198f0ea5dfd7cda762e1e3dc36d2e75fa7f3676746ed060879
5
5
  SHA512:
6
- metadata.gz: 877a2879ff4f3c941effdbfd7f843f6efa35ceb7a96195c383213e1014f4185a1fd1fda4581ec585d68f8b5a955257c08cfe755c7121cdfe9ff26862fac83d21
7
- data.tar.gz: afc62f000982b9c4b06da400b404ce51ed746b13d2a61b0968193d0cbc6fd60c3719b56e46fd2dee40dc27f57d580c9d37bc7fc949469141ab9b6c2e07b29ede
6
+ metadata.gz: 1beb308b550d7b4c78d81431b1bc66a04c7fa888c7866e69592179958a85d9d97919554f8c026bde72c3cb8b97853c4a609b3b88a1774ca91c417bf5559dc63e
7
+ data.tar.gz: 4e23b8bea9d6b974ee77490b46da939dd774ac9ac771e0d726994d6ffc191d247ea215ebd3bc13d54b3c18fd3989192d43b819b0e8a5f769d047f274ea90a89a
data/README.md CHANGED
@@ -44,9 +44,41 @@ and includes substantial interface changes. Existing code written for earlier
44
44
  versions of this library will likely require updates to use this version.
45
45
  See the {file:MIGRATING.md MIGRATING.md} document for more information.
46
46
 
47
+ ## Debug Logging
48
+
49
+ This library comes with opt-in Debug Logging that can help you troubleshoot
50
+ your application's integration with the API. When logging is activated, key
51
+ events such as requests and responses, along with data payloads and metadata
52
+ such as headers and client configuration, are logged to the standard error
53
+ stream.
54
+
55
+ **WARNING:** Client Library Debug Logging includes your data payloads in
56
+ plaintext, which could include sensitive data such as PII for yourself or your
57
+ customers, private keys, or other security data that could be compromising if
58
+ leaked. Always practice good data hygiene with your application logs, and follow
59
+ the principle of least access. Google also recommends that Client Library Debug
60
+ Logging be enabled only temporarily during active debugging, and not used
61
+ permanently in production.
62
+
63
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
64
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
65
+ list of client library gem names. This will select the default logging behavior,
66
+ which writes logs to the standard error stream. On a local workstation, this may
67
+ result in logs appearing on the console. When running on a Google Cloud hosting
68
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
69
+ results in logs appearing alongside your application logs in the
70
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
71
+
72
+ Debug logging also requires that the versioned clients for this service be
73
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
74
+ working, try updating the versioned clients in your bundle or installed gems:
75
+ [google-cloud-security_center-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1/latest),
76
+ [google-cloud-security_center-v1p1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v1p1beta1/latest),
77
+ [google-cloud-security_center-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-security_center-v2/latest).
78
+
47
79
  ## Supported Ruby Versions
48
80
 
49
- This library is supported on Ruby 2.7+.
81
+ This library is supported on Ruby 3.0+.
50
82
 
51
83
  Google provides official support for Ruby versions that are actively supported
52
84
  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 SecurityCenter
23
- VERSION = "1.7.0"
23
+ VERSION = "1.8.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 SecurityCenter service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::SecurityCenter.security_center_available?}.
65
+ #
61
66
  # ## About SecurityCenter
62
67
  #
63
68
  # V1 APIs for Security Center service.
@@ -79,6 +84,37 @@ module Google
79
84
  service_module.const_get(:Client).new(&block)
80
85
  end
81
86
 
87
+ ##
88
+ # Determines whether the SecurityCenter service is supported by the current client.
89
+ # If true, you can retrieve a client object by calling {Google::Cloud::SecurityCenter.security_center}.
90
+ # If false, that method will raise an exception. This could happen if the given
91
+ # API version does not exist or does not support the SecurityCenter service,
92
+ # or if the versioned client gem needs an update to support the SecurityCenter service.
93
+ #
94
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
95
+ # Defaults to `:v1`.
96
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
97
+ # @return [boolean] Whether the service is available.
98
+ #
99
+ def self.security_center_available? version: :v1, transport: :grpc
100
+ require "google/cloud/security_center/#{version.to_s.downcase}"
101
+ package_name = Google::Cloud::SecurityCenter
102
+ .constants
103
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
104
+ .first
105
+ return false unless package_name
106
+ service_module = Google::Cloud::SecurityCenter.const_get package_name
107
+ return false unless service_module.const_defined? :SecurityCenter
108
+ service_module = service_module.const_get :SecurityCenter
109
+ if transport == :rest
110
+ return false unless service_module.const_defined? :Rest
111
+ service_module = service_module.const_get :Rest
112
+ end
113
+ service_module.const_defined? :Client
114
+ rescue ::LoadError
115
+ false
116
+ end
117
+
82
118
  ##
83
119
  # Configure the google-cloud-security_center library.
84
120
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-security_center
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.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-04-19 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
@@ -103,7 +102,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
103
102
  licenses:
104
103
  - Apache-2.0
105
104
  metadata: {}
106
- post_install_message:
107
105
  rdoc_options: []
108
106
  require_paths:
109
107
  - lib
@@ -111,15 +109,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
109
  requirements:
112
110
  - - ">="
113
111
  - !ruby/object:Gem::Version
114
- version: '2.7'
112
+ version: '3.0'
115
113
  required_rubygems_version: !ruby/object:Gem::Requirement
116
114
  requirements:
117
115
  - - ">="
118
116
  - !ruby/object:Gem::Version
119
117
  version: '0'
120
118
  requirements: []
121
- rubygems_version: 3.5.6
122
- signing_key:
119
+ rubygems_version: 3.6.2
123
120
  specification_version: 4
124
121
  summary: API Client library for the Security Command Center API
125
122
  test_files: []