Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 #204

Merged
merged 8 commits into from
Mar 30, 2016
Merged

V3 #204

merged 8 commits into from
Mar 30, 2016

Conversation

saghaulor
Copy link
Contributor

Version bump to v3:

  • Fixed AciveModel::Dirty methods.
  • Now using Encryptor v3.0.0.

- Tests were failing because the IV used to derive the encryption key
  was changing everytime the Proc was evaluated.
- Other tests were failing because the default mode was
  :per_attribute_iv and the IV wasn't persisted because the column was
  missing.
- Decrypting the attribute_was value requires some special handling now
  that we're changing the IV during every encryption operation. Namely,
  we have to evaluate all the options for the attribute and pass in the
  encrypted_attribute_iv_was and the encrypted_attribute_salt_was to
  properly decrypt the encrypted_attribute_was value.
- We delete the :iv, :salt, and :operation keys from the
  encrypted_attributes hash that were used to decrypt the
  encrypted_attribute_was value just to be safe. Normally those values
  are not persisted in the encrypted_attributes hash.
- This is required for passing in the IV and salt to decrypted the
  encrypted_attribute_was ciphertext.
- The options evaluated should be used from the instance level, not the class
  level.
@saghaulor saghaulor merged commit 3d79f68 into attr-encrypted:master Mar 30, 2016
@saghaulor saghaulor deleted the v3 branch March 30, 2016 03:13
@saghaulor
Copy link
Contributor Author

This closes #203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants