google-iam-client 1.0.1 → 1.1.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: d5f40bbc5fd1ca833227a43c5a48e93c3a815c5154053f0f099456cc4237afe6
4
- data.tar.gz: 630f3a6c54dc8ad1869329a4293586558887e40fdadc9252ab50a38378c9c105
3
+ metadata.gz: 1e52390b84c48739b03d906b7b3eba7d1dcf49b0387d0874dbcbb9da986c12b8
4
+ data.tar.gz: c3345ff42053d01cb671fca3d4b804ddffcf18a4e59b1e0bada8268a7557aa76
5
5
  SHA512:
6
- metadata.gz: 34b62ce5ae297b35dc7c83c19854c97838480ee63e3cd2ed0e0de73f9d26ed1e6c70066cabfb02fae15480b8a5d5cc600dcbb32276deae2c29982e467a5cdcda
7
- data.tar.gz: 7209fa594519be57bcdc6a8a4553f2efc6a7755f607e5b0077a31279c1add513bc0020047b535881b1c279b8e871d80540e16503f21c0a8a743f3aa77518635b
6
+ metadata.gz: 4f869af470beb3f60a582221a8ac47e4ec2cf803230d587e3794dd503f886b84a6741c10088e031dc3a8daa76b855d454fafb7c320f3234e777543f24ee0aa32
7
+ data.tar.gz: b85316100b6ebb62213bce090f97067d1534bf3d76e806673c5d5bf12ba7b1343e960784d329ca4ad6aa0705a0c70dbedf8fb4bd8cfa1bc1345b5c2860288799
data/README.md CHANGED
@@ -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/iam.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-v2](https://rubydoc.info/gems/google-iam-v2).
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
@@ -18,7 +18,7 @@
18
18
  module Google
19
19
  module Iam
20
20
  module Client
21
- VERSION = "1.0.1"
21
+ VERSION = "1.1.0"
22
22
  end
23
23
  end
24
24
  end
data/lib/google/iam.rb CHANGED
@@ -39,6 +39,11 @@ module Google
39
39
  # You can also specify a different transport by passing `:rest` or `:grpc` in
40
40
  # the `transport` parameter.
41
41
  #
42
+ # Raises an exception if the currently installed versioned client gem for the
43
+ # given API version does not support the given transport of the Policies service.
44
+ # You can determine whether the method will succeed by calling
45
+ # {Google::Iam.policies_available?}.
46
+ #
42
47
  # ## About Policies
43
48
  #
44
49
  # An interface for managing Identity and Access Management (IAM) policies.
@@ -59,6 +64,37 @@ module Google
59
64
  service_module = service_module.const_get(:Rest) if transport == :rest
60
65
  service_module.const_get(:Client).new(&block)
61
66
  end
67
+
68
+ ##
69
+ # Determines whether the Policies service is supported by the current client.
70
+ # If true, you can retrieve a client object by calling {Google::Iam.policies}.
71
+ # If false, that method will raise an exception. This could happen if the given
72
+ # API version does not exist or does not support the Policies service,
73
+ # or if the versioned client gem needs an update to support the Policies service.
74
+ #
75
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
76
+ # Defaults to `:v2`.
77
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
78
+ # @return [boolean] Whether the service is available.
79
+ #
80
+ def self.policies_available? version: :v2, transport: :grpc
81
+ require "google/iam/#{version.to_s.downcase}"
82
+ package_name = Google::Iam
83
+ .constants
84
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
85
+ .first
86
+ return false unless package_name
87
+ service_module = Google::Iam.const_get package_name
88
+ return false unless service_module.const_defined? :Policies
89
+ service_module = service_module.const_get :Policies
90
+ if transport == :rest
91
+ return false unless service_module.const_defined? :Rest
92
+ service_module = service_module.const_get :Rest
93
+ end
94
+ service_module.const_defined? :Client
95
+ rescue ::LoadError
96
+ false
97
+ end
62
98
  end
63
99
  end
64
100
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-iam-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.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-08-12 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
@@ -62,7 +61,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
62
61
  licenses:
63
62
  - Apache-2.0
64
63
  metadata: {}
65
- post_install_message:
66
64
  rdoc_options: []
67
65
  require_paths:
68
66
  - lib
@@ -70,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
68
  requirements:
71
69
  - - ">="
72
70
  - !ruby/object:Gem::Version
73
- version: '2.7'
71
+ version: '3.0'
74
72
  required_rubygems_version: !ruby/object:Gem::Requirement
75
73
  requirements:
76
74
  - - ">="
77
75
  - !ruby/object:Gem::Version
78
76
  version: '0'
79
77
  requirements: []
80
- rubygems_version: 3.5.6
81
- signing_key:
78
+ rubygems_version: 3.6.2
82
79
  specification_version: 4
83
80
  summary: API Client library for the IAM API
84
81
  test_files: []