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