Comments (5)
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:inupdate' gems/aes-0.5.0/lib/aes/aes.rb:76:in
decrypt'
gems/aes-0.5.0/lib/aes/aes.rb:9:indecrypt' bundler/gems/crypt_keeper-1c9050c4c9db/lib/crypt_keeper/provider/aes.rb:34:in
decrypt'
bundler/gems/crypt_keeper-1c9050c4c9db/lib/crypt_keeper/helper.rb:34:inload' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/serialization.rb:89:in
unserialize'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/serialization.rb:80:inunserialized_value' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/serialization.rb:67:in
type_cast'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/read.rb:101:inblock in read_attribute' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/read.rb:84:in
fetch'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods/read.rb:84:inread_attribute' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/attribute_methods.rb:272:in
attribute_for_inspect'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/core.rb:354:inblock in inspect' bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/core.rb:352:in
collect'
bundler/gems/rails-b23d3ffcd157/activerecord/lib/active_record/core.rb:352:ininspect' bundler/gems/rails-b23d3ffcd157/railties/lib/rails/commands/console.rb:90:in
start'
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.
I tried both, I'm afraid the result is the same.
from crypt_keeper.
@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.
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.
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)
- ActiveRecord::SubclassNotFound: Invalid single-table inheritance type: Firm is not a subclass of
- Feature Request: Sorting encrypted attributes
- Failure to support encryption for :string column type HOT 3
- jamming config.active_record.verbose_query_logs = true HOT 1
- Delayed job: ActiveSupport::MessageEncryptor::InvalidMessage HOT 15
- How to use WHERE LIKE queries on encrypted fields? HOT 1
- Rails 6 support HOT 1
- Rails 6 support HOT 9
- ActiveRecord send indavlid data to database using PostgresPgp with binary column type HOT 3
- undefined method `crypt_keeper' for CryptKeeper::Model::ClassMethods:Module
- String length validation for encrypted filed? HOT 3
- Support Rails 6.1.0 HOT 5
- ActiveSupport::MessageEncryptor::InvalidMessage after upgrading from Rails 5.2.6 to 6.0.4 HOT 2
- Devise & Crypt-Keeper for same model HOT 2
- Incorrect rails 7 dependency specified in Gemspec HOT 5
- crypt_keeper re-encrypts attributes on every save HOT 1
- Cannot have multiple encryptors on one model HOT 2
- Allow rails 7.0.X HOT 3
- `decrypt_table!` fails with unencrypted data
- crypt_keeper 2.3.0 not compatible with rails 7.0.8.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crypt_keeper.