google-cloud-dlp 1.7.0 → 1.8.1

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: 1e563e857b474240e8d24421b375a2a23077f9cf864e6408981cffed6926130d
4
- data.tar.gz: 149346c7627a35716a0a04764f26c4d2a14ed9383249eed4b530c6995a4d6db7
3
+ metadata.gz: ea38b33ede29659262e7dfd76fb91195a603b707f50b45c6684fac5405be21cf
4
+ data.tar.gz: e90156b4ea41f6af7e21ed635902f9b267666beb5f8483081fd5dfc7ab217e3c
5
5
  SHA512:
6
- metadata.gz: 29f5ef020146f06c4d498799a39f30c2d1f5fbab862cccd8bc091d58e50b9487fca6a118895812305b78db346f73fea15625697d6234f00f32b17a08c9623858
7
- data.tar.gz: 8453bca16cd8bbf457e7707000af0f3103bd01f6e3602c6b07352a5fdc503ac23afe5dba926e8e2a64abf290ad5fb3cbbdb1e0dbd3cb3a604db49efc0a6eb0d1
6
+ metadata.gz: 80863bac21c3d1c2e34cce82d39605e06d4866dcb0f26b5eaa6d7e07ef740b483e04f09c7d4776e06f317ebe8817dbfbe03a58febfad8c7a8878aff0e31d81bb
7
+ data.tar.gz: 7ff7a03c8ec850f6097f4cd1434d546d53facbb2a41d7364f24dc91aa13c4e288586e513ba0ec413a612d60fba171f7d3d9a02cb97e69e1220908e0eb67ca25b
data/README.md CHANGED
@@ -7,7 +7,7 @@ Provides methods for detection of privacy-sensitive fragments in text, images, a
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-cloud-dlp-v*`.
9
9
  The gem `google-cloud-dlp` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -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.1"
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.1
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: 1980-01-02 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.8
83
80
  specification_version: 4
84
81
  summary: API Client library for the Cloud Data Loss Prevention (DLP) API
85
82
  test_files: []