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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f26c45499c84a35d3a4aaeb7043853a4090dd63b2268e128fc0f2713dfc25b09
4
- data.tar.gz: 697626daf2a92ecf69eabc56390074f497ba51a31d1ee24a2a5644c9437d0f09
3
+ metadata.gz: db8c162439dc5376d1aabf48af3925fd2d7a5129e3902b49b973dce9eda16a77
4
+ data.tar.gz: 2e82dc5026e09fdaee0bb1baddabc9b0f8294f38cf613ee09368d62aa39c4ff4
5
5
  SHA512:
6
- metadata.gz: 1b0832e473ba43bb36cc9b11398d20385eae5f94b3a2d13f66a5cc4322605f28bf93a22b9fcb9ac5e171e7004b909b59e0f26d5a75d1be6561c61bbdf054c65e
7
- data.tar.gz: 77995606e64719168bb0688215721e89c84b7ce9b758e49dbbb1beeecd460ca85c129089c8f1f160320ead16cbe64bd7eb2fb72491d7e9575ac392ef11ca492b
6
+ metadata.gz: e8d6d9a2c4661767c01ab8874f29c3fd705712d4f3d6d153e09b4c7ad6441bb0812d45c6cf526d3a59177ae23c44289b1aa375e462303c17fcb952edd4641a8e
7
+ data.tar.gz: 2e5cd80ddca65447f10a666b5568bbdeff449bf6517c944a67f6fdfdd5ff253e7560569133216a5459d1519ad3bb72b5cabd17065240a2aa1091750e21b4c26c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.0 (2023-07-02)
2
+
3
+ - Added support for CarrierWave 3
4
+
1
5
  ## 1.2.0 (2023-03-20)
2
6
 
3
7
  - Made it easier to rotate master key
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 > 2
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"
@@ -1,3 +1,3 @@
1
1
  module Lockbox
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
data/lib/lockbox.rb CHANGED
@@ -5,17 +5,17 @@ require "securerandom"
5
5
  require "stringio"
6
6
 
7
7
  # modules
8
- require "lockbox/aes_gcm"
9
- require "lockbox/box"
10
- require "lockbox/calculations"
11
- require "lockbox/encryptor"
12
- require "lockbox/key_generator"
13
- require "lockbox/io"
14
- require "lockbox/migrator"
15
- require "lockbox/model"
16
- require "lockbox/padding"
17
- require "lockbox/utils"
18
- require "lockbox/version"
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
- require "lockbox/carrier_wave_extensions" if defined?(CarrierWave)
92
- require "lockbox/railtie" if defined?(Rails)
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
- require "lockbox/log_subscriber"
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.2.0
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-03-20 00:00:00.000000000 Z
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.6
61
+ rubygems_version: 3.4.10
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Modern encryption for Ruby and Rails