google-iam-client 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -26
- data/lib/google/iam/client/version.rb +1 -1
- data/lib/google/iam.rb +10 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63137d82784607be97074152a35a2a0e1dd5096a76bec9dd59cd8255a9e0d0ad
|
4
|
+
data.tar.gz: ad441d920138c9ecaa4ebfa8fb85b270b062fc19d6e9d6460a0c0bcd518434db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d15ff8a844f17bf8a06a08b159623d42b30c8a3d671b2ce4bb604d09ab1bbef7157878abb06a99566c3304dfa599910500e29debdb40a31f5a473d0caf47f64
|
7
|
+
data.tar.gz: 7a115842152a71c4a74cdf86b03a7cb5c6a0693f2b4e2f7dff4b663f57489d0ede1f04d3fb9043deda2e620dbfbc6ad22e3b05f4a34fcb1c58bf8dc3ee3dcfa1
|
data/README.md
CHANGED
@@ -34,32 +34,6 @@ 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
|
-
## 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
37
|
## Supported Ruby Versions
|
64
38
|
|
65
39
|
This library is supported on Ruby 2.6+.
|
data/lib/google/iam.rb
CHANGED
@@ -31,11 +31,13 @@ module Google
|
|
31
31
|
#
|
32
32
|
# By default, this returns an instance of
|
33
33
|
# [Google::Iam::V2::Policies::Client](https://googleapis.dev/ruby/google-iam-v2/latest/Google/Iam/V2/Policies/Client.html)
|
34
|
-
# for version V2 of the API.
|
35
|
-
# However, you can specify
|
34
|
+
# for a gRPC client for version V2 of the API.
|
35
|
+
# However, you can specify a different API version by passing it in the
|
36
36
|
# `version` parameter. If the Policies service is
|
37
37
|
# supported by that API version, and the corresponding gem is available, the
|
38
38
|
# appropriate versioned client will be returned.
|
39
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
40
|
+
# the `transport` parameter.
|
39
41
|
#
|
40
42
|
# ## About Policies
|
41
43
|
#
|
@@ -43,17 +45,19 @@ module Google
|
|
43
45
|
#
|
44
46
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
45
47
|
# Defaults to `:v2`.
|
46
|
-
# @
|
48
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
49
|
+
# @return [::Object] A client object for the specified version.
|
47
50
|
#
|
48
|
-
def self.policies version: :v2, &block
|
51
|
+
def self.policies version: :v2, transport: :grpc, &block
|
49
52
|
require "google/iam/#{version.to_s.downcase}"
|
50
53
|
|
51
54
|
package_name = Google::Iam
|
52
55
|
.constants
|
53
56
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
54
57
|
.first
|
55
|
-
|
56
|
-
|
58
|
+
service_module = Google::Iam.const_get(package_name).const_get(:Policies)
|
59
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
60
|
+
service_module.const_get(:Client).new(&block)
|
57
61
|
end
|
58
62
|
end
|
59
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-iam-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.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-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.2'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 2.a
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
43
|
+
version: '0.2'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.a
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
192
|
+
rubygems_version: 3.4.2
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: API Client library for the IAM API
|