lockbox 1.2.0 → 1.3.0
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 +8 -0
- data/lib/lockbox/carrier_wave_extensions.rb +1 -1
- data/lib/lockbox/version.rb +1 -1
- data/lib/lockbox.rb +14 -14
- 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: db8c162439dc5376d1aabf48af3925fd2d7a5129e3902b49b973dce9eda16a77
|
4
|
+
data.tar.gz: 2e82dc5026e09fdaee0bb1baddabc9b0f8294f38cf613ee09368d62aa39c4ff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d6d9a2c4661767c01ab8874f29c3fd705712d4f3d6d153e09b4c7ad6441bb0812d45c6cf526d3a59177ae23c44289b1aa375e462303c17fcb952edd4641a8e
|
7
|
+
data.tar.gz: 2e5cd80ddca65447f10a666b5568bbdeff449bf6517c944a67f6fdfdd5ff253e7560569133216a5459d1519ad3bb72b5cabd17065240a2aa1091750e21b4c26c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -895,6 +895,14 @@ lockbox.decrypt(ciphertext, associated_data: "somecontext") # success
|
|
895
895
|
lockbox.decrypt(ciphertext, associated_data: "othercontext") # fails
|
896
896
|
```
|
897
897
|
|
898
|
+
You can also use it with database fields and files.
|
899
|
+
|
900
|
+
```ruby
|
901
|
+
class User < ApplicationRecord
|
902
|
+
has_encrypted :email, associated_data: -> { code }
|
903
|
+
end
|
904
|
+
```
|
905
|
+
|
898
906
|
## Binary Columns
|
899
907
|
|
900
908
|
You can use `binary` columns for the ciphertext instead of `text` columns.
|
@@ -105,7 +105,7 @@ module Lockbox
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
if CarrierWave::VERSION.to_i >
|
108
|
+
if CarrierWave::VERSION.to_i > 3
|
109
109
|
raise Lockbox::Error, "CarrierWave #{CarrierWave::VERSION} not supported in this version of Lockbox"
|
110
110
|
elsif CarrierWave::VERSION.to_i < 1
|
111
111
|
raise Lockbox::Error, "CarrierWave #{CarrierWave::VERSION} not supported"
|
data/lib/lockbox/version.rb
CHANGED
data/lib/lockbox.rb
CHANGED
@@ -5,17 +5,17 @@ require "securerandom"
|
|
5
5
|
require "stringio"
|
6
6
|
|
7
7
|
# modules
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
8
|
+
require_relative "lockbox/aes_gcm"
|
9
|
+
require_relative "lockbox/box"
|
10
|
+
require_relative "lockbox/calculations"
|
11
|
+
require_relative "lockbox/encryptor"
|
12
|
+
require_relative "lockbox/key_generator"
|
13
|
+
require_relative "lockbox/io"
|
14
|
+
require_relative "lockbox/migrator"
|
15
|
+
require_relative "lockbox/model"
|
16
|
+
require_relative "lockbox/padding"
|
17
|
+
require_relative "lockbox/utils"
|
18
|
+
require_relative "lockbox/version"
|
19
19
|
|
20
20
|
module Lockbox
|
21
21
|
class Error < StandardError; end
|
@@ -88,11 +88,11 @@ module Lockbox
|
|
88
88
|
end
|
89
89
|
|
90
90
|
# integrations
|
91
|
-
|
92
|
-
|
91
|
+
require_relative "lockbox/carrier_wave_extensions" if defined?(CarrierWave)
|
92
|
+
require_relative "lockbox/railtie" if defined?(Rails)
|
93
93
|
|
94
94
|
if defined?(ActiveSupport::LogSubscriber)
|
95
|
-
|
95
|
+
require_relative "lockbox/log_subscriber"
|
96
96
|
Lockbox::LogSubscriber.attach_to :lockbox
|
97
97
|
end
|
98
98
|
|
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
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-02 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.4.
|
61
|
+
rubygems_version: 3.4.10
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: Modern encryption for Ruby and Rails
|