symmetric-encryption icon indicating copy to clipboard operation
symmetric-encryption copied to clipboard

GCP kms not working it latest gems

Open rcalosso opened this issue 4 years ago • 1 comments

Environment

Provide at least:

  • Ruby Version.
  • 2.7.2
  • Symmetric Encryption Version.
  • 4.3.0
  • Application/framework names and versions (e.g. Rails, Sinatra, Puma, etc.).
  • Rails
  • Full Stack Trace, if an exception is being raised.
  • bundle exec symmetric-encryption --generate --keystore gcp --app-name Sample --environments "production" bundler: failed to load command: symmetric-encryption (/opt/narvar/vendor/bundle/ruby/2.7.0/bin/symmetric-encryption) NameError: uninitialized constant Google::Cloud::Kms::V1::KeyManagementServiceClient /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore/gcp.rb:67:in client' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore/gcp.rb:59:in encrypt' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore/gcp.rb:45:in write' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore/gcp.rb:18:in generate_data_key' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore.rb:24:in block in generate_data_keys' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore.rb:18:in each' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/keystore.rb:18:in generate_data_keys' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/cli.rb:222:in generate_new_config' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/cli.rb:66:in run!' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/lib/symmetric_encryption/cli.rb:14:in run!' /opt/narvar/vendor/bundle/ruby/2.7.0/gems/symmetric-encryption-4.3.0/bin/symmetric-encryption:5:in <top (required)>' /opt/narvar/vendor/bundle/ruby/2.7.0/bin/symmetric-encryption:23:in load' /opt/narvar/vendor/bundle/ruby/2.7.0/bin/symmetric-encryption:23:in `<top (required)>'

Expected Behavior

Expect to generate config file

Actual Behavior

Stack trace, crash cause module / class name is wrong

Pull Request

Will work on PR, but looks like line 67 above is missing ::, should read

self.class::KMS::KeyManagementService::Client.new(timeout: 2, credentials: credentials)

rcalosso avatar Feb 23 '21 21:02 rcalosso

If Google have changed their API, when you submit the PR, please verify that the new changes are backward compatible with the previous Google API version.

reidmorrison avatar May 03 '21 14:05 reidmorrison