activerecord-cipherstash-pg-adapter 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2464ccf8853d5fac612feff56e44a80350e43f4ceb4ccb4d6831b856ce87842f
|
4
|
+
data.tar.gz: 858f184136267da3fd58b95d4b552a7114125fdcc0150091d5924ec49fbdc45b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 104094be27bbfd09eb84fe20bd7180791f761bbdef98c4cf25949090fde53b36cf417f354ca6edc495936bc9ef49b91e22bfb0068c5ba2f2d19a38bdfa7975f4
|
7
|
+
data.tar.gz: 718f13031ead2fe4b1a24067fab2707acfca52cebb8504f871c8ca2df184ae8f4c22bcd29828d3c2e992a4ffcf0b043257779514872ed276a08f5a9c6401b15c
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.7.3] - 2023-05-11
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Exit out of the migration rake task if the CipherStash adapter is not being used.
|
14
|
+
- Bump version of cipherstash-pg to 1.0.0.beta.5.
|
15
|
+
|
16
|
+
## [0.7.2] - 2023-05-02
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Fix more module names in ActiveRecord v6 adapter (`CipherstashPG` -> `CiphStashPG`).
|
21
|
+
|
9
22
|
## [0.7.1] - 2023-05-02
|
10
23
|
|
11
24
|
### Changed
|
@@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
|
|
31
31
|
|
32
32
|
# Runtime dependencies here; dev+test go in Gemfile.
|
33
33
|
spec.add_dependency "activerecord", ">= 6.0.0", "< 8.0.0"
|
34
|
-
spec.add_dependency "cipherstash-pg", ">= 1.0.0.beta.
|
34
|
+
spec.add_dependency "cipherstash-pg", ">= 1.0.0.beta.5"
|
35
35
|
end
|
@@ -924,7 +924,7 @@ module ActiveRecord
|
|
924
924
|
|
925
925
|
@type_map_for_results = ::CipherStashPG::TypeMapByOid.new
|
926
926
|
@type_map_for_results.default_type_map = map
|
927
|
-
@type_map_for_results.add_coder(::
|
927
|
+
@type_map_for_results.add_coder(::CipherStashPG::TextDecoder::Bytea.new(oid: 17, name: "bytea"))
|
928
928
|
@type_map_for_results.add_coder(MoneyDecoder.new(oid: 790, name: "money"))
|
929
929
|
|
930
930
|
# extract timestamp decoder for use in update_typemap_for_default_timezone
|
@@ -937,7 +937,7 @@ module ActiveRecord
|
|
937
937
|
coder_class.new(oid: row["oid"].to_i, name: row["typname"])
|
938
938
|
end
|
939
939
|
|
940
|
-
class MoneyDecoder < ::
|
940
|
+
class MoneyDecoder < ::CipherStashPG::SimpleDecoder # :nodoc:
|
941
941
|
TYPE = OID::Money.new
|
942
942
|
|
943
943
|
def decode(value, tuple = nil, field = nil)
|
data/lib/cipherstash_tasks.rake
CHANGED
@@ -4,6 +4,17 @@ require "logger"
|
|
4
4
|
namespace :cipherstash do
|
5
5
|
desc "Re-saves a model to migrate it when its config is set to encrypted-duplicate."
|
6
6
|
task :migrate, [:model_name, :batch_size] => "db:load_config" do |_task, args|
|
7
|
+
logger = Logger.new(STDOUT)
|
8
|
+
|
9
|
+
config = ActiveRecord::Base.connection_db_config
|
10
|
+
adapter = config.configuration_hash[:adapter]
|
11
|
+
|
12
|
+
unless adapter == "postgres_cipherstash"
|
13
|
+
logger.warn "This application is using the '#{adapter}' database adapter\n\n"
|
14
|
+
|
15
|
+
abort "To use this rake task, please update the database adapter to 'postgres_cipherstash'\n\n\n\n"
|
16
|
+
end
|
17
|
+
|
7
18
|
model_name = args[:model_name]
|
8
19
|
batch_size = args[:batch_size] || 1000
|
9
20
|
|
@@ -13,10 +24,9 @@ namespace :cipherstash do
|
|
13
24
|
model = Object.const_get(model_name) # raises NameError on failure
|
14
25
|
|
15
26
|
unless model < ActiveRecord::Base
|
16
|
-
abort "Not an ActiveRecord model: #{model_name}"
|
27
|
+
abort "Not an ActiveRecord model: #{model_name}"
|
17
28
|
end
|
18
29
|
|
19
|
-
logger = Logger.new(STDOUT)
|
20
30
|
logger.info "Migrating #{model_name} in batches of #{batch_size}."
|
21
31
|
|
22
32
|
primary_keys = Array(model.primary_key)
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-cipherstash-pg-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Howard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 1.0.0.beta.
|
39
|
+
version: 1.0.0.beta.5
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.0.0.beta.
|
46
|
+
version: 1.0.0.beta.5
|
47
47
|
description: CipherStash PostgreSQL adapter for ActiveRecord.
|
48
48
|
email:
|
49
49
|
- robin@cipherstash.com
|