googleapis / google-auth-library-ruby

Google Auth Library for Ruby
Apache License 2.0
471 stars 255 forks source link

googleauth-1.11.0/lib/googleauth/service_account.rb:87:in `unescape': undefined method `gsub' for nil:NilClass #482

Open markhorrocks opened 6 months ago

markhorrocks commented 6 months ago

Steps to reproduce

  1. Attempt to use make_creds with json_key

! /usr/bin/ruby

require 'googleauth'

SERVICE_ACCOUNT_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----MIIE1234ABCD-----END PRIVATE KEY-----"

begin credentials = Google::Auth::ServiceAccountCredentials.make_creds( scope: "https://analyticsreporting.googleapis.com/v4/reports:batchGet", json_key: SERVICE_ACCOUNT_PRIVATE_KEY ) rescue => error puts "Error: #{error.message}" end

palladius commented 6 months ago

I got the same issue this morning.