google-cloud-env 2.2.0 → 2.2.2
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/google/cloud/env/compute_metadata.rb +4 -3
- data/lib/google/cloud/env/version.rb +1 -1
- metadata +19 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bd6e034977c34854af686d14f419c35561fb8131b00598905fd46eaa58b21f1
|
4
|
+
data.tar.gz: 7e1dbda6e63920200c22e35ea7ce90a7386056670331f49d1f20b88006047f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c92d5f7b211fb483ffe577068f1f404aa2a3f80a5b5e261aa3476e6c34772b874d15ac27078f5044a6fbb8a53cc74ba1d00786a8a08bc57223c3a19d5809168
|
7
|
+
data.tar.gz: 2b6bfee7565c20da51f76252110c032c0ce0de816ae9e871afcb51ed9700b811fb51cb8a9cc1571169c633efc317f0a43ce3cc1eb378de1795d1b5aa7d9e2cf8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 2.2.2 (2025-03-13)
|
4
|
+
|
5
|
+
#### Bug Fixes
|
6
|
+
|
7
|
+
* Updated dependencies to include base64 for Ruby 3.4 ([#81](https://github.com/googleapis/ruby-cloud-env/issues/81))
|
8
|
+
|
9
|
+
### 2.2.1 (2024-10-04)
|
10
|
+
|
11
|
+
#### Bug Fixes
|
12
|
+
|
13
|
+
* Fixed edge cases in token expiration extraction ([#73](https://github.com/googleapis/ruby-cloud-env/issues/73))
|
14
|
+
|
3
15
|
### 2.2.0 (2024-08-22)
|
4
16
|
|
5
17
|
#### Features
|
@@ -14,6 +14,7 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
|
+
require "base64"
|
17
18
|
require "faraday"
|
18
19
|
require "json"
|
19
20
|
|
@@ -806,7 +807,7 @@ module Google
|
|
806
807
|
#
|
807
808
|
def access_token_lifetime data
|
808
809
|
json = JSON.parse data rescue nil
|
809
|
-
return 0 unless json
|
810
|
+
return 0 unless json.respond_to?(:key?) && json.key?("expires_in")
|
810
811
|
lifetime = json["expires_in"].to_i - TOKEN_EXPIRY_BUFFER
|
811
812
|
lifetime = 0 if lifetime.negative?
|
812
813
|
lifetime
|
@@ -818,9 +819,9 @@ module Google
|
|
818
819
|
#
|
819
820
|
def identity_token_lifetime data
|
820
821
|
return 0 unless data =~ /^[\w=-]+\.([\w=-]+)\.[\w=-]+$/
|
821
|
-
base64 = Base64.
|
822
|
+
base64 = Base64.urlsafe_decode64 Regexp.last_match[1]
|
822
823
|
json = JSON.parse base64 rescue nil
|
823
|
-
return 0 unless json&.key?
|
824
|
+
return 0 unless json.respond_to?(:key?) && json&.key?("exp")
|
824
825
|
lifetime = json["exp"].to_i - Time.now.to_i - TOKEN_EXPIRY_BUFFER
|
825
826
|
lifetime = 0 if lifetime.negative?
|
826
827
|
lifetime
|
metadata
CHANGED
@@ -1,15 +1,28 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: base64
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0.2'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0.2'
|
13
26
|
- !ruby/object:Gem::Dependency
|
14
27
|
name: faraday
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,11 +72,10 @@ homepage: https://github.com/googleapis/ruby-cloud-env
|
|
59
72
|
licenses:
|
60
73
|
- Apache-2.0
|
61
74
|
metadata:
|
62
|
-
changelog_uri: https://rubydoc.info/gems/google-cloud-env/2.2.
|
75
|
+
changelog_uri: https://rubydoc.info/gems/google-cloud-env/2.2.2/CHANGELOG.md
|
63
76
|
source_code_uri: https://github.com/googleapis/ruby-cloud-env
|
64
77
|
bug_tracker_uri: https://github.com/googleapis/ruby-cloud-env/issues
|
65
|
-
documentation_uri: https://rubydoc.info/gems/google-cloud-env/2.2.
|
66
|
-
post_install_message:
|
78
|
+
documentation_uri: https://rubydoc.info/gems/google-cloud-env/2.2.2
|
67
79
|
rdoc_options: []
|
68
80
|
require_paths:
|
69
81
|
- lib
|
@@ -78,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
90
|
- !ruby/object:Gem::Version
|
79
91
|
version: '0'
|
80
92
|
requirements: []
|
81
|
-
rubygems_version: 3.5
|
82
|
-
signing_key:
|
93
|
+
rubygems_version: 3.6.5
|
83
94
|
specification_version: 4
|
84
95
|
summary: Google Cloud Platform hosting environment information.
|
85
96
|
test_files: []
|