README.md in lockbox-1.0.0 vs README.md in lockbox-1.1.0
- old
+ new
@@ -736,11 +736,11 @@
```
Make it the default with:
```ruby
-Lockbox.default_options = {algorithm: "xsalsa20"}
+Lockbox.default_options[:algorithm] = "xsalsa20"
```
You can also pass an algorithm to `previous_versions` for key rotation.
## Hybrid Cryptography
@@ -1043,69 +1043,9 @@
metadata = user.license.metadata
unless metadata["encrypted"]
user.license.blob.update!(metadata: metadata.merge("encrypted" => true))
end
-end
-```
-
-### 0.3.6
-
-0.3.6 makes content type detection more reliable for Active Storage. You can check and update the content type of existing files with:
-
-```ruby
-User.with_attached_license.find_each do |user|
- next unless user.license.attached?
-
- license = user.license
- content_type = Marcel::MimeType.for(license.download, name: license.filename.to_s)
- if content_type != license.content_type
- license.update!(content_type: content_type)
- end
-end
-```
-
-### 0.2.0
-
-0.2.0 brings a number of improvements. Here are a few to be aware of:
-
-- Added `encrypts` method for database fields
-- Added support for XSalsa20
-- `attached_encrypted` is deprecated in favor of `encrypts_attached`.
-
-#### Optional
-
-To switch to a master key, generate a key:
-
-```ruby
-Lockbox.generate_key
-```
-
-And set `ENV["LOCKBOX_MASTER_KEY"]` or `Lockbox.master_key`.
-
-Update your model:
-
-```ruby
-class User < ApplicationRecord
- encrypts_attached :license, previous_versions: [{key: key}]
-end
-```
-
-New uploads will be encrypted with the new key.
-
-You can rotate existing records with:
-
-```ruby
-User.unscoped.find_each do |user|
- user.license.rotate_encryption!
-end
-```
-
-Once that’s complete, update your model:
-
-```ruby
-class User < ApplicationRecord
- encrypts_attached :license
end
```
## History