lockbox 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -6
- data/lib/lockbox/active_storage_extensions.rb +13 -0
- data/lib/lockbox/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4771553bf23214b514e9a4a5c94ce665d234d34969f9a3941ea68bdc6729ed4
|
4
|
+
data.tar.gz: a921894d4f3f43d5245a91941e06f79ea652f09c9c77ccf8dc7e442d1dbda0e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90fef82d743a0172a61728fd9f314eca597d43820e87aeb9cb77330e4ec824919d354b81cf4c6c9c2b1c8cedcebb8916425fed5e469b24ea11b6a2e8730feb6f
|
7
|
+
data.tar.gz: fe874ec6aa3f563927f2ea1743d34a795468846ce74cc9e1a0467e41757721d40c8449d7093b158f63f92b8566ea578cf88e5f2b0a8caefc9facee2a8b731afa
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -72,7 +72,7 @@ Then follow the instructions below for the data you want to encrypt.
|
|
72
72
|
Create a migration with:
|
73
73
|
|
74
74
|
```ruby
|
75
|
-
class AddEmailCiphertextToUsers < ActiveRecord::Migration[7.
|
75
|
+
class AddEmailCiphertextToUsers < ActiveRecord::Migration[7.2]
|
76
76
|
def change
|
77
77
|
add_column :users, :email_ciphertext, :text
|
78
78
|
end
|
@@ -251,7 +251,7 @@ User.decrypt_email_ciphertext(user.email_ciphertext)
|
|
251
251
|
Create a migration with:
|
252
252
|
|
253
253
|
```ruby
|
254
|
-
class AddBodyCiphertextToRichTexts < ActiveRecord::Migration[7.
|
254
|
+
class AddBodyCiphertextToRichTexts < ActiveRecord::Migration[7.2]
|
255
255
|
def change
|
256
256
|
add_column :action_text_rich_texts, :body_ciphertext, :text
|
257
257
|
end
|
@@ -382,7 +382,7 @@ Encryption is applied to all versions after processing.
|
|
382
382
|
You can mount the uploader [as normal](https://github.com/carrierwaveuploader/carrierwave#activerecord). With Active Record, this involves creating a migration:
|
383
383
|
|
384
384
|
```ruby
|
385
|
-
class AddLicenseToUsers < ActiveRecord::Migration[7.
|
385
|
+
class AddLicenseToUsers < ActiveRecord::Migration[7.2]
|
386
386
|
def change
|
387
387
|
add_column :users, :license, :string
|
388
388
|
end
|
@@ -910,7 +910,7 @@ end
|
|
910
910
|
You can use `binary` columns for the ciphertext instead of `text` columns.
|
911
911
|
|
912
912
|
```ruby
|
913
|
-
class AddEmailCiphertextToUsers < ActiveRecord::Migration[7.
|
913
|
+
class AddEmailCiphertextToUsers < ActiveRecord::Migration[7.2]
|
914
914
|
def change
|
915
915
|
add_column :users, :email_ciphertext, :binary
|
916
916
|
end
|
@@ -961,7 +961,7 @@ end
|
|
961
961
|
Create a migration with:
|
962
962
|
|
963
963
|
```ruby
|
964
|
-
class MigrateToLockbox < ActiveRecord::Migration[7.
|
964
|
+
class MigrateToLockbox < ActiveRecord::Migration[7.2]
|
965
965
|
def change
|
966
966
|
add_column :users, :name_ciphertext, :text
|
967
967
|
add_column :users, :email_ciphertext, :text
|
@@ -994,7 +994,7 @@ end
|
|
994
994
|
Then remove the previous gem from your Gemfile and drop its columns.
|
995
995
|
|
996
996
|
```ruby
|
997
|
-
class RemovePreviousEncryptedColumns < ActiveRecord::Migration[7.
|
997
|
+
class RemovePreviousEncryptedColumns < ActiveRecord::Migration[7.2]
|
998
998
|
def change
|
999
999
|
remove_column :users, :encrypted_name, :text
|
1000
1000
|
remove_column :users, :encrypted_name_iv, :text
|
@@ -124,6 +124,13 @@ module Lockbox
|
|
124
124
|
super
|
125
125
|
end
|
126
126
|
|
127
|
+
if ActiveStorage::VERSION::STRING.to_f == 7.1 && ActiveStorage.version >= "7.1.4"
|
128
|
+
def transform_variants_later
|
129
|
+
blob.instance_variable_set(:@lockbox_encrypted, true) if Utils.encrypted_options(record, name)
|
130
|
+
super
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
127
134
|
if ActiveStorage::VERSION::MAJOR >= 6
|
128
135
|
def open(**options)
|
129
136
|
blob.open(**options) do |file|
|
@@ -150,6 +157,12 @@ module Lockbox
|
|
150
157
|
end
|
151
158
|
|
152
159
|
module Blob
|
160
|
+
if ActiveStorage::VERSION::STRING.to_f == 7.1 && ActiveStorage.version >= "7.1.4"
|
161
|
+
def preview_image_needed_before_processing_variants?
|
162
|
+
!instance_variable_defined?(:@lockbox_encrypted) && super
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
153
166
|
private
|
154
167
|
|
155
168
|
def extract_content_type(io)
|
data/lib/lockbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.5.
|
61
|
+
rubygems_version: 3.5.16
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: Modern encryption for Ruby and Rails
|