google-cloud-policy_troubleshooter 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -27
- data/lib/google/cloud/policy_troubleshooter/iam/version.rb +29 -0
- data/lib/google/cloud/policy_troubleshooter/iam.rb +123 -0
- data/lib/google/cloud/policy_troubleshooter/version.rb +1 -1
- data/lib/google/cloud/policy_troubleshooter.rb +12 -8
- data/lib/google-cloud-policy_troubleshooter.rb +1 -0
- metadata +25 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1f9e8d47e8972a44e97c97fda408d1ae8cf98eecc4d39065edf96e28966b75e
|
4
|
+
data.tar.gz: 678d52c1225ae96509f7a41b14da0bbee7ec9dde01bb71d65eafb635c7250a03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d9a4bf1514df8f418441c3ad9b51c79635b4f3a8816944b30a4af6df2a2d17944b4ce3bcae837c34282e98730485f476f9eac8ab98325cefbc33d27baf2bd4c
|
7
|
+
data.tar.gz: 1abe204d0450458847cd9c04f938b81d77c99bc07b8cf44176ca6e407ed95b09d2640df9578d58728a986345cddf7bec2e865c599bada82b24d23f423cc4d504
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -16,7 +16,8 @@ for this library, google-cloud-policy_troubleshooter, to see the convenience met
|
|
16
16
|
constructing client objects. Reference documentation for the client objects
|
17
17
|
themselves can be found in the client library documentation for the versioned
|
18
18
|
client gems:
|
19
|
-
[google-cloud-policy_troubleshooter-v1](https://
|
19
|
+
[google-cloud-policy_troubleshooter-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest),
|
20
|
+
[google-cloud-policy_troubleshooter-iam-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest).
|
20
21
|
|
21
22
|
See also the [Product Documentation](https://cloud.google.com/iam/docs/troubleshooting-access)
|
22
23
|
for more usage information.
|
@@ -34,32 +35,6 @@ In order to use this library, you first need to go through the following steps:
|
|
34
35
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/policytroubleshooter.googleapis.com)
|
35
36
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
37
|
|
37
|
-
## Enabling Logging
|
38
|
-
|
39
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
40
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
41
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
42
|
-
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)
|
43
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
44
|
-
|
45
|
-
Configuring a Ruby stdlib logger:
|
46
|
-
|
47
|
-
```ruby
|
48
|
-
require "logger"
|
49
|
-
|
50
|
-
module MyLogger
|
51
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
52
|
-
def logger
|
53
|
-
LOGGER
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
58
|
-
module GRPC
|
59
|
-
extend MyLogger
|
60
|
-
end
|
61
|
-
```
|
62
|
-
|
63
38
|
## Supported Ruby Versions
|
64
39
|
|
65
40
|
This library is supported on Ruby 2.6+.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module PolicyTroubleshooter
|
23
|
+
module Iam
|
24
|
+
# @private Unused
|
25
|
+
VERSION = ""
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
# Require this file early so that the version constant gets defined before
|
20
|
+
# requiring "google/cloud". This is because google-cloud-core will load the
|
21
|
+
# entrypoint (gem name) file, which in turn re-requires this file (hence
|
22
|
+
# causing a require cycle) unless the version constant is already defined.
|
23
|
+
require "google/cloud/policy_troubleshooter/iam/version"
|
24
|
+
|
25
|
+
require "googleauth"
|
26
|
+
gem "google-cloud-core"
|
27
|
+
require "google/cloud" unless defined? ::Google::Cloud.new
|
28
|
+
require "google/cloud/config"
|
29
|
+
|
30
|
+
# Set the default configuration
|
31
|
+
::Google::Cloud.configure.add_config! :policy_troubleshooter_iam do |config|
|
32
|
+
config.add_field! :endpoint, "policytroubleshooter.googleapis.com", match: ::String
|
33
|
+
config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
|
34
|
+
config.add_field! :scope, nil, match: [::Array, ::String]
|
35
|
+
config.add_field! :lib_name, nil, match: ::String
|
36
|
+
config.add_field! :lib_version, nil, match: ::String
|
37
|
+
config.add_field! :interceptors, nil, match: ::Array
|
38
|
+
config.add_field! :timeout, nil, match: ::Numeric
|
39
|
+
config.add_field! :metadata, nil, match: ::Hash
|
40
|
+
config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
|
41
|
+
config.add_field! :quota_project, nil, match: ::String
|
42
|
+
end
|
43
|
+
|
44
|
+
module Google
|
45
|
+
module Cloud
|
46
|
+
module PolicyTroubleshooter
|
47
|
+
module Iam
|
48
|
+
##
|
49
|
+
# Create a new client object for PolicyTroubleshooter.
|
50
|
+
#
|
51
|
+
# By default, this returns an instance of
|
52
|
+
# [Google::Cloud::PolicyTroubleshooter::Iam::V3::PolicyTroubleshooter::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-iam-v3/latest/Google-Cloud-PolicyTroubleshooter-Iam-V3-PolicyTroubleshooter-Client)
|
53
|
+
# for a gRPC client for version V3 of the API.
|
54
|
+
# However, you can specify a different API version by passing it in the
|
55
|
+
# `version` parameter. If the PolicyTroubleshooter service is
|
56
|
+
# supported by that API version, and the corresponding gem is available, the
|
57
|
+
# appropriate versioned client will be returned.
|
58
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
|
+
# the `transport` parameter.
|
60
|
+
#
|
61
|
+
# ## About PolicyTroubleshooter
|
62
|
+
#
|
63
|
+
# IAM Policy Troubleshooter service.
|
64
|
+
#
|
65
|
+
# This service helps you troubleshoot access issues for Google Cloud resources.
|
66
|
+
#
|
67
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
68
|
+
# Defaults to `:v3`.
|
69
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
70
|
+
# @return [::Object] A client object for the specified version.
|
71
|
+
#
|
72
|
+
def self.policy_troubleshooter version: :v3, transport: :grpc, &block
|
73
|
+
require "google/cloud/policy_troubleshooter/iam/#{version.to_s.downcase}"
|
74
|
+
|
75
|
+
package_name = Google::Cloud::PolicyTroubleshooter::Iam
|
76
|
+
.constants
|
77
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
78
|
+
.first
|
79
|
+
service_module = Google::Cloud::PolicyTroubleshooter::Iam.const_get(package_name).const_get(:PolicyTroubleshooter)
|
80
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
81
|
+
service_module.const_get(:Client).new(&block)
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Configure the google-cloud-policy_troubleshooter-iam library.
|
86
|
+
#
|
87
|
+
# The following configuration parameters are supported:
|
88
|
+
#
|
89
|
+
# * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
|
90
|
+
# The path to the keyfile as a String, the contents of the keyfile as a
|
91
|
+
# Hash, or a Google::Auth::Credentials object.
|
92
|
+
# * `lib_name` (*type:* `String`) -
|
93
|
+
# The library name as recorded in instrumentation and logging.
|
94
|
+
# * `lib_version` (*type:* `String`) -
|
95
|
+
# The library version as recorded in instrumentation and logging.
|
96
|
+
# * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
|
97
|
+
# An array of interceptors that are run before calls are executed.
|
98
|
+
# * `timeout` (*type:* `Numeric`) -
|
99
|
+
# Default timeout in seconds.
|
100
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
101
|
+
# Additional headers to be sent with the call.
|
102
|
+
# * `retry_policy` (*type:* `Hash`) -
|
103
|
+
# The retry policy. The value is a hash with the following keys:
|
104
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
105
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
106
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
107
|
+
# * `:retry_codes` (*type:* `Array<String>`) -
|
108
|
+
# The error codes that should trigger a retry.
|
109
|
+
#
|
110
|
+
# @return [::Google::Cloud::Config] The default configuration used by this library
|
111
|
+
#
|
112
|
+
def self.configure
|
113
|
+
yield ::Google::Cloud.configure.policy_troubleshooter_iam if block_given?
|
114
|
+
|
115
|
+
::Google::Cloud.configure.policy_troubleshooter_iam
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
helper_path = ::File.join __dir__, "iam", "helpers.rb"
|
123
|
+
require "google/cloud/policy_troubleshooter/iam/helpers" if ::File.file? helper_path
|
@@ -48,12 +48,14 @@ module Google
|
|
48
48
|
# Create a new client object for IamChecker.
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
|
-
# [Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client](https://
|
52
|
-
# for version V1 of the API.
|
53
|
-
# However, you can specify
|
51
|
+
# [Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-policy_troubleshooter-v1/latest/Google-Cloud-PolicyTroubleshooter-V1-IamChecker-Client)
|
52
|
+
# for a gRPC client for version V1 of the API.
|
53
|
+
# However, you can specify a different API version by passing it in the
|
54
54
|
# `version` parameter. If the IamChecker service is
|
55
55
|
# supported by that API version, and the corresponding gem is available, the
|
56
56
|
# appropriate versioned client will be returned.
|
57
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
58
|
+
# the `transport` parameter.
|
57
59
|
#
|
58
60
|
# ## About IamChecker
|
59
61
|
#
|
@@ -63,17 +65,19 @@ module Google
|
|
63
65
|
#
|
64
66
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
65
67
|
# Defaults to `:v1`.
|
66
|
-
# @
|
68
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
69
|
+
# @return [::Object] A client object for the specified version.
|
67
70
|
#
|
68
|
-
def self.iam_checker version: :v1, &block
|
71
|
+
def self.iam_checker version: :v1, transport: :grpc, &block
|
69
72
|
require "google/cloud/policy_troubleshooter/#{version.to_s.downcase}"
|
70
73
|
|
71
74
|
package_name = Google::Cloud::PolicyTroubleshooter
|
72
75
|
.constants
|
73
76
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
74
77
|
.first
|
75
|
-
|
76
|
-
|
78
|
+
service_module = Google::Cloud::PolicyTroubleshooter.const_get(package_name).const_get(:IamChecker)
|
79
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
80
|
+
service_module.const_get(:Client).new(&block)
|
77
81
|
end
|
78
82
|
|
79
83
|
##
|
@@ -93,7 +97,7 @@ module Google
|
|
93
97
|
# * `timeout` (*type:* `Numeric`) -
|
94
98
|
# Default timeout in seconds.
|
95
99
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
96
|
-
# Additional
|
100
|
+
# Additional headers to be sent with the call.
|
97
101
|
# * `retry_policy` (*type:* `Hash`) -
|
98
102
|
# The retry policy. The value is a hash with the following keys:
|
99
103
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
@@ -17,3 +17,4 @@
|
|
17
17
|
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
18
|
|
19
19
|
require "google/cloud/policy_troubleshooter" unless defined? Google::Cloud::PolicyTroubleshooter::VERSION
|
20
|
+
require "google/cloud/policy_troubleshooter/iam" unless defined? Google::Cloud::PolicyTroubleshooter::Iam::VERSION
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-policy_troubleshooter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -26,6 +26,26 @@ dependencies:
|
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: google-cloud-policy_troubleshooter-v1
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.6'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.a
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.6'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.a
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: google-cloud-policy_troubleshooter-iam-v3
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
30
50
|
requirements:
|
31
51
|
- - ">="
|
@@ -172,6 +192,8 @@ files:
|
|
172
192
|
- README.md
|
173
193
|
- lib/google-cloud-policy_troubleshooter.rb
|
174
194
|
- lib/google/cloud/policy_troubleshooter.rb
|
195
|
+
- lib/google/cloud/policy_troubleshooter/iam.rb
|
196
|
+
- lib/google/cloud/policy_troubleshooter/iam/version.rb
|
175
197
|
- lib/google/cloud/policy_troubleshooter/version.rb
|
176
198
|
homepage: https://github.com/googleapis/google-cloud-ruby
|
177
199
|
licenses:
|
@@ -192,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
214
|
- !ruby/object:Gem::Version
|
193
215
|
version: '0'
|
194
216
|
requirements: []
|
195
|
-
rubygems_version: 3.
|
217
|
+
rubygems_version: 3.4.19
|
196
218
|
signing_key:
|
197
219
|
specification_version: 4
|
198
220
|
summary: API Client library for the IAM Policy Troubleshooter API
|