google-cloud-kms 1.0.0 → 1.0.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: 91e18b340eb2c241dc87e554d0bbf7864f36dbce382fd523d8030823d23090cf
4
- data.tar.gz: a41d0f6437e9569bdcc767da7963980719b239e3b8028e5f3f20f09e769133c0
3
+ metadata.gz: 544cd2b12b79c301f7f29fbcf3404acad0406a6a481d8b03e43ba9934ae0d4da
4
+ data.tar.gz: 9e3de94a11b8cd9efab13da5ac9e17e9a3d81cd321889d46a853a231eb3f2316
5
5
  SHA512:
6
- metadata.gz: c36f619de556ad2bf18cbeeedc8a27769cba04d44d57a1819ae6a7f26dc1b508e6015fc6e879ce3f0d965d1a64659875c6f67bdf10ae856efa8c21b76034fd65
7
- data.tar.gz: f57cde3b29bc990751f05e03a3e04d6175f5e3871d8e9891eae49d1c51d2f7d123f59573493c128d6ac62881191b2424846d227d2717842ca5fa4e50ff8cf5dc
6
+ metadata.gz: d1645492e51e5c04fedfd16425a8486c4594100cf85647d9627b3ad0714cffb895239f5c7bf17a512b66e90b2956d86f73fcacb0e7d72282e78f3839ff28f151
7
+ data.tar.gz: 1183b3a561d17e475fa9ca3e2786791e19f7c625754e51c6a1a6ed14238e3abeca7a208cd2a1100052acb8c5a8dc0840a650cde8e76bf06f8975c530de2dcf49
data/.yardopts CHANGED
@@ -7,3 +7,5 @@
7
7
  ./lib/**/*.rb
8
8
  -
9
9
  README.md
10
+ AUTHENTICATION.md
11
+ LICENSE
data/AUTHENTICATION.md ADDED
@@ -0,0 +1,199 @@
1
+ # Authentication
2
+
3
+ In general, the google-cloud-kms library uses [Service
4
+ Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
5
+ credentials to connect to Google Cloud services. When running within [Google
6
+ Cloud Platform environments](#google-cloud-platform-environments)
7
+ the credentials will be discovered automatically. When running on other
8
+ environments, the Service Account credentials can be specified by providing the
9
+ path to the [JSON
10
+ keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for
11
+ the account (or the JSON itself) in [environment
12
+ variables](#environment-variables). Additionally, Cloud SDK credentials can also
13
+ be discovered automatically, but this is only recommended during development.
14
+
15
+ ## Quickstart
16
+
17
+ 1. [Create a service account and credentials](#creating-a-service-account).
18
+ 2. Set the [environment variable](#environment-variables).
19
+
20
+ ```sh
21
+ export KMS_CREDENTIALS=/path/to/json`
22
+ ```
23
+
24
+ 3. Initialize the client.
25
+
26
+ ```ruby
27
+ require "google/cloud/kms"
28
+
29
+ client = Google::Cloud::Kms.new
30
+ ```
31
+
32
+ ## Project and Credential Lookup
33
+
34
+ The google-cloud-kms library aims to make authentication
35
+ as simple as possible, and provides several mechanisms to configure your system
36
+ without providing **Project ID** and **Service Account Credentials** directly in
37
+ code.
38
+
39
+ **Project ID** is discovered in the following order:
40
+
41
+ 1. Specify project ID in method arguments
42
+ 2. Specify project ID in configuration
43
+ 3. Discover project ID in environment variables
44
+ 4. Discover GCE project ID
45
+ 5. Discover project ID in credentials JSON
46
+
47
+ **Credentials** are discovered in the following order:
48
+
49
+ 1. Specify credentials in method arguments
50
+ 2. Specify credentials in configuration
51
+ 3. Discover credentials path in environment variables
52
+ 4. Discover credentials JSON in environment variables
53
+ 5. Discover credentials file in the Cloud SDK's path
54
+ 6. Discover GCE credentials
55
+
56
+ ### Google Cloud Platform environments
57
+
58
+ While running on Google Cloud Platform environments such as Google Compute
59
+ Engine, Google App Engine and Google Kubernetes Engine, no extra work is needed.
60
+ The **Project ID** and **Credentials** and are discovered automatically. Code
61
+ should be written as if already authenticated. Just be sure when you [set up the
62
+ GCE instance][gce-how-to], you add the correct scopes for the APIs you want to
63
+ access. For example:
64
+
65
+ * **All APIs**
66
+ * `https://www.googleapis.com/auth/cloud-platform`
67
+ * `https://www.googleapis.com/auth/cloud-platform.read-only`
68
+ * **BigQuery**
69
+ * `https://www.googleapis.com/auth/bigquery`
70
+ * `https://www.googleapis.com/auth/bigquery.insertdata`
71
+ * **Compute Engine**
72
+ * `https://www.googleapis.com/auth/compute`
73
+ * **Datastore**
74
+ * `https://www.googleapis.com/auth/datastore`
75
+ * `https://www.googleapis.com/auth/userinfo.email`
76
+ * **DNS**
77
+ * `https://www.googleapis.com/auth/ndev.clouddns.readwrite`
78
+ * **Pub/Sub**
79
+ * `https://www.googleapis.com/auth/pubsub`
80
+ * **Storage**
81
+ * `https://www.googleapis.com/auth/devstorage.full_control`
82
+ * `https://www.googleapis.com/auth/devstorage.read_only`
83
+ * `https://www.googleapis.com/auth/devstorage.read_write`
84
+
85
+ ### Environment Variables
86
+
87
+ The **Project ID** and **Credentials JSON** can be placed in environment
88
+ variables instead of declaring them directly in code. Each service has its own
89
+ environment variable, allowing for different service accounts to be used for
90
+ different services. (See the READMEs for the individual service gems for
91
+ details.) The path to the **Credentials JSON** file can be stored in the
92
+ environment variable, or the **Credentials JSON** itself can be stored for
93
+ environments such as Docker containers where writing files is difficult or not
94
+ encouraged.
95
+
96
+ The environment variables that google-cloud-kms checks for project ID are:
97
+
98
+ 1. `KMS_PROJECT`
99
+ 2. `GOOGLE_CLOUD_PROJECT`
100
+
101
+ The environment variables that google-cloud-kms checks for credentials are configured on {Google::Cloud::Kms::V1::Credentials}:
102
+
103
+ 1. `KMS_CREDENTIALS` - Path to JSON file, or JSON contents
104
+ 2. `KMS_KEYFILE` - Path to JSON file, or JSON contents
105
+ 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
106
+ 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
107
+ 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
108
+
109
+ ```ruby
110
+ require "google/cloud/kms"
111
+
112
+ ENV["KMS_PROJECT"] = "my-project-id"
113
+ ENV["KMS_CREDENTIALS"] = "path/to/keyfile.json"
114
+
115
+ client = Google::Cloud::Kms.new
116
+ ```
117
+
118
+ ### Configuration
119
+
120
+ The **Project ID** and **Credentials JSON** can be configured instead of placing them in environment variables or providing them as arguments.
121
+
122
+ ```ruby
123
+ require "google/cloud/kms"
124
+
125
+ Google::Cloud::Kms.configure do |config|
126
+ config.project_id = "my-project-id"
127
+ config.credentials = "path/to/keyfile.json"
128
+ end
129
+
130
+ client = Google::Cloud::Kms.new
131
+ ```
132
+
133
+ ### Cloud SDK
134
+
135
+ This option allows for an easy way to authenticate during development. If
136
+ credentials are not provided in code or in environment variables, then Cloud SDK
137
+ credentials are discovered.
138
+
139
+ To configure your system for this, simply:
140
+
141
+ 1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
142
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
143
+ 3. Write code as if already authenticated.
144
+
145
+ **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
146
+ *should* only be used during development.
147
+
148
+ [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
149
+ [dev-console]: https://console.cloud.google.com/project
150
+
151
+ [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
152
+
153
+ [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
154
+ [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
155
+ [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
156
+
157
+ ## Creating a Service Account
158
+
159
+ Google Cloud requires a **Project ID** and **Service Account Credentials** to
160
+ connect to the APIs. You will use the **Project ID** and **JSON key file** to
161
+ connect to most services with google-cloud-kms.
162
+
163
+ If you are not running this client within [Google Cloud Platform
164
+ environments](#google-cloud-platform-environments), you need a Google
165
+ Developers service account.
166
+
167
+ 1. Visit the [Google Developers Console][dev-console].
168
+ 1. Create a new project or click on an existing project.
169
+ 1. Activate the slide-out navigation tray and select **API Manager**. From
170
+ here, you will enable the APIs that your application requires.
171
+
172
+ ![Enable the APIs that your application requires][enable-apis]
173
+
174
+ *Note: You may need to enable billing in order to use these services.*
175
+
176
+ 1. Select **Credentials** from the side navigation.
177
+
178
+ You should see a screen like one of the following.
179
+
180
+ ![Create a new service account][create-new-service-account]
181
+
182
+ ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
183
+
184
+ Find the "Add credentials" drop down and select "Service account" to be
185
+ guided through downloading a new JSON key file.
186
+
187
+ If you want to re-use an existing service account, you can easily generate a
188
+ new key file. Just select the account you wish to re-use, and click "Generate
189
+ new JSON key":
190
+
191
+ ![Re-use an existing service account][reuse-service-account]
192
+
193
+ The key file you download will be used by this library to authenticate API
194
+ requests and should be stored in a secure location.
195
+
196
+ ## Troubleshooting
197
+
198
+ If you're having trouble authenticating you can ask for help by following the
199
+ {file:TROUBLESHOOTING.md Troubleshooting Guide}.
@@ -83,57 +83,49 @@ module Google
83
83
  # describe the updated values, the API ignores the values of all
84
84
  # fields not covered by the mask.
85
85
  #
86
- # If a repeated field is specified for an update operation, the existing
87
- # repeated values in the target resource will be overwritten by the new values.
88
- # Note that a repeated field is only allowed in the last position of a `paths`
89
- # string.
86
+ # If a repeated field is specified for an update operation, new values will
87
+ # be appended to the existing repeated field in the target resource. Note that
88
+ # a repeated field is only allowed in the last position of a `paths` string.
90
89
  #
91
90
  # If a sub-message is specified in the last position of the field mask for an
92
- # update operation, then the existing sub-message in the target resource is
93
- # overwritten. Given the target message:
91
+ # update operation, then new value will be merged into the existing sub-message
92
+ # in the target resource.
93
+ #
94
+ # For example, given the target message:
94
95
  #
95
96
  # f {
96
97
  # b {
97
- # d : 1
98
- # x : 2
98
+ # d: 1
99
+ # x: 2
99
100
  # }
100
- # c : 1
101
+ # c: [1]
101
102
  # }
102
103
  #
103
104
  # And an update message:
104
105
  #
105
106
  # f {
106
107
  # b {
107
- # d : 10
108
+ # d: 10
108
109
  # }
110
+ # c: [2]
109
111
  # }
110
112
  #
111
113
  # then if the field mask is:
112
114
  #
113
- # paths: "f.b"
115
+ # paths: ["f.b", "f.c"]
114
116
  #
115
117
  # then the result will be:
116
118
  #
117
119
  # f {
118
120
  # b {
119
- # d : 10
121
+ # d: 10
122
+ # x: 2
120
123
  # }
121
- # c : 1
124
+ # c: [1, 2]
122
125
  # }
123
126
  #
124
- # However, if the update mask was:
125
- #
126
- # paths: "f.b.d"
127
- #
128
- # then the result would be:
129
- #
130
- # f {
131
- # b {
132
- # d : 10
133
- # x : 2
134
- # }
135
- # c : 1
136
- # }
127
+ # An implementation may provide options to override this default behavior for
128
+ # repeated and message fields.
137
129
  #
138
130
  # In order to reset a field's value to the default, the field must
139
131
  # be in the mask and set to the default value in the provided resource.
@@ -15,17 +15,19 @@
15
15
 
16
16
  module Google
17
17
  module Protobuf
18
- # A Timestamp represents a point in time independent of any time zone
19
- # or calendar, represented as seconds and fractions of seconds at
20
- # nanosecond resolution in UTC Epoch time. It is encoded using the
21
- # Proleptic Gregorian Calendar which extends the Gregorian calendar
22
- # backwards to year one. It is encoded assuming all minutes are 60
23
- # seconds long, i.e. leap seconds are "smeared" so that no leap second
24
- # table is needed for interpretation. Range is from
25
- # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
26
- # By restricting to that range, we ensure that we can convert to
27
- # and from RFC 3339 date strings.
28
- # See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
18
+ # A Timestamp represents a point in time independent of any time zone or local
19
+ # calendar, encoded as a count of seconds and fractions of seconds at
20
+ # nanosecond resolution. The count is relative to an epoch at UTC midnight on
21
+ # January 1, 1970, in the proleptic Gregorian calendar which extends the
22
+ # Gregorian calendar backwards to year one.
23
+ #
24
+ # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
25
+ # second table is needed for interpretation, using a [24-hour linear
26
+ # smear](https://developers.google.com/time/smear).
27
+ #
28
+ # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
29
+ # restricting to that range, we ensure that we can convert to and from [RFC
30
+ # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
29
31
  #
30
32
  # = Examples
31
33
  #
@@ -86,12 +88,12 @@ module Google
86
88
  # 01:30 UTC on January 15, 2017.
87
89
  #
88
90
  # In JavaScript, one can convert a Date object to this format using the
89
- # standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
91
+ # standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
90
92
  # method. In Python, a standard `datetime.datetime` object can be converted
91
93
  # to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
92
94
  # with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
93
95
  # can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
94
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
96
+ # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
95
97
  # ) to obtain a formatter capable of generating timestamps in this format.
96
98
  # @!attribute [rw] seconds
97
99
  # @return [Integer]
@@ -88,11 +88,11 @@ module Google
88
88
  ].freeze
89
89
 
90
90
 
91
- KEY_RING_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
92
- "projects/{project}/locations/{location}/keyRings/{key_ring}"
91
+ CRYPTO_KEY_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
92
+ "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
93
93
  )
94
94
 
95
- private_constant :KEY_RING_PATH_TEMPLATE
95
+ private_constant :CRYPTO_KEY_PATH_TEMPLATE
96
96
 
97
97
  CRYPTO_KEY_PATH_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
98
98
  "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path=**}"
@@ -100,34 +100,36 @@ module Google
100
100
 
101
101
  private_constant :CRYPTO_KEY_PATH_PATH_TEMPLATE
102
102
 
103
- LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
104
- "projects/{project}/locations/{location}"
103
+ CRYPTO_KEY_VERSION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
104
+ "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
105
105
  )
106
106
 
107
- private_constant :LOCATION_PATH_TEMPLATE
107
+ private_constant :CRYPTO_KEY_VERSION_PATH_TEMPLATE
108
108
 
109
- CRYPTO_KEY_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
110
- "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
109
+ KEY_RING_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
110
+ "projects/{project}/locations/{location}/keyRings/{key_ring}"
111
111
  )
112
112
 
113
- private_constant :CRYPTO_KEY_PATH_TEMPLATE
113
+ private_constant :KEY_RING_PATH_TEMPLATE
114
114
 
115
- CRYPTO_KEY_VERSION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
116
- "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
115
+ LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
116
+ "projects/{project}/locations/{location}"
117
117
  )
118
118
 
119
- private_constant :CRYPTO_KEY_VERSION_PATH_TEMPLATE
119
+ private_constant :LOCATION_PATH_TEMPLATE
120
120
 
121
- # Returns a fully-qualified key_ring resource name string.
121
+ # Returns a fully-qualified crypto_key resource name string.
122
122
  # @param project [String]
123
123
  # @param location [String]
124
124
  # @param key_ring [String]
125
+ # @param crypto_key [String]
125
126
  # @return [String]
126
- def self.key_ring_path project, location, key_ring
127
- KEY_RING_PATH_TEMPLATE.render(
127
+ def self.crypto_key_path project, location, key_ring, crypto_key
128
+ CRYPTO_KEY_PATH_TEMPLATE.render(
128
129
  :"project" => project,
129
130
  :"location" => location,
130
- :"key_ring" => key_ring
131
+ :"key_ring" => key_ring,
132
+ :"crypto_key" => crypto_key
131
133
  )
132
134
  end
133
135
 
@@ -146,46 +148,44 @@ module Google
146
148
  )
147
149
  end
148
150
 
149
- # Returns a fully-qualified location resource name string.
151
+ # Returns a fully-qualified crypto_key_version resource name string.
150
152
  # @param project [String]
151
153
  # @param location [String]
154
+ # @param key_ring [String]
155
+ # @param crypto_key [String]
156
+ # @param crypto_key_version [String]
152
157
  # @return [String]
153
- def self.location_path project, location
154
- LOCATION_PATH_TEMPLATE.render(
158
+ def self.crypto_key_version_path project, location, key_ring, crypto_key, crypto_key_version
159
+ CRYPTO_KEY_VERSION_PATH_TEMPLATE.render(
155
160
  :"project" => project,
156
- :"location" => location
161
+ :"location" => location,
162
+ :"key_ring" => key_ring,
163
+ :"crypto_key" => crypto_key,
164
+ :"crypto_key_version" => crypto_key_version
157
165
  )
158
166
  end
159
167
 
160
- # Returns a fully-qualified crypto_key resource name string.
168
+ # Returns a fully-qualified key_ring resource name string.
161
169
  # @param project [String]
162
170
  # @param location [String]
163
171
  # @param key_ring [String]
164
- # @param crypto_key [String]
165
172
  # @return [String]
166
- def self.crypto_key_path project, location, key_ring, crypto_key
167
- CRYPTO_KEY_PATH_TEMPLATE.render(
173
+ def self.key_ring_path project, location, key_ring
174
+ KEY_RING_PATH_TEMPLATE.render(
168
175
  :"project" => project,
169
176
  :"location" => location,
170
- :"key_ring" => key_ring,
171
- :"crypto_key" => crypto_key
177
+ :"key_ring" => key_ring
172
178
  )
173
179
  end
174
180
 
175
- # Returns a fully-qualified crypto_key_version resource name string.
181
+ # Returns a fully-qualified location resource name string.
176
182
  # @param project [String]
177
183
  # @param location [String]
178
- # @param key_ring [String]
179
- # @param crypto_key [String]
180
- # @param crypto_key_version [String]
181
184
  # @return [String]
182
- def self.crypto_key_version_path project, location, key_ring, crypto_key, crypto_key_version
183
- CRYPTO_KEY_VERSION_PATH_TEMPLATE.render(
185
+ def self.location_path project, location
186
+ LOCATION_PATH_TEMPLATE.render(
184
187
  :"project" => project,
185
- :"location" => location,
186
- :"key_ring" => key_ring,
187
- :"crypto_key" => crypto_key,
188
- :"crypto_key_version" => crypto_key_version
188
+ :"location" => location
189
189
  )
190
190
  end
191
191
 
@@ -510,16 +510,16 @@ module Google
510
510
  # @example
511
511
  # require "google/cloud/kms"
512
512
  #
513
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
513
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
514
514
  # formatted_parent = Google::Cloud::Kms::V1::KeyManagementServiceClient.location_path("[PROJECT]", "[LOCATION]")
515
515
  #
516
516
  # # Iterate over all results.
517
- # key_management_service_client.list_key_rings(formatted_parent).each do |element|
517
+ # key_management_client.list_key_rings(formatted_parent).each do |element|
518
518
  # # Process element.
519
519
  # end
520
520
  #
521
521
  # # Or iterate over results one page at a time.
522
- # key_management_service_client.list_key_rings(formatted_parent).each_page do |page|
522
+ # key_management_client.list_key_rings(formatted_parent).each_page do |page|
523
523
  # # Process each page at a time.
524
524
  # page.each do |element|
525
525
  # # Process element.
@@ -567,16 +567,16 @@ module Google
567
567
  # @example
568
568
  # require "google/cloud/kms"
569
569
  #
570
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
570
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
571
571
  # formatted_parent = Google::Cloud::Kms::V1::KeyManagementServiceClient.key_ring_path("[PROJECT]", "[LOCATION]", "[KEY_RING]")
572
572
  #
573
573
  # # Iterate over all results.
574
- # key_management_service_client.list_crypto_keys(formatted_parent).each do |element|
574
+ # key_management_client.list_crypto_keys(formatted_parent).each do |element|
575
575
  # # Process element.
576
576
  # end
577
577
  #
578
578
  # # Or iterate over results one page at a time.
579
- # key_management_service_client.list_crypto_keys(formatted_parent).each_page do |page|
579
+ # key_management_client.list_crypto_keys(formatted_parent).each_page do |page|
580
580
  # # Process each page at a time.
581
581
  # page.each do |element|
582
582
  # # Process element.
@@ -627,16 +627,16 @@ module Google
627
627
  # @example
628
628
  # require "google/cloud/kms"
629
629
  #
630
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
630
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
631
631
  # formatted_parent = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
632
632
  #
633
633
  # # Iterate over all results.
634
- # key_management_service_client.list_crypto_key_versions(formatted_parent).each do |element|
634
+ # key_management_client.list_crypto_key_versions(formatted_parent).each do |element|
635
635
  # # Process element.
636
636
  # end
637
637
  #
638
638
  # # Or iterate over results one page at a time.
639
- # key_management_service_client.list_crypto_key_versions(formatted_parent).each_page do |page|
639
+ # key_management_client.list_crypto_key_versions(formatted_parent).each_page do |page|
640
640
  # # Process each page at a time.
641
641
  # page.each do |element|
642
642
  # # Process element.
@@ -674,9 +674,9 @@ module Google
674
674
  # @example
675
675
  # require "google/cloud/kms"
676
676
  #
677
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
677
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
678
678
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.key_ring_path("[PROJECT]", "[LOCATION]", "[KEY_RING]")
679
- # response = key_management_service_client.get_key_ring(formatted_name)
679
+ # response = key_management_client.get_key_ring(formatted_name)
680
680
 
681
681
  def get_key_ring \
682
682
  name,
@@ -707,9 +707,9 @@ module Google
707
707
  # @example
708
708
  # require "google/cloud/kms"
709
709
  #
710
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
710
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
711
711
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
712
- # response = key_management_service_client.get_crypto_key(formatted_name)
712
+ # response = key_management_client.get_crypto_key(formatted_name)
713
713
 
714
714
  def get_crypto_key \
715
715
  name,
@@ -739,9 +739,9 @@ module Google
739
739
  # @example
740
740
  # require "google/cloud/kms"
741
741
  #
742
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
742
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
743
743
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_version_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
744
- # response = key_management_service_client.get_crypto_key_version(formatted_name)
744
+ # response = key_management_client.get_crypto_key_version(formatted_name)
745
745
 
746
746
  def get_crypto_key_version \
747
747
  name,
@@ -779,7 +779,7 @@ module Google
779
779
  # @example
780
780
  # require "google/cloud/kms"
781
781
  #
782
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
782
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
783
783
  # formatted_parent = Google::Cloud::Kms::V1::KeyManagementServiceClient.location_path("[PROJECT]", "[LOCATION]")
784
784
  #
785
785
  # # TODO: Initialize `key_ring_id`:
@@ -787,7 +787,7 @@ module Google
787
787
  #
788
788
  # # TODO: Initialize `key_ring`:
789
789
  # key_ring = {}
790
- # response = key_management_service_client.create_key_ring(formatted_parent, key_ring_id, key_ring)
790
+ # response = key_management_client.create_key_ring(formatted_parent, key_ring_id, key_ring)
791
791
 
792
792
  def create_key_ring \
793
793
  parent,
@@ -832,7 +832,7 @@ module Google
832
832
  # @example
833
833
  # require "google/cloud/kms"
834
834
  #
835
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
835
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
836
836
  # formatted_parent = Google::Cloud::Kms::V1::KeyManagementServiceClient.key_ring_path("[PROJECT]", "[LOCATION]", "[KEY_RING]")
837
837
  # crypto_key_id = "my-app-key"
838
838
  # purpose = :ENCRYPT_DECRYPT
@@ -845,7 +845,7 @@ module Google
845
845
  # next_rotation_time: next_rotation_time,
846
846
  # rotation_period: rotation_period
847
847
  # }
848
- # response = key_management_service_client.create_crypto_key(formatted_parent, crypto_key_id, crypto_key)
848
+ # response = key_management_client.create_crypto_key(formatted_parent, crypto_key_id, crypto_key)
849
849
 
850
850
  def create_crypto_key \
851
851
  parent,
@@ -889,12 +889,12 @@ module Google
889
889
  # @example
890
890
  # require "google/cloud/kms"
891
891
  #
892
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
892
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
893
893
  # formatted_parent = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
894
894
  #
895
895
  # # TODO: Initialize `crypto_key_version`:
896
896
  # crypto_key_version = {}
897
- # response = key_management_service_client.create_crypto_key_version(formatted_parent, crypto_key_version)
897
+ # response = key_management_client.create_crypto_key_version(formatted_parent, crypto_key_version)
898
898
 
899
899
  def create_crypto_key_version \
900
900
  parent,
@@ -930,14 +930,14 @@ module Google
930
930
  # @example
931
931
  # require "google/cloud/kms"
932
932
  #
933
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
933
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
934
934
  #
935
935
  # # TODO: Initialize `crypto_key`:
936
936
  # crypto_key = {}
937
937
  #
938
938
  # # TODO: Initialize `update_mask`:
939
939
  # update_mask = {}
940
- # response = key_management_service_client.update_crypto_key(crypto_key, update_mask)
940
+ # response = key_management_client.update_crypto_key(crypto_key, update_mask)
941
941
 
942
942
  def update_crypto_key \
943
943
  crypto_key,
@@ -985,14 +985,14 @@ module Google
985
985
  # @example
986
986
  # require "google/cloud/kms"
987
987
  #
988
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
988
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
989
989
  #
990
990
  # # TODO: Initialize `crypto_key_version`:
991
991
  # crypto_key_version = {}
992
992
  #
993
993
  # # TODO: Initialize `update_mask`:
994
994
  # update_mask = {}
995
- # response = key_management_service_client.update_crypto_key_version(crypto_key_version, update_mask)
995
+ # response = key_management_client.update_crypto_key_version(crypto_key_version, update_mask)
996
996
 
997
997
  def update_crypto_key_version \
998
998
  crypto_key_version,
@@ -1053,12 +1053,12 @@ module Google
1053
1053
  # @example
1054
1054
  # require "google/cloud/kms"
1055
1055
  #
1056
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1056
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1057
1057
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_path_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY_PATH]")
1058
1058
  #
1059
1059
  # # TODO: Initialize `plaintext`:
1060
1060
  # plaintext = ''
1061
- # response = key_management_service_client.encrypt(formatted_name, plaintext)
1061
+ # response = key_management_client.encrypt(formatted_name, plaintext)
1062
1062
 
1063
1063
  def encrypt \
1064
1064
  name,
@@ -1101,12 +1101,12 @@ module Google
1101
1101
  # @example
1102
1102
  # require "google/cloud/kms"
1103
1103
  #
1104
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1104
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1105
1105
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
1106
1106
  #
1107
1107
  # # TODO: Initialize `ciphertext`:
1108
1108
  # ciphertext = ''
1109
- # response = key_management_service_client.decrypt(formatted_name, ciphertext)
1109
+ # response = key_management_client.decrypt(formatted_name, ciphertext)
1110
1110
 
1111
1111
  def decrypt \
1112
1112
  name,
@@ -1146,12 +1146,12 @@ module Google
1146
1146
  # @example
1147
1147
  # require "google/cloud/kms"
1148
1148
  #
1149
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1149
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1150
1150
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
1151
1151
  #
1152
1152
  # # TODO: Initialize `crypto_key_version_id`:
1153
1153
  # crypto_key_version_id = ''
1154
- # response = key_management_service_client.update_crypto_key_primary_version(formatted_name, crypto_key_version_id)
1154
+ # response = key_management_client.update_crypto_key_primary_version(formatted_name, crypto_key_version_id)
1155
1155
 
1156
1156
  def update_crypto_key_primary_version \
1157
1157
  name,
@@ -1199,9 +1199,9 @@ module Google
1199
1199
  # @example
1200
1200
  # require "google/cloud/kms"
1201
1201
  #
1202
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1202
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1203
1203
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_version_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1204
- # response = key_management_service_client.destroy_crypto_key_version(formatted_name)
1204
+ # response = key_management_client.destroy_crypto_key_version(formatted_name)
1205
1205
 
1206
1206
  def destroy_crypto_key_version \
1207
1207
  name,
@@ -1238,9 +1238,9 @@ module Google
1238
1238
  # @example
1239
1239
  # require "google/cloud/kms"
1240
1240
  #
1241
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1241
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1242
1242
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_version_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1243
- # response = key_management_service_client.restore_crypto_key_version(formatted_name)
1243
+ # response = key_management_client.restore_crypto_key_version(formatted_name)
1244
1244
 
1245
1245
  def restore_crypto_key_version \
1246
1246
  name,
@@ -1274,9 +1274,9 @@ module Google
1274
1274
  # @example
1275
1275
  # require "google/cloud/kms"
1276
1276
  #
1277
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1277
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1278
1278
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_version_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1279
- # response = key_management_service_client.get_public_key(formatted_name)
1279
+ # response = key_management_client.get_public_key(formatted_name)
1280
1280
 
1281
1281
  def get_public_key \
1282
1282
  name,
@@ -1314,12 +1314,12 @@ module Google
1314
1314
  # @example
1315
1315
  # require "google/cloud/kms"
1316
1316
  #
1317
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1317
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1318
1318
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_version_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1319
1319
  #
1320
1320
  # # TODO: Initialize `ciphertext`:
1321
1321
  # ciphertext = ''
1322
- # response = key_management_service_client.asymmetric_decrypt(formatted_name, ciphertext)
1322
+ # response = key_management_client.asymmetric_decrypt(formatted_name, ciphertext)
1323
1323
 
1324
1324
  def asymmetric_decrypt \
1325
1325
  name,
@@ -1361,12 +1361,12 @@ module Google
1361
1361
  # @example
1362
1362
  # require "google/cloud/kms"
1363
1363
  #
1364
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1364
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1365
1365
  # formatted_name = Google::Cloud::Kms::V1::KeyManagementServiceClient.crypto_key_version_path("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]")
1366
1366
  #
1367
1367
  # # TODO: Initialize `digest`:
1368
1368
  # digest = {}
1369
- # response = key_management_service_client.asymmetric_sign(formatted_name, digest)
1369
+ # response = key_management_client.asymmetric_sign(formatted_name, digest)
1370
1370
 
1371
1371
  def asymmetric_sign \
1372
1372
  name,
@@ -1406,12 +1406,12 @@ module Google
1406
1406
  # @example
1407
1407
  # require "google/cloud/kms"
1408
1408
  #
1409
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1409
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1410
1410
  # formatted_resource = Google::Cloud::Kms::V1::KeyManagementServiceClient.key_ring_path("[PROJECT]", "[LOCATION]", "[KEY_RING]")
1411
1411
  #
1412
1412
  # # TODO: Initialize `policy`:
1413
1413
  # policy = {}
1414
- # response = key_management_service_client.set_iam_policy(formatted_resource, policy)
1414
+ # response = key_management_client.set_iam_policy(formatted_resource, policy)
1415
1415
 
1416
1416
  def set_iam_policy \
1417
1417
  resource,
@@ -1445,9 +1445,9 @@ module Google
1445
1445
  # @example
1446
1446
  # require "google/cloud/kms"
1447
1447
  #
1448
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1448
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1449
1449
  # formatted_resource = Google::Cloud::Kms::V1::KeyManagementServiceClient.key_ring_path("[PROJECT]", "[LOCATION]", "[KEY_RING]")
1450
- # response = key_management_service_client.get_iam_policy(formatted_resource)
1450
+ # response = key_management_client.get_iam_policy(formatted_resource)
1451
1451
 
1452
1452
  def get_iam_policy \
1453
1453
  resource,
@@ -1484,12 +1484,12 @@ module Google
1484
1484
  # @example
1485
1485
  # require "google/cloud/kms"
1486
1486
  #
1487
- # key_management_service_client = Google::Cloud::Kms.new(version: :v1)
1487
+ # key_management_client = Google::Cloud::Kms.new(version: :v1)
1488
1488
  # formatted_resource = Google::Cloud::Kms::V1::KeyManagementServiceClient.key_ring_path("[PROJECT]", "[LOCATION]", "[KEY_RING]")
1489
1489
  #
1490
1490
  # # TODO: Initialize `permissions`:
1491
1491
  # permissions = []
1492
- # response = key_management_service_client.test_iam_permissions(formatted_resource, permissions)
1492
+ # response = key_management_client.test_iam_permissions(formatted_resource, permissions)
1493
1493
 
1494
1494
  def test_iam_permissions \
1495
1495
  resource,
@@ -77,12 +77,12 @@
77
77
  },
78
78
  "Encrypt": {
79
79
  "timeout_millis": 60000,
80
- "retry_codes_name": "non_idempotent",
80
+ "retry_codes_name": "idempotent",
81
81
  "retry_params_name": "default"
82
82
  },
83
83
  "Decrypt": {
84
84
  "timeout_millis": 60000,
85
- "retry_codes_name": "non_idempotent",
85
+ "retry_codes_name": "idempotent",
86
86
  "retry_params_name": "default"
87
87
  },
88
88
  "UpdateCryptoKeyPrimaryVersion": {
@@ -107,12 +107,12 @@
107
107
  },
108
108
  "AsymmetricDecrypt": {
109
109
  "timeout_millis": 60000,
110
- "retry_codes_name": "non_idempotent",
110
+ "retry_codes_name": "idempotent",
111
111
  "retry_params_name": "default"
112
112
  },
113
113
  "AsymmetricSign": {
114
114
  "timeout_millis": 60000,
115
- "retry_codes_name": "non_idempotent",
115
+ "retry_codes_name": "idempotent",
116
116
  "retry_params_name": "default"
117
117
  },
118
118
  "SetIamPolicy": {
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: 1.0.0
4
+ version: 1.0.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: 2019-03-11 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -116,6 +116,7 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - ".yardopts"
119
+ - AUTHENTICATION.md
119
120
  - LICENSE
120
121
  - README.md
121
122
  - lib/google/cloud/kms.rb
@@ -153,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
154
  - !ruby/object:Gem::Version
154
155
  version: '0'
155
156
  requirements: []
156
- rubyforge_project:
157
- rubygems_version: 2.7.6
157
+ rubygems_version: 3.0.3
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: API Client library for Cloud Key Management Service (KMS) API