googleapis / google-cloud-ruby

Google Cloud Client Library for Ruby
https://googleapis.github.io/google-cloud-ruby/
Apache License 2.0
1.36k stars 550 forks source link

google-cloud-recaptcha_enterprise Needs Latest Version of google-auth-library-ruby #25301

Open jaredmurphyvimeo opened 8 months ago

jaredmurphyvimeo commented 8 months ago

Hi there,

Reporting an issue with google-cloud-recaptcha_enterprise library. When configuring credentials it throws an error and it looks like it is raising an issue with an old version of the google-auth-library-ruby gem. The google-auth-library-ruby gem has since been updated and it looks like our issue can be fixed by upgrading the dependency from v1.9.2 to at least v1.10.0. In particular this line that was removed seems like it would fix the problem: https://github.com/googleapis/google-auth-library-ruby/pull/474/files#diff-7af4b8cd3faed95cfaa30a3c927b5e81a6a1a5decdd3f9d7cedabc876ce5d807L519

Please let me know if you can update the google-cloud-recaptcha_enterprise to use the latest version of the google-auth-library-ruby gem .

Thanks!

Environment details

Steps to reproduce

  1. Install recaptcha gem via Gemfile (gem 'google-cloud-recaptcha_enterprise')
  2. Follow instructions for authenticating recaptcha client
  3. See error

Code example

# given a filepath to a valid ADC credentials file
filepath = '../filepath'

Google::Cloud::RecaptchaEnterprise.configure do |config|
    config.credentials = filepath
  end

client = ::Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service

Full backtrace

  1) GenerateCaptchaScore works
     Failure/Error: client = ::Google::Cloud::RecaptchaEnterprise.recaptcha_enterprise_service

     TypeError:
       no implicit conversion of nil into String
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/3.1.0/openssl/pkey.rb:356:in `initialize'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/3.1.0/openssl/pkey.rb:356:in `new'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/3.1.0/openssl/pkey.rb:356:in `new'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/googleauth-1.9.2/lib/googleauth/credentials.rb:519:in `client_options'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/googleauth-1.9.2/lib/googleauth/credentials.rb:488:in `init_client'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/googleauth-1.9.2/lib/googleauth/credentials.rb:548:in `update_from_filepath'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/googleauth-1.9.2/lib/googleauth/credentials.rb:367:in `initialize'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/google-cloud-recaptcha_enterprise-v1-0.18.0/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb:158:in `new'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/google-cloud-recaptcha_enterprise-v1-0.18.0/lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb:158:in `initiali
ze'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/google-cloud-recaptcha_enterprise-1.5.0/lib/google/cloud/recaptcha_enterprise.rb:75:in `new'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/google-cloud-recaptcha_enterprise-1.5.0/lib/google/cloud/recaptcha_enterprise.rb:75:in `recaptcha_enterprise_service'
     # ./app/services/generate_captcha_score.rb:23:in `call'
     # ./spec/services/generate_captcha_score_spec.rb:9:in `block (2 levels) in <top (required)>'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:263:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:263:in `block in run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:511:in `block in with_around_and_singleton_context_hooks'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:468:in `block in with_around_example_hooks'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:486:in `block in run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:626:in `block in run_around_example_hooks_for'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:352:in `call'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-rails-5.1.2/lib/rspec/rails/adapters.rb:75:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:390:in `execute_with'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:352:in `call'
     # ./spec/support/database_cleaner.rb:58:in `block (2 levels) in <main>'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:390:in `execute_with'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:352:in `call'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webmock-3.23.0/lib/webmock/rspec.rb:39:in `block (2 levels) in <main>'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:390:in `execute_with'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:352:in `call'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
  # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:457:in `instance_exec'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:390:in `execute_with'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:352:in `call'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:629:in `run_around_example_hooks_for'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/hooks.rb:486:in `run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:468:in `with_around_example_hooks'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:511:in `with_around_and_singleton_context_hooks'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:259:in `run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example_group.rb:646:in `block in run_examples'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example_group.rb:642:in `map'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example_group.rb:642:in `run_examples'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/example_group.rb:607:in `run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:121:in `map'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/configuration.rb:2068:in `with_suite_hooks'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:116:in `block in run_specs'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/reporter.rb:74:in `report'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:115:in `run_specs'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:89:in `run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:71:in `run'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/lib/rspec/core/runner.rb:45:in `invoke'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/rspec-core-3.11.0/exe/rspec:4:in `<top (required)>'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/bin/rspec:25:in `load'
     # /Users/jared.murphy/.rbenv/versions/3.1.4/bin/rspec:25:in `<main>'
dazuma commented 8 months ago

Can you just run:

bundle update googleauth

We know there will be bug fixes in dependencies like googleauth. I don't think we want to update the gemspecs for the API clients every time one of the dependencies releases an fix. We'd be doing nothing but updating those dependency versions 24x7. 🙂