google-iam-credentials 1.4.1 → 1.5.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: 49e7bd4d91cd9584271ea5e4baa256216d00be74791c4af9f1524838c1a1a19a
4
- data.tar.gz: 7f5110a17e914de42e7e151c8329e61d3295a6c3a1dcf12bef5c12e522e730ca
3
+ metadata.gz: af76790edf0558d8ec7bbad76ec9e66e70a1e49c7228639f2574957684a5c1cb
4
+ data.tar.gz: f1d3984a0d817cba1922dde2c47bb92ccea2fa1ccbf834db434b65132be44c51
5
5
  SHA512:
6
- metadata.gz: fc45a5257e66fa96cb1e74ebc48fb45ccbf06aa074c82960f4e659c6962235b04cd9926bcd40f452ee7b62a41d01b229da3a2d8b30306fafd81d3295392f7765
7
- data.tar.gz: 19042b40a8e44a8ab2850eaac8ec466c614478c5a2bb5ab4e833862e64d0850bf32f4b0b5b5bc208d4bb42bfcdd37a53c2a02e6ff72efea4919818d0c71fabdd
6
+ metadata.gz: c087ef8d4d28b4575f94a1ed53ab70370abab14522e63ea3dc2a203c90e570375cf74658b9ab43491f4f7e70282b8c966fe3035107ed9cb8f05cedc883443358
7
+ data.tar.gz: e5715bef42da857f7e1a70f7a9cb9a5661dbc72d82d88d5debba0aee8b6604628a50e09d0bfbeca0e84a186a9b631175e22f01cb1c7bdc202547842184b3e336
data/README.md CHANGED
@@ -7,7 +7,7 @@ The Service Account Credentials API creates short-lived credentials for Identity
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-iam-credentials-v*`.
9
9
  The gem `google-iam-credentials` 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
 
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
34
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/iamcredentials.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
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-iam-credentials-v1](https://cloud.google.com/ruby/docs/reference/google-iam-credentials-v1/latest).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
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 Iam
22
22
  module Credentials
23
- VERSION = "1.4.1"
23
+ VERSION = "1.5.1"
24
24
  end
25
25
  end
26
26
  end
@@ -40,6 +40,11 @@ module Google
40
40
  # You can also specify a different transport by passing `:rest` or `:grpc` in
41
41
  # the `transport` parameter.
42
42
  #
43
+ # Raises an exception if the currently installed versioned client gem for the
44
+ # given API version does not support the given transport of the IAMCredentials service.
45
+ # You can determine whether the method will succeed by calling
46
+ # {Google::Iam::Credentials.iam_credentials_available?}.
47
+ #
43
48
  # ## About IAMCredentials
44
49
  #
45
50
  # A service account is a special type of Google account that belongs to your
@@ -68,6 +73,37 @@ module Google
68
73
  service_module = service_module.const_get(:Rest) if transport == :rest
69
74
  service_module.const_get(:Client).new(&block)
70
75
  end
76
+
77
+ ##
78
+ # Determines whether the IAMCredentials service is supported by the current client.
79
+ # If true, you can retrieve a client object by calling {Google::Iam::Credentials.iam_credentials}.
80
+ # If false, that method will raise an exception. This could happen if the given
81
+ # API version does not exist or does not support the IAMCredentials service,
82
+ # or if the versioned client gem needs an update to support the IAMCredentials service.
83
+ #
84
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
85
+ # Defaults to `:v1`.
86
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
87
+ # @return [boolean] Whether the service is available.
88
+ #
89
+ def self.iam_credentials_available? version: :v1, transport: :grpc
90
+ require "google/iam/credentials/#{version.to_s.downcase}"
91
+ package_name = Google::Iam::Credentials
92
+ .constants
93
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
94
+ .first
95
+ return false unless package_name
96
+ service_module = Google::Iam::Credentials.const_get package_name
97
+ return false unless service_module.const_defined? :IAMCredentials
98
+ service_module = service_module.const_get :IAMCredentials
99
+ if transport == :rest
100
+ return false unless service_module.const_defined? :Rest
101
+ service_module = service_module.const_get :Rest
102
+ end
103
+ service_module.const_defined? :Client
104
+ rescue ::LoadError
105
+ false
106
+ end
71
107
  end
72
108
  end
73
109
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-iam-credentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.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-08-12 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
@@ -64,7 +63,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
64
63
  licenses:
65
64
  - Apache-2.0
66
65
  metadata: {}
67
- post_install_message:
68
66
  rdoc_options: []
69
67
  require_paths:
70
68
  - lib
@@ -72,15 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
70
  requirements:
73
71
  - - ">="
74
72
  - !ruby/object:Gem::Version
75
- version: '2.7'
73
+ version: '3.0'
76
74
  required_rubygems_version: !ruby/object:Gem::Requirement
77
75
  requirements:
78
76
  - - ">="
79
77
  - !ruby/object:Gem::Version
80
78
  version: '0'
81
79
  requirements: []
82
- rubygems_version: 3.5.6
83
- signing_key:
80
+ rubygems_version: 3.6.8
84
81
  specification_version: 4
85
82
  summary: API Client library for the IAM Service Account Credentials API
86
83
  test_files: []