class Google::Cloud::Env::ComputeMetadata
def access_token_lifetime data
- Private: -
def access_token_lifetime data json = JSON.parse data rescue nil return 0 unless json.respond_to?(:key?) && json.key?("expires_in") lifetime = json["expires_in"].to_i - TOKEN_EXPIRY_BUFFER lifetime = 0 if lifetime.negative? lifetime end