google-iam-credentials-v1 0.3.3 → 0.4.0

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: 8ee976989804c904afd4dc4b04e797030364c226b0f97441520a8238420dc659
4
- data.tar.gz: 270bbf5f53ea3d65656f58d1a8fd48236cc679790e6d3fa547771bb53d6a609e
3
+ metadata.gz: f5829210018c42479a8912c0eeea260a3ee6e5e563716450bbcba314c77a18e4
4
+ data.tar.gz: 9b94c349ce14587ff2bd4aa76316427c1561151ff9d29b272de68a69eb0826ab
5
5
  SHA512:
6
- metadata.gz: 4a59240159962b9ea832acc07445af28d28c6038b645d9e83d373872c32a28e8177f8fd25a98f8434efdc0dad405162391dda8543b65edd7995a8ec5ea1c959a
7
- data.tar.gz: 8d50a77306272cd1291276fb183f01e0cdd57204d95a4f7e5599bdfaee0a4b6998f752080aee110b0d24ca80f0dcd1f60ea6e1ea37256bb8b04356a47707c859
6
+ metadata.gz: e82ac6e2dd8ce2a2a72245086bcfeecd9681901441b40f3e482eaa32ed36669b9c242238066cbd0d0ee6853a274e916fb9650efede8f0d38576ed8ae5692172b
7
+ data.tar.gz: 92df0692d03bad6104d8cb9f78cecb944806398304b8e21ad9f7199deb241a6575cece768f1cc331876c3be3e6a099022894f2e6795835bec0b9d9f60fe5ee1f
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=IAM Service Account Credentials V1 API
2
+ --title="IAM Service Account Credentials V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new # (requ
37
37
  response = client.generate_access_token request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-iam-credentials-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-iam-credentials-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/iam)
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -7,6 +7,7 @@ require 'google/api/field_behavior_pb'
7
7
  require 'google/api/resource_pb'
8
8
  require 'google/protobuf/duration_pb'
9
9
  require 'google/protobuf/timestamp_pb'
10
+
10
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
12
  add_file("google/iam/credentials/v1/common.proto", :syntax => :proto3) do
12
13
  add_message "google.iam.credentials.v1.GenerateAccessTokenRequest" do
@@ -225,6 +225,21 @@ module Google
225
225
  #
226
226
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
227
227
  #
228
+ # @example Basic example
229
+ # require "google/iam/credentials/v1"
230
+ #
231
+ # # Create a client object. The client can be reused for multiple calls.
232
+ # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new
233
+ #
234
+ # # Create a request. To set request fields, pass in keyword arguments.
235
+ # request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new
236
+ #
237
+ # # Call the generate_access_token method.
238
+ # result = client.generate_access_token request
239
+ #
240
+ # # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse.
241
+ # p result
242
+ #
228
243
  def generate_access_token request, options = nil
229
244
  raise ::ArgumentError, "request must be provided" if request.nil?
230
245
 
@@ -242,9 +257,11 @@ module Google
242
257
  gapic_version: ::Google::Iam::Credentials::V1::VERSION
243
258
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
259
 
245
- header_params = {
246
- "name" => request.name
247
- }
260
+ header_params = {}
261
+ if request.name
262
+ header_params["name"] = request.name
263
+ end
264
+
248
265
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
249
266
  metadata[:"x-goog-request-params"] ||= request_params_header
250
267
 
@@ -313,6 +330,21 @@ module Google
313
330
  #
314
331
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
315
332
  #
333
+ # @example Basic example
334
+ # require "google/iam/credentials/v1"
335
+ #
336
+ # # Create a client object. The client can be reused for multiple calls.
337
+ # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new
338
+ #
339
+ # # Create a request. To set request fields, pass in keyword arguments.
340
+ # request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new
341
+ #
342
+ # # Call the generate_id_token method.
343
+ # result = client.generate_id_token request
344
+ #
345
+ # # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse.
346
+ # p result
347
+ #
316
348
  def generate_id_token request, options = nil
317
349
  raise ::ArgumentError, "request must be provided" if request.nil?
318
350
 
@@ -330,9 +362,11 @@ module Google
330
362
  gapic_version: ::Google::Iam::Credentials::V1::VERSION
331
363
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
364
 
333
- header_params = {
334
- "name" => request.name
335
- }
365
+ header_params = {}
366
+ if request.name
367
+ header_params["name"] = request.name
368
+ end
369
+
336
370
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
337
371
  metadata[:"x-goog-request-params"] ||= request_params_header
338
372
 
@@ -397,6 +431,21 @@ module Google
397
431
  #
398
432
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
399
433
  #
434
+ # @example Basic example
435
+ # require "google/iam/credentials/v1"
436
+ #
437
+ # # Create a client object. The client can be reused for multiple calls.
438
+ # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new
439
+ #
440
+ # # Create a request. To set request fields, pass in keyword arguments.
441
+ # request = Google::Iam::Credentials::V1::SignBlobRequest.new
442
+ #
443
+ # # Call the sign_blob method.
444
+ # result = client.sign_blob request
445
+ #
446
+ # # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse.
447
+ # p result
448
+ #
400
449
  def sign_blob request, options = nil
401
450
  raise ::ArgumentError, "request must be provided" if request.nil?
402
451
 
@@ -414,9 +463,11 @@ module Google
414
463
  gapic_version: ::Google::Iam::Credentials::V1::VERSION
415
464
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
416
465
 
417
- header_params = {
418
- "name" => request.name
419
- }
466
+ header_params = {}
467
+ if request.name
468
+ header_params["name"] = request.name
469
+ end
470
+
420
471
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
421
472
  metadata[:"x-goog-request-params"] ||= request_params_header
422
473
 
@@ -481,6 +532,21 @@ module Google
481
532
  #
482
533
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
483
534
  #
535
+ # @example Basic example
536
+ # require "google/iam/credentials/v1"
537
+ #
538
+ # # Create a client object. The client can be reused for multiple calls.
539
+ # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new
540
+ #
541
+ # # Create a request. To set request fields, pass in keyword arguments.
542
+ # request = Google::Iam::Credentials::V1::SignJwtRequest.new
543
+ #
544
+ # # Call the sign_jwt method.
545
+ # result = client.sign_jwt request
546
+ #
547
+ # # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse.
548
+ # p result
549
+ #
484
550
  def sign_jwt request, options = nil
485
551
  raise ::ArgumentError, "request must be provided" if request.nil?
486
552
 
@@ -498,9 +564,11 @@ module Google
498
564
  gapic_version: ::Google::Iam::Credentials::V1::VERSION
499
565
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
500
566
 
501
- header_params = {
502
- "name" => request.name
503
- }
567
+ header_params = {}
568
+ if request.name
569
+ header_params["name"] = request.name
570
+ end
571
+
504
572
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
505
573
  metadata[:"x-goog-request-params"] ||= request_params_header
506
574
 
@@ -6,6 +6,7 @@ require 'google/protobuf'
6
6
  require 'google/api/annotations_pb'
7
7
  require 'google/api/client_pb'
8
8
  require 'google/iam/credentials/v1/common_pb'
9
+
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
11
  add_file("google/iam/credentials/v1/iamcredentials.proto", :syntax => :proto3) do
11
12
  end
@@ -35,7 +35,7 @@ module Google
35
35
  # more.
36
36
  class Service
37
37
 
38
- include GRPC::GenericService
38
+ include ::GRPC::GenericService
39
39
 
40
40
  self.marshal_class_method = :encode
41
41
  self.unmarshal_class_method = :decode
@@ -21,7 +21,7 @@ module Google
21
21
  module Iam
22
22
  module Credentials
23
23
  module V1
24
- VERSION = "0.3.3"
24
+ VERSION = "0.4.0"
25
25
  end
26
26
  end
27
27
  end
@@ -25,6 +25,8 @@ module Google
25
25
  ##
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
+ # @example
29
+ #
28
30
  # require "google/iam/credentials/v1"
29
31
  # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new
30
32
  #
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-iam-credentials-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.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: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.10'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.7'
29
+ version: '0.10'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -50,28 +50,28 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.25.1
53
+ version: 1.26.1
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.25.1
60
+ version: 1.26.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: minitest
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '5.14'
67
+ version: '5.16'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '5.14'
74
+ version: '5.16'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: minitest-focus
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '12.0'
109
+ version: '13.0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '12.0'
116
+ version: '13.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: redcarpet
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -199,14 +199,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
199
  requirements:
200
200
  - - ">="
201
201
  - !ruby/object:Gem::Version
202
- version: '2.5'
202
+ version: '2.6'
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - ">="
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
208
  requirements: []
209
- rubygems_version: 3.2.17
209
+ rubygems_version: 3.3.14
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: API Client library for the IAM Service Account Credentials V1 API