google-cloud-env 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/env/compute_metadata.rb +3 -3
- data/lib/google/cloud/env/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90efc7ff417c91cb62cbb85b70f1a16f25ad41b84effa31e7a753d64d0f541a8
|
4
|
+
data.tar.gz: 6925442cc3d569125696bf34112b8ce4fce1030295c48b259533219c6577e6c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5076fb608c2552701f6f267f641a83ae0301b8a7d6b3103613046b67179bed1e9c32ea65d238c3f81776ce1f7a77883c906fb3c421b1c4f4e9edb0a567f1dfe6
|
7
|
+
data.tar.gz: 81a486aa7b6c23c143a6af6cab570cd7ce3af5a22966303dccaf3081ff90e05e9a9f94a50356d860f03d2f03afffc74089abf71b4ea3a19b9dd87ebcb223dcaf
|
data/CHANGELOG.md
CHANGED
@@ -806,7 +806,7 @@ module Google
|
|
806
806
|
#
|
807
807
|
def access_token_lifetime data
|
808
808
|
json = JSON.parse data rescue nil
|
809
|
-
return 0 unless json
|
809
|
+
return 0 unless json.respond_to?(:key?) && json.key?("expires_in")
|
810
810
|
lifetime = json["expires_in"].to_i - TOKEN_EXPIRY_BUFFER
|
811
811
|
lifetime = 0 if lifetime.negative?
|
812
812
|
lifetime
|
@@ -818,9 +818,9 @@ module Google
|
|
818
818
|
#
|
819
819
|
def identity_token_lifetime data
|
820
820
|
return 0 unless data =~ /^[\w=-]+\.([\w=-]+)\.[\w=-]+$/
|
821
|
-
base64 = Base64.
|
821
|
+
base64 = Base64.urlsafe_decode64 Regexp.last_match[1]
|
822
822
|
json = JSON.parse base64 rescue nil
|
823
|
-
return 0 unless json&.key?
|
823
|
+
return 0 unless json.respond_to?(:key?) && json&.key?("exp")
|
824
824
|
lifetime = json["exp"].to_i - Time.now.to_i - TOKEN_EXPIRY_BUFFER
|
825
825
|
lifetime = 0 if lifetime.negative?
|
826
826
|
lifetime
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -59,10 +59,10 @@ homepage: https://github.com/googleapis/ruby-cloud-env
|
|
59
59
|
licenses:
|
60
60
|
- Apache-2.0
|
61
61
|
metadata:
|
62
|
-
changelog_uri: https://rubydoc.info/gems/google-cloud-env/2.2.
|
62
|
+
changelog_uri: https://rubydoc.info/gems/google-cloud-env/2.2.1/CHANGELOG.md
|
63
63
|
source_code_uri: https://github.com/googleapis/ruby-cloud-env
|
64
64
|
bug_tracker_uri: https://github.com/googleapis/ruby-cloud-env/issues
|
65
|
-
documentation_uri: https://rubydoc.info/gems/google-cloud-env/2.2.
|
65
|
+
documentation_uri: https://rubydoc.info/gems/google-cloud-env/2.2.1
|
66
66
|
post_install_message:
|
67
67
|
rdoc_options: []
|
68
68
|
require_paths:
|