Code Monkey home page Code Monkey logo

Comments (5)

jmazzi avatar jmazzi commented on August 16, 2024

Are you using master or the latest gem release? The examples below represent master.

Sent from my phone

On Dec 27, 2013, at 5:41 AM, Claudio Poli [email protected] wrote:

I'm giving this gem a quick try, I applied this into my model:

crypt_keeper :token, :secret, encryptor: :aes, key: 'super_good_password', salt: 'salt'
2.0.0p353 :001 > AuthToken.first
TypeError: no implicit conversion of nil into String
gems/aes-0.5.0/lib/aes/aes.rb:76:in update' gems/aes-0.5.0/lib/aes/aes.rb:76:indecrypt'
gems/aes-0.5.0/lib/aes/aes.rb:9:in decrypt' bundler/gems/crypt_keeper-1c9050c4c9db/lib/crypt_keeper/provider/aes.rb:34:indecrypt'
bundler/gems/crypt_keeper-1c9050c4c9db/lib/crypt_keeper/helper.rb:34:in load' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/serialization.rb:89:inunserialize'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/serialization.rb:80:in unserialized_value' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/serialization.rb:67:intype_cast'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/read.rb:101:in block in read_attribute' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/read.rb:84:infetch'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/read.rb:84:in read_attribute' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods.rb:272:inattribute_for_inspect'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/core.rb:354:in block in inspect' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/core.rb:352:incollect'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/core.rb:352:in inspect' bundler/gems/rails-b23d3ffcd157/railties/lib/rails/commands/console.rb:90:instart'
In the fetched row secret is nil, however it was my understanding that this should just return the original value instead of raising:
https://github.com/jmazzi/crypt_keeper/blob/master/lib/crypt_keeper/provider/aes.rb#L28


Reply to this email directly or view it on GitHub.

from crypt_keeper.

masterkain avatar masterkain commented on August 16, 2024

I tried both, I'm afraid the result is the same.

from crypt_keeper.

jmazzi avatar jmazzi commented on August 16, 2024

@masterkain hmm, that's odd. The backtrace mentions line 34 in helper.rb which you can see checks for value.blank?. I'm wondering if your version of blank? has a different behavior than what it normally does.

Which version of rails are you using? Can you comment out the crypt_keeper line in your model and try AuthToken.first.token.blank? and AuthToken.first.secret.blank?? Do they return true?

from crypt_keeper.

masterkain avatar masterkain commented on August 16, 2024

uhm, the backtrace does mention serialization.

I have now converted the table values to use with postgres_pgp, but later I'm going to try AES again with a clean set because perhaps it has something to do with my store_accessor :extra hstore attribute. Rails 4.0.1 (4-0-stable)
token and secret however are text columns, not "hstore'd" ones.

from crypt_keeper.

jmazzi avatar jmazzi commented on August 16, 2024

Did you try the examples I posted?

Sent from my phone

On Dec 27, 2013, at 6:02 PM, Claudio Poli [email protected] wrote:

uhm, the backtrace does mention serialization.

I have now converted the table values to use with postgres_pgp, but later I'm going to try again because perhaps it has something to do with my store_accessor :extra hstore attribute. Rails 4.0.1.


Reply to this email directly or view it on GitHub.

from crypt_keeper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.