googleauth 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f46ec9043835b66f2412c2bee7b285dfa5cbcdace1fab63e21ffb58cf7d0fb62
4
- data.tar.gz: 03fc18bca3d16f8aefdd8a52a73f6924439a6d1da14a888de46a628f174f943f
3
+ metadata.gz: 286a365510084cc4410a7fb76cc6ee21be59372e57c1ef475f14c232cd883c54
4
+ data.tar.gz: 413babe33567dfc2d5f2f12df1b3c344c497bea78e32b311ba025e26ebce9314
5
5
  SHA512:
6
- metadata.gz: 54c04e72d1423b24fc7252a72c0e1efcdf15c3911479129ffe33c989471bf6eb0d222f348142911ca6938273df0d571dccd65ec38059ff599ce0de36301b53f1
7
- data.tar.gz: 538c2287ddaf524cb37f00d21069a2a87668a89da09c1939111c587aca87af328a9eee75ce9adacd66ac29e59bfbe387a442d01e400c9eca5e6e5f1fc30e8fe2
6
+ metadata.gz: 9d478df9ef5cdf0ff86a281b9410c2b33756be34734c06ce858fda704297ae97607b7d254803bcd8f18290a7d6e32cc26b78ea3e7bb1dc0308fcc1faabd35fdf
7
+ data.tar.gz: d153a275309125418cafdfd3f222f3c09c5f0b873056c4eb95e676f492cb59b214b28a680b375b76cf4b2bf3560263311cea700c37df14632f9418c774ca9372
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Release History
2
2
 
3
+ ## [1.1.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v1.0.0...googleauth/v1.1.0) (2021-10-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * Support short-lived tokens in Credentials ([9d7051c](https://www.github.com/googleapis/google-auth-library-ruby/commit/9d7051cff4d5e191a5d6756a068e8be539934f0d))
9
+
3
10
  ## [1.0.0](https://www.github.com/googleapis/google-auth-library-ruby/compare/googleauth/v0.17.1...googleauth/v1.0.0) (2021-09-27)
4
11
 
5
12
  Bumped version to 1.0.0. Releases from this point will follow semver.
data/README.md CHANGED
@@ -230,5 +230,5 @@ hesitate to
230
230
  about the client or APIs on [StackOverflow](http://stackoverflow.com).
231
231
 
232
232
  [application default credentials]: https://developers.google.com/accounts/docs/application-default-credentials
233
- [contributing]: https://github.com/googleapis/google-auth-library-ruby/tree/master/.github/CONTRIBUTING.md
234
- [license]: https://github.com/googleapis/google-auth-library-ruby/tree/master/LICENSE
233
+ [contributing]: https://github.com/googleapis/google-auth-library-ruby/tree/main/.github/CONTRIBUTING.md
234
+ [license]: https://github.com/googleapis/google-auth-library-ruby/tree/main/LICENSE
@@ -364,7 +364,7 @@ module Google
364
364
  end
365
365
  CredentialsLoader.warn_if_cloud_sdk_credentials @client.client_id
366
366
  @project_id ||= CredentialsLoader.load_gcloud_project_id
367
- @client.fetch_access_token!
367
+ @client.fetch_access_token! if @client.needs_access_token?
368
368
  @env_vars = nil
369
369
  @paths = nil
370
370
  @scope = nil
@@ -29,12 +29,21 @@ module Signet
29
29
  self
30
30
  end
31
31
 
32
+ # The token type as symbol, either :id_token or :access_token
33
+ def token_type
34
+ target_audience ? :id_token : :access_token
35
+ end
36
+
37
+ # Whether the id_token or access_token is missing or about to expire.
38
+ def needs_access_token?
39
+ send(token_type).nil? || expires_within?(60)
40
+ end
41
+
32
42
  # Updates a_hash updated with the authentication token
33
43
  def apply! a_hash, opts = {}
34
44
  # fetch the access token there is currently not one, or if the client
35
45
  # has expired
36
- token_type = target_audience ? :id_token : :access_token
37
- fetch_access_token! opts if send(token_type).nil? || expires_within?(60)
46
+ fetch_access_token! opts if needs_access_token?
38
47
  a_hash[AUTH_METADATA_KEY] = "Bearer #{send token_type}"
39
48
  end
40
49
 
@@ -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.0.0".freeze
19
+ VERSION = "1.1.0".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.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Emiola
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2021-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -159,7 +159,7 @@ homepage: https://github.com/googleapis/google-auth-library-ruby
159
159
  licenses:
160
160
  - Apache-2.0
161
161
  metadata:
162
- changelog_uri: https://github.com/googleapis/google-auth-library-ruby/blob/master/CHANGELOG.md
162
+ changelog_uri: https://github.com/googleapis/google-auth-library-ruby/blob/main/CHANGELOG.md
163
163
  source_code_uri: https://github.com/googleapis/google-auth-library-ruby
164
164
  bug_tracker_uri: https://github.com/googleapis/google-auth-library-ruby/issues
165
165
  post_install_message: