google-cloud-kms 2.4.0 → 2.5.1
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 +0 -26
- data/lib/google/cloud/kms/helpers.rb +82 -0
- data/lib/google/cloud/kms/version.rb +1 -1
- data/lib/google/cloud/kms.rb +21 -68
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef316d4321280c6a77e36f0432c1086fa9f0c6475c27c78fa58e6c8f5ebe16b
|
4
|
+
data.tar.gz: 521ba5f6f381987a4e420b4e15a9380e6e9e2e1ad82c6340471011f021456cbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37b17ee4f14592da749d762a857d936be72257362d06a051dc1c0925b5824c061ae1e6039abc418ed752c4f277f0984885b452f4dec27b17c0322c8de4fc01c
|
7
|
+
data.tar.gz: d9d963f112f6e5c34c866caab730d6563d23f8de0bed4888e4484895a16f491090808382a02d550b129db0188b15ab231123a2eecd2d1086d9dc5686734345eb
|
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
@@ -42,32 +42,6 @@ and includes substantial interface changes. Existing code written for earlier
|
|
42
42
|
versions of this library will likely require updates to use this version.
|
43
43
|
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
44
44
|
|
45
|
-
## Enabling Logging
|
46
|
-
|
47
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
48
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
49
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
50
|
-
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)
|
51
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
52
|
-
|
53
|
-
Configuring a Ruby stdlib logger:
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
require "logger"
|
57
|
-
|
58
|
-
module MyLogger
|
59
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
60
|
-
def logger
|
61
|
-
LOGGER
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
66
|
-
module GRPC
|
67
|
-
extend MyLogger
|
68
|
-
end
|
69
|
-
```
|
70
|
-
|
71
45
|
## Supported Ruby Versions
|
72
46
|
|
73
47
|
This library is supported on Ruby 2.6+.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
module Google
|
18
|
+
module Cloud
|
19
|
+
module Kms
|
20
|
+
# This method used to be generated, but is no longer because iam_policy
|
21
|
+
# is expected to be a mixin. We'll preserve it for backward compatibility.
|
22
|
+
# Note: When KMS is transitioned to true mixins, this will need to be
|
23
|
+
# updated.
|
24
|
+
unless respond_to? :iam_policy
|
25
|
+
##
|
26
|
+
# Create a new client object for IAMPolicy.
|
27
|
+
#
|
28
|
+
# By default, this returns an instance of
|
29
|
+
# [Google::Cloud::Kms::V1::IAMPolicy::Client](https://googleapis.dev/ruby/google-cloud-kms-v1/latest/Google/Cloud/Kms/V1/IAMPolicy/Client.html)
|
30
|
+
# for version V1 of the API.
|
31
|
+
# However, you can specify specify a different API version by passing it in the
|
32
|
+
# `version` parameter. If the IAMPolicy service is
|
33
|
+
# supported by that API version, and the corresponding gem is available, the
|
34
|
+
# appropriate versioned client will be returned.
|
35
|
+
#
|
36
|
+
# ## About IAMPolicy
|
37
|
+
#
|
38
|
+
# API Overview
|
39
|
+
#
|
40
|
+
#
|
41
|
+
# Manages Identity and Access Management (IAM) policies.
|
42
|
+
#
|
43
|
+
# Any implementation of an API that offers access control features
|
44
|
+
# implements the google.iam.v1.IAMPolicy interface.
|
45
|
+
#
|
46
|
+
# ## Data model
|
47
|
+
#
|
48
|
+
# Access control is applied when a principal (user or service account), takes
|
49
|
+
# some action on a resource exposed by a service. Resources, identified by
|
50
|
+
# URI-like names, are the unit of access control specification. Service
|
51
|
+
# implementations can choose the granularity of access control and the
|
52
|
+
# supported permissions for their resources.
|
53
|
+
# For example one database service may allow access control to be
|
54
|
+
# specified only at the Table level, whereas another might allow access control
|
55
|
+
# to also be specified at the Column level.
|
56
|
+
#
|
57
|
+
# ## Policy Structure
|
58
|
+
#
|
59
|
+
# See google.iam.v1.Policy
|
60
|
+
#
|
61
|
+
# This is intentionally not a CRUD style API because access control policies
|
62
|
+
# are created and deleted implicitly with the resources to which they are
|
63
|
+
# attached.
|
64
|
+
#
|
65
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
66
|
+
# Defaults to `:v1`.
|
67
|
+
# @return [IAMPolicy::Client] A client object for the specified version.
|
68
|
+
#
|
69
|
+
def self.iam_policy version: :v1, &block
|
70
|
+
require "google/cloud/kms/#{version.to_s.downcase}"
|
71
|
+
|
72
|
+
package_name = Google::Cloud::Kms
|
73
|
+
.constants
|
74
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
75
|
+
.first
|
76
|
+
package_module = Google::Cloud::Kms.const_get package_name
|
77
|
+
package_module.const_get(:IAMPolicy).const_get(:Client).new(&block)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/lib/google/cloud/kms.rb
CHANGED
@@ -49,11 +49,13 @@ module Google
|
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
51
|
# [Google::Cloud::Kms::V1::EkmService::Client](https://googleapis.dev/ruby/google-cloud-kms-v1/latest/Google/Cloud/Kms/V1/EkmService/Client.html)
|
52
|
-
# for version V1 of the API.
|
53
|
-
# However, you can specify
|
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 EkmService 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 EkmService
|
59
61
|
#
|
@@ -65,17 +67,19 @@ module Google
|
|
65
67
|
#
|
66
68
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
67
69
|
# Defaults to `:v1`.
|
68
|
-
# @
|
70
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
71
|
+
# @return [::Object] A client object for the specified version.
|
69
72
|
#
|
70
|
-
def self.ekm_service version: :v1, &block
|
73
|
+
def self.ekm_service version: :v1, transport: :grpc, &block
|
71
74
|
require "google/cloud/kms/#{version.to_s.downcase}"
|
72
75
|
|
73
76
|
package_name = Google::Cloud::Kms
|
74
77
|
.constants
|
75
78
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
76
79
|
.first
|
77
|
-
|
78
|
-
|
80
|
+
service_module = Google::Cloud::Kms.const_get(package_name).const_get(:EkmService)
|
81
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
82
|
+
service_module.const_get(:Client).new(&block)
|
79
83
|
end
|
80
84
|
|
81
85
|
##
|
@@ -83,11 +87,13 @@ module Google
|
|
83
87
|
#
|
84
88
|
# By default, this returns an instance of
|
85
89
|
# [Google::Cloud::Kms::V1::KeyManagementService::Client](https://googleapis.dev/ruby/google-cloud-kms-v1/latest/Google/Cloud/Kms/V1/KeyManagementService/Client.html)
|
86
|
-
# for version V1 of the API.
|
87
|
-
# However, you can specify
|
90
|
+
# for a gRPC client for version V1 of the API.
|
91
|
+
# However, you can specify a different API version by passing it in the
|
88
92
|
# `version` parameter. If the KeyManagementService service is
|
89
93
|
# supported by that API version, and the corresponding gem is available, the
|
90
94
|
# appropriate versioned client will be returned.
|
95
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
96
|
+
# the `transport` parameter.
|
91
97
|
#
|
92
98
|
# ## About KeyManagementService
|
93
99
|
#
|
@@ -106,72 +112,19 @@ module Google
|
|
106
112
|
#
|
107
113
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
108
114
|
# Defaults to `:v1`.
|
109
|
-
# @
|
115
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
116
|
+
# @return [::Object] A client object for the specified version.
|
110
117
|
#
|
111
|
-
def self.key_management_service version: :v1, &block
|
118
|
+
def self.key_management_service version: :v1, transport: :grpc, &block
|
112
119
|
require "google/cloud/kms/#{version.to_s.downcase}"
|
113
120
|
|
114
121
|
package_name = Google::Cloud::Kms
|
115
122
|
.constants
|
116
123
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
117
124
|
.first
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
##
|
123
|
-
# Create a new client object for IAMPolicy.
|
124
|
-
#
|
125
|
-
# By default, this returns an instance of
|
126
|
-
# [Google::Cloud::Kms::V1::IAMPolicy::Client](https://googleapis.dev/ruby/google-cloud-kms-v1/latest/Google/Cloud/Kms/V1/IAMPolicy/Client.html)
|
127
|
-
# for version V1 of the API.
|
128
|
-
# However, you can specify specify a different API version by passing it in the
|
129
|
-
# `version` parameter. If the IAMPolicy service is
|
130
|
-
# supported by that API version, and the corresponding gem is available, the
|
131
|
-
# appropriate versioned client will be returned.
|
132
|
-
#
|
133
|
-
# ## About IAMPolicy
|
134
|
-
#
|
135
|
-
# API Overview
|
136
|
-
#
|
137
|
-
#
|
138
|
-
# Manages Identity and Access Management (IAM) policies.
|
139
|
-
#
|
140
|
-
# Any implementation of an API that offers access control features
|
141
|
-
# implements the google.iam.v1.IAMPolicy interface.
|
142
|
-
#
|
143
|
-
# ## Data model
|
144
|
-
#
|
145
|
-
# Access control is applied when a principal (user or service account), takes
|
146
|
-
# some action on a resource exposed by a service. Resources, identified by
|
147
|
-
# URI-like names, are the unit of access control specification. Service
|
148
|
-
# implementations can choose the granularity of access control and the
|
149
|
-
# supported permissions for their resources.
|
150
|
-
# For example one database service may allow access control to be
|
151
|
-
# specified only at the Table level, whereas another might allow access control
|
152
|
-
# to also be specified at the Column level.
|
153
|
-
#
|
154
|
-
# ## Policy Structure
|
155
|
-
#
|
156
|
-
# See google.iam.v1.Policy
|
157
|
-
#
|
158
|
-
# This is intentionally not a CRUD style API because access control policies
|
159
|
-
# are created and deleted implicitly with the resources to which they are
|
160
|
-
# attached.
|
161
|
-
#
|
162
|
-
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
163
|
-
# Defaults to `:v1`.
|
164
|
-
# @return [IAMPolicy::Client] A client object for the specified version.
|
165
|
-
#
|
166
|
-
def self.iam_policy version: :v1, &block
|
167
|
-
require "google/cloud/kms/#{version.to_s.downcase}"
|
168
|
-
|
169
|
-
package_name = Google::Cloud::Kms
|
170
|
-
.constants
|
171
|
-
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
172
|
-
.first
|
173
|
-
package_module = Google::Cloud::Kms.const_get package_name
|
174
|
-
package_module.const_get(:IAMPolicy).const_get(:Client).new(&block)
|
125
|
+
service_module = Google::Cloud::Kms.const_get(package_name).const_get(:KeyManagementService)
|
126
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
127
|
+
service_module.const_get(:Client).new(&block)
|
175
128
|
end
|
176
129
|
|
177
130
|
##
|
@@ -191,7 +144,7 @@ module Google
|
|
191
144
|
# * `timeout` (*type:* `Numeric`) -
|
192
145
|
# Default timeout in seconds.
|
193
146
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
194
|
-
# Additional
|
147
|
+
# Additional headers to be sent with the call.
|
195
148
|
# * `retry_policy` (*type:* `Hash`) -
|
196
149
|
# The retry policy. The value is a hash with the following keys:
|
197
150
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-kms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.1
|
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-02-21 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.17'
|
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.17'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.a
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- README.md
|
171
171
|
- lib/google-cloud-kms.rb
|
172
172
|
- lib/google/cloud/kms.rb
|
173
|
+
- lib/google/cloud/kms/helpers.rb
|
173
174
|
- lib/google/cloud/kms/version.rb
|
174
175
|
homepage: https://github.com/googleapis/google-cloud-ruby
|
175
176
|
licenses:
|
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
191
|
- !ruby/object:Gem::Version
|
191
192
|
version: '0'
|
192
193
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
194
|
+
rubygems_version: 3.4.2
|
194
195
|
signing_key:
|
195
196
|
specification_version: 4
|
196
197
|
summary: API Client library for the Cloud Key Management Service (KMS) API
|