googleauth 1.1.2 → 1.1.3

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: 93cce260fe46995cee6a0db84a12f3c6a9a258df1ab6c0d960df32086edf0dd5
4
- data.tar.gz: 879f77f346d359eaaa62da3469b164f2fd72be1c519fb7aa312b790b85c5a40c
3
+ metadata.gz: 967a6321e1ec2dafec23915f77028196ca588d1b0cd7d40c0824d918d4001298
4
+ data.tar.gz: b85411d05c86ccc52727047c74d82dc30e16df41f374ac6f64d760776be923fc
5
5
  SHA512:
6
- metadata.gz: 11aed69e62abd148b0fdb63e8187a15495be58e7b868c95f8e9f5fb6e4e81ee986114b0d5f60051b7bf28d5c0ba917d00b88003f7b7b82ee0758a1fe981ac28b
7
- data.tar.gz: 87054824ae0e4264405b3155612370885f830dca1093ea957e10cc16dd59a56046af1fdcc61831e2aebd874bebb35d0507b056a6c874968398990f2a457dfd32
6
+ metadata.gz: d858caa697993c8c8336e2b15a5a8e1bf21d939678513874426207e7002a052d82f0ed2020ed7cef54ec14e97aca0e2ce23ff8442cd346d72ea45d4975d4373d
7
+ data.tar.gz: fda398a2576f28e0dff7196e46ce0d51e4e73b4db4f4f59d10e3e2fd124913cc0af2533428bd0a8a8b83f7b6b334757540b556b1160c9adf8dbc6dd9dab827c6
data/CHANGELOG.md CHANGED
@@ -1,90 +1,92 @@
1
1
  # Release History
2
2
 
3
- ### [1.1.2](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v1.1.1...googleauth/v1.1.2) (2022-02-22)
3
+ ### 1.1.3 (2022-04-20)
4
4
 
5
+ #### Documentation
5
6
 
6
- ### Bug Fixes
7
+ * Add README instructions for 3-Legged OAuth with a service account
7
8
 
8
- * Support Faraday 2 ([#365](https://www.github.com/googleapis/google-auth-library-ruby/issues/365)) ([9bbb88f](https://www.github.com/googleapis/google-auth-library-ruby/commit/9bbb88f825fe185f69d314ff6808524ce036acb6))
9
+ ### 1.1.2 (2022-02-22)
9
10
 
10
- ### [1.1.1](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v1.1.0...googleauth/v1.1.1) (2022-02-14)
11
+ #### Bug Fixes
11
12
 
13
+ * Support Faraday 2
12
14
 
13
- ### Bug Fixes
15
+ ### 1.1.1 (2022-02-14)
14
16
 
15
- * add quota_project to user refresh credentials ([#361](https://www.github.com/googleapis/google-auth-library-ruby/issues/361)) ([0eb3c28](https://www.github.com/googleapis/google-auth-library-ruby/commit/0eb3c2850813c99c1100df6371c94ddef6e00b00))
17
+ #### Bug Fixes
16
18
 
17
- ## [1.1.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v1.0.0...googleauth/v1.1.0) (2021-10-24)
19
+ * add quota_project to user refresh credentials
18
20
 
21
+ ### 1.1.0 (2021-10-24)
19
22
 
20
- ### Features
23
+ #### Features
21
24
 
22
- * Support short-lived tokens in Credentials ([9d7051c](https://www.github.com/googleapis/google-auth-library-ruby/commit/9d7051cff4d5e191a5d6756a068e8be539934f0d))
25
+ * Support short-lived tokens in Credentials
23
26
 
24
- ## [1.0.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v0.17.1...googleauth/v1.0.0) (2021-09-27)
27
+ ### 1.0.0 (2021-09-27)
25
28
 
26
29
  Bumped version to 1.0.0. Releases from this point will follow semver.
27
30
 
28
- * Allow dependency on future 1.x versions of signet ([9e17a24](https://www.github.com/googleapis/google-auth-library-ruby/commit/9e17a24bf97cb52f09756c624b4dc6e18dc79493))
29
- * Prevented gcloud from authenticating on the console when getting the gcloud project ([9902503](https://www.github.com/googleapis/google-auth-library-ruby/commit/990250345d6af31de1066c08c0b3b42692ae263c))
31
+ * Allow dependency on future 1.x versions of signet
32
+ * Prevented gcloud from authenticating on the console when getting the gcloud project
30
33
 
31
- ## [0.17.1](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v0.15.0...googleauth/v0.17.1) (2021-09-01)
34
+ ### 0.17.1 (2021-09-01)
32
35
 
33
- * Updates to gem metadata ([fb5e56d](https://www.github.com/googleapis/google-auth-library-ruby/commit/fb5e56dad1e6ed6afd4f9b5c626e5e1495e48343))
36
+ * Updates to gem metadata
34
37
 
35
- ## [0.17.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/google-auth-library-ruby/v0.16.2...google-auth-library-ruby/v0.17.0) (2021-07-30)
38
+ ### 0.17.0 (2021-07-30)
36
39
 
37
- * Allow scopes to be self-signed into jwts ([e67ce40](https://www.github.com/googleapis/google-auth-library-ruby/commit/e67ce40f919b7eb3723c2ec95f5b8d58315ab1ee))
40
+ * Allow scopes to be self-signed into jwts
38
41
 
39
- ## [0.16.2](https://www.github.com/googleapis/google-auth-library-ruby/compare/google-auth-library-ruby/v0.16.1...google-auth-library-ruby/v0.16.2) (2021-04-28)
42
+ ### 0.16.2 (2021-04-28)
40
43
 
41
- * Stop attempting to get the project from gcloud when applying self-signed JWTs ([#317](https://www.github.com/googleapis/google-auth-library-ruby/issues/317)) ([39258ca](https://www.github.com/googleapis/google-auth-library-ruby/commit/39258cacafa5c770fb40d99075a97b8e6427adba))
44
+ * Stop attempting to get the project from gcloud when applying self-signed JWTs
42
45
 
43
- ## [0.16.1](https://www.github.com/googleapis/google-auth-library-ruby/compare/google-auth-library-ruby/v0.16.0...google-auth-library-ruby/v0.16.1) (2021-04-01)
46
+ ### 0.16.1 (2021-04-01)
44
47
 
45
- * Accept application/text content-type for plain idtoken response ([4948ebb](https://www.github.com/googleapis/google-auth-library-ruby/commit/4948ebb3ca151e9f0433585a41bad6f415416b2d))
48
+ * Accept application/text content-type for plain idtoken response
46
49
 
47
- ## [0.16.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/v0.15.1...v0.16.0) (2021-03-04)
50
+ ### 0.16.0 (2021-03-04)
48
51
 
49
- * Drop support for Ruby 2.4 and add support for Ruby 3.0 ([6644806](https://www.github.com/googleapis/google-auth-library-ruby/commit/6644806ab47cea6d08e1901c2ed808e53a579bc3))
52
+ * Drop support for Ruby 2.4 and add support for Ruby 3.0
50
53
 
51
- ## [0.15.1](https://www.github.com/googleapis/google-auth-library-ruby/compare/v0.15.0...v0.15.1) (2021-02-08)
54
+ ### 0.15.1 (2021-02-08)
52
55
 
53
- * Fix crash when using a client credential without any paths or env_vars set ([#296](https://www.github.com/googleapis/google-auth-library-ruby/issues/296)) ([c971c1a](https://www.github.com/googleapis/google-auth-library-ruby/commit/c971c1ad2d7730c0f5b389d533a972be32fbaf49))
56
+ * Fix crash when using a client credential without any paths or env_vars set
54
57
 
55
- ## [0.15.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/v0.14.0...v0.15.0) (2021-01-26)
58
+ ### 0.15.0 (2021-01-26)
56
59
 
57
- * Credential parameters inherit from superclasses ([4fa4720](https://www.github.com/googleapis/google-auth-library-ruby/commit/4fa47206dbd62f8bbdd1b9d3721f6baee9fd1d62))
58
- * Service accounts apply a self-signed JWT if scopes are marked as default ([d22acb8](https://www.github.com/googleapis/google-auth-library-ruby/commit/d22acb8a510e6711b5674545c31a4816e5a9168f))
60
+ * Credential parameters inherit from superclasses
61
+ * Service accounts apply a self-signed JWT if scopes are marked as default
62
+ * Retry fetch_access_token when GCE metadata server returns unexpected errors
63
+ * Support correct service account and user refresh behavior for custom credential env variables
59
64
 
60
- * Retry fetch_access_token when GCE metadata server returns unexpected errors ([cd9b012](https://www.github.com/googleapis/google-auth-library-ruby/commit/cd9b0126d3419b9953982f71edc9e6ba3f640e3c))
61
- * Support correct service account and user refresh behavior for custom credential env variables ([d2dffe5](https://www.github.com/googleapis/google-auth-library-ruby/commit/d2dffe592112b45006291ad9a57f56e00fb208c3))
62
-
63
- ## 0.14.0 / 2020-10-09
65
+ ### 0.14.0 / 2020-10-09
64
66
 
65
67
  * Honor GCE_METADATA_HOST environment variable
66
68
  * Fix errors in some environments when requesting an access token for multiple scopes
67
69
 
68
- ## 0.13.1 / 2020-07-30
70
+ ### 0.13.1 / 2020-07-30
69
71
 
70
72
  * Support scopes when using GCE Metadata Server authentication ([@ball-hayden][])
71
73
 
72
- ## 0.13.0 / 2020-06-17
74
+ ### 0.13.0 / 2020-06-17
73
75
 
74
76
  * Support for validating ID tokens.
75
77
  * Fixed header application of ID tokens from service accounts.
76
78
 
77
- ## 0.12.0 / 2020-04-08
79
+ ### 0.12.0 / 2020-04-08
78
80
 
79
81
  * Support for ID token credentials.
80
82
  * Support reading quota_id_project from service account credentials.
81
83
 
82
- ## 0.11.0 / 2020-02-24
84
+ ### 0.11.0 / 2020-02-24
83
85
 
84
86
  * Support Faraday 1.x.
85
87
  * Allow special "postmessage" value for redirect_uri.
86
88
 
87
- ## 0.10.0 / 2019-10-09
89
+ ### 0.10.0 / 2019-10-09
88
90
 
89
91
  Note: This release now requires Ruby 2.4 or later
90
92
 
@@ -94,7 +96,7 @@ Note: This release now requires Ruby 2.4 or later
94
96
  * Set instance variables at initialization to avoid spamming warnings
95
97
  * Pass "Metadata-Flavor" header to metadata server when checking for GCE
96
98
 
97
- ## 0.9.0 / 2019-08-05
99
+ ### 0.9.0 / 2019-08-05
98
100
 
99
101
  * Restore compatibility with Ruby 2.0. This is the last release that will work on end-of-lifed versions of Ruby. The 0.10 release will require Ruby 2.4 or later.
100
102
  * Update Credentials to use methods for values that are intended to be changed by users, replacing constants.
@@ -103,105 +105,95 @@ Note: This release now requires Ruby 2.4 or later
103
105
  * Add verbosity none to gcloud command
104
106
  * Make arity of WebUserAuthorizer#get_credentials compatible with the base class
105
107
 
106
- ## 0.8.1 / 2019-03-27
108
+ ### 0.8.1 / 2019-03-27
107
109
 
108
110
  * Silence unnecessary gcloud warning
109
111
  * Treat empty credentials environment variables as unset
110
112
 
111
- ## 0.8.0 / 2019-01-02
113
+ ### 0.8.0 / 2019-01-02
112
114
 
113
115
  * Support connection options :default_connection and :connection_builder when creating credentials that need to refresh OAuth tokens. This lets clients provide connection objects with custom settings, such as proxies, needed for the client environment.
114
116
  * Removed an unnecessary warning about project IDs.
115
117
 
116
- ## 0.7.1 / 2018-10-25
118
+ ### 0.7.1 / 2018-10-25
117
119
 
118
120
  * Make load_gcloud_project_id module function.
119
121
 
120
- ## 0.7.0 / 2018-10-24
122
+ ### 0.7.0 / 2018-10-24
121
123
 
122
124
  * Add project_id instance variable to UserRefreshCredentials, ServiceAccountCredentials, and Credentials.
123
125
 
124
- ## 0.6.7 / 2018-10-16
126
+ ### 0.6.7 / 2018-10-16
125
127
 
126
128
  * Update memoist dependency to ~> 0.16.
127
129
 
128
- ## 0.6.6 / 2018-08-22
130
+ ### 0.6.6 / 2018-08-22
129
131
 
130
132
  * Remove ruby version warnings.
131
133
 
132
- ## 0.6.5 / 2018-08-16
134
+ ### 0.6.5 / 2018-08-16
133
135
 
134
136
  * Fix incorrect http verb when revoking credentials.
135
137
  * Warn on EOL ruby versions.
136
138
 
137
- ## 0.6.4 / 2018-08-03
139
+ ### 0.6.4 / 2018-08-03
138
140
 
139
141
  * Resolve issue where DefaultCredentials constant was undefined.
140
142
 
141
- ## 0.6.3 / 2018-08-02
143
+ ### 0.6.3 / 2018-08-02
142
144
 
143
145
  * Resolve issue where token_store was being written to twice
144
146
 
145
- ## 0.6.2 / 2018-08-01
147
+ ### 0.6.2 / 2018-08-01
146
148
 
147
149
  * Add warning when using cloud sdk credentials
148
150
 
149
- ## 0.6.1 / 2017-10-18
151
+ ### 0.6.1 / 2017-10-18
150
152
 
151
153
  * Fix file permissions
152
154
 
153
- ## 0.6.0 / 2017-10-17
155
+ ### 0.6.0 / 2017-10-17
154
156
 
155
157
  * Support ruby-jwt 2.0
156
158
  * Add simple credentials class
157
159
 
158
- ## 0.5.3 / 2017-07-21
160
+ ### 0.5.3 / 2017-07-21
159
161
 
160
162
  * Fix file permissions on the gem's `.rb` files.
161
163
 
162
- ## 0.5.2 / 2017-07-19
164
+ ### 0.5.2 / 2017-07-19
163
165
 
164
166
  * Add retry mechanism when fetching access tokens in `GCECredentials` and `UserRefreshCredentials` classes.
165
167
  * Update Google API OAuth2 token credential URI to v4.
166
168
 
167
- ## 0.5.1 / 2016-01-06
169
+ ### 0.5.1 / 2016-01-06
168
170
 
169
171
  * Change header name emitted by `Client#apply` from "Authorization" to "authorization" ([@murgatroid99][])
170
172
  * Fix ADC not working on some windows machines ([@vsubramani][])
171
- [#55](https://github.com/google/google-auth-library-ruby/issues/55)
172
173
 
173
- ## 0.5.0 / 2015-10-12
174
+ ### 0.5.0 / 2015-10-12
174
175
 
175
176
  * Initial support for user credentials ([@sqrrrl][])
176
177
  * Update Signet to 0.7
177
178
 
178
- ## 0.4.2 / 2015-08-05
179
+ ### 0.4.2 / 2015-08-05
179
180
 
180
181
  * Updated UserRefreshCredentials hash to use string keys ([@haabaato][])
181
- [#36](https://github.com/google/google-auth-library-ruby/issues/36)
182
-
183
182
  * Add support for a system default credentials file. ([@mr-salty][])
184
- [#33](https://github.com/google/google-auth-library-ruby/issues/33)
185
-
186
183
  * Fix bug when loading credentials from ENV ([@dwilkie][])
187
- [#31](https://github.com/google/google-auth-library-ruby/issues/31)
188
-
189
184
  * Relax the constraint of dependent version of multi_json ([@igrep][])
190
- [#30](https://github.com/google/google-auth-library-ruby/issues/30)
191
-
192
185
  * Enables passing credentials via environment variables. ([@haabaato][])
193
- [#27](https://github.com/google/google-auth-library-ruby/issues/27)
194
186
 
195
- ## 0.4.1 / 2015-04-25
187
+ ### 0.4.1 / 2015-04-25
196
188
 
197
189
  * Improves handling of --no-scopes GCE authorization ([@tbetbetbe][])
198
190
  * Refactoring and cleanup ([@joneslee85][])
199
191
 
200
- ## 0.4.0 / 2015-03-25
192
+ ### 0.4.0 / 2015-03-25
201
193
 
202
194
  * Adds an implementation of JWT header auth ([@tbetbetbe][])
203
195
 
204
- ## 0.3.0 / 2015-03-23
196
+ ### 0.3.0 / 2015-03-23
205
197
 
206
198
  * makes the scope parameter's optional in all APIs. ([@tbetbetbe][])
207
199
  * changes the scope parameter's position in various constructors. ([@tbetbetbe][])
data/README.md CHANGED
@@ -14,11 +14,6 @@
14
14
  This is Google's officially supported ruby client library for using OAuth 2.0
15
15
  authorization and authentication with Google APIs.
16
16
 
17
- ## Alpha
18
-
19
- This library is in Alpha. We will make an effort to support the library, but
20
- we reserve the right to make incompatible changes when necessary.
21
-
22
17
  ## Install
23
18
 
24
19
  Be sure `https://rubygems.org/` is in your gem sources.
@@ -162,6 +157,22 @@ drive.authorization = authorizer
162
157
  list_files = drive.list_files()
163
158
  ```
164
159
 
160
+ ### 3-Legged OAuth with a Service Account
161
+
162
+ This is similar to regular service account authorization (see [this answer](https://support.google.com/a/answer/2538798?hl=en) for more details on the differences), but you'll need to indicate which user your service account is impersonating by manually updating the `sub` field.
163
+
164
+ ```ruby
165
+ scope = 'https://www.googleapis.com/auth/androidpublisher'
166
+
167
+ authorizer = Google::Auth::ServiceAccountCredentials.make_creds(
168
+ json_key_io: File.open('/path/to/service_account_json_key.json'),
169
+ scope: scope
170
+ )
171
+ authorizer.update!(sub: "email-to-impersonate@your-domain.com")
172
+
173
+ authorizer.fetch_access_token!
174
+ ```
175
+
165
176
  ### Example (Environment Variables)
166
177
 
167
178
  ```bash
@@ -12,7 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- require "memoist"
16
15
  require "os"
17
16
  require "rbconfig"
18
17
 
@@ -23,7 +22,6 @@ module Google
23
22
  # CredentialsLoader contains the behaviour used to locate and find default
24
23
  # credentials files on the file system.
25
24
  module CredentialsLoader
26
- extend Memoist
27
25
  ENV_VAR = "GOOGLE_APPLICATION_CREDENTIALS".freeze
28
26
  PRIVATE_KEY_VAR = "GOOGLE_PRIVATE_KEY".freeze
29
27
  CLIENT_EMAIL_VAR = "GOOGLE_CLIENT_EMAIL".freeze
@@ -16,6 +16,6 @@ module Google
16
16
  # Module Auth provides classes that provide Google-specific authorization
17
17
  # used to access Google APIs.
18
18
  module Auth
19
- VERSION = "1.1.2".freeze
19
+ VERSION = "1.1.3".freeze
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: googleauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Emiola
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-24 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday