google-cloud-secret_manager 1.4.0 → 1.5.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: 516f69e5e145115b101c58b9974133cb68803e5092b7fafccbb8de936d50d86d
4
- data.tar.gz: 900f481cd0a9f9cb3430ce7a289d0b4b137a1674a65908d827915358f98317f8
3
+ metadata.gz: f33b1def46e425091b3c0c5e78efb9fdf995e62e4f150aa1c644bb065407bffe
4
+ data.tar.gz: 97e6c555ef143893fcb12d24495b33de470ad4bf6efa59475b0fb395738305d4
5
5
  SHA512:
6
- metadata.gz: 0007c9374a9f2802a7915b9138b24d08502927308818f666115400fc65a86356a2862402403e9a4f34a490f8563cc2be2ae2e7102a00ddfd077d9ae14166180f
7
- data.tar.gz: bfad36529fce423c6e11420a319a8b8a4a72ebadc167f8c16c67482845b41135077181c59634cc48ea66e6513432114700e8c2f4a840512be4d55a164621f9f8
6
+ metadata.gz: 52ab76216a86d424eced127df3048507a1b848c7af0339f60805f0c89d885a24d03019b41dceebecc80aff87da0b2fb25b4080cf84c08efd425a06b49159a41f
7
+ data.tar.gz: 11ab607252bec9c56f89271532e075954fc9820bca1f92b0306d40af0fe552db5cedf6eb8587758b5c4ea549b6cf4ff58d17718b43fa741a72b37bc62ff24ab1
data/README.md CHANGED
@@ -35,35 +35,40 @@ In order to use this library, you first need to go through the following steps:
35
35
  1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com)
36
36
  1. {file:AUTHENTICATION.md Set up authentication.}
37
37
 
38
- ## Enabling Logging
39
-
40
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
41
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
42
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
43
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
44
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
45
-
46
- Configuring a Ruby stdlib logger:
47
-
48
- ```ruby
49
- require "logger"
50
-
51
- module MyLogger
52
- LOGGER = Logger.new $stderr, level: Logger::WARN
53
- def logger
54
- LOGGER
55
- end
56
- end
57
-
58
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
59
- module GRPC
60
- extend MyLogger
61
- end
62
- ```
38
+ ## Debug Logging
39
+
40
+ This library comes with opt-in Debug Logging that can help you troubleshoot
41
+ your application's integration with the API. When logging is activated, key
42
+ events such as requests and responses, along with data payloads and metadata
43
+ such as headers and client configuration, are logged to the standard error
44
+ stream.
45
+
46
+ **WARNING:** Client Library Debug Logging includes your data payloads in
47
+ plaintext, which could include sensitive data such as PII for yourself or your
48
+ customers, private keys, or other security data that could be compromising if
49
+ leaked. Always practice good data hygiene with your application logs, and follow
50
+ the principle of least access. Google also recommends that Client Library Debug
51
+ Logging be enabled only temporarily during active debugging, and not used
52
+ permanently in production.
53
+
54
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
55
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
56
+ list of client library gem names. This will select the default logging behavior,
57
+ which writes logs to the standard error stream. On a local workstation, this may
58
+ result in logs appearing on the console. When running on a Google Cloud hosting
59
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
60
+ results in logs appearing alongside your application logs in the
61
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
62
+
63
+ Debug logging also requires that the versioned clients for this service be
64
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
65
+ working, try updating the versioned clients in your bundle or installed gems:
66
+ [google-cloud-secret_manager-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest),
67
+ [google-cloud-secret_manager-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1beta1/latest).
63
68
 
64
69
  ## Supported Ruby Versions
65
70
 
66
- This library is supported on Ruby 2.7+.
71
+ This library is supported on Ruby 3.0+.
67
72
 
68
73
  Google provides official support for Ruby versions that are actively supported
69
74
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module SecretManager
19
- VERSION = "1.4.0".freeze
19
+ VERSION = "1.5.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -56,6 +56,11 @@ module Google
56
56
  # supported by that API version, and the corresponding gem is available, the
57
57
  # appropriate versioned client will be returned.
58
58
  #
59
+ # Raises an exception if the currently installed versioned client gem for the
60
+ # given API version does not support the SecretManagerService service.
61
+ # You can determine whether the method will succeed by calling
62
+ # {Google::Cloud::SecretManager.secret_manager_service_available?}.
63
+ #
59
64
  # ## About SecretManagerService
60
65
  #
61
66
  # Secret Manager Service
@@ -81,6 +86,32 @@ module Google
81
86
  service_module.const_get(:Client).new(&block)
82
87
  end
83
88
 
89
+ ##
90
+ # Determines whether the SecretManagerService service is supported by the current client.
91
+ # If true, you can retrieve a client object by calling {Google::Cloud::SecretManager.secret_manager_service}.
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 SecretManagerService service,
94
+ # or if the versioned client gem needs an update to support the SecretManagerService service.
95
+ #
96
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
97
+ # Defaults to `:v1`.
98
+ # @return [boolean] Whether the service is available.
99
+ #
100
+ def self.secret_manager_service_available? version: :v1
101
+ require "google/cloud/secret_manager/#{version.to_s.downcase}"
102
+ package_name = Google::Cloud::SecretManager
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::SecretManager.const_get package_name
108
+ return false unless service_module.const_defined? :SecretManagerService
109
+ service_module = service_module.const_get :SecretManagerService
110
+ service_module.const_defined? :Client
111
+ rescue ::LoadError
112
+ false
113
+ end
114
+
84
115
  ##
85
116
  # Configure the google-cloud-secret_manager library.
86
117
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-secret_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.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
@@ -84,7 +83,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
84
83
  licenses:
85
84
  - Apache-2.0
86
85
  metadata: {}
87
- post_install_message:
88
86
  rdoc_options: []
89
87
  require_paths:
90
88
  - lib
@@ -92,15 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
90
  requirements:
93
91
  - - ">="
94
92
  - !ruby/object:Gem::Version
95
- version: '2.7'
93
+ version: '3.0'
96
94
  required_rubygems_version: !ruby/object:Gem::Requirement
97
95
  requirements:
98
96
  - - ">="
99
97
  - !ruby/object:Gem::Version
100
98
  version: '0'
101
99
  requirements: []
102
- rubygems_version: 3.5.6
103
- signing_key:
100
+ rubygems_version: 3.6.2
104
101
  specification_version: 4
105
102
  summary: API Client library for the Secret Manager API
106
103
  test_files: []