activerecord-cipherstash-pg-adapter 0.7.2 → 0.7.3

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: d9bf0b9639a218a5da0dde267803a200993b45d5a1da9893f24e09ec259f9035
4
- data.tar.gz: c8e8a2fc36e7f7aedeea6e18f35726237bd4086c839c70536630d2f7c2938ee6
3
+ metadata.gz: 2464ccf8853d5fac612feff56e44a80350e43f4ceb4ccb4d6831b856ce87842f
4
+ data.tar.gz: 858f184136267da3fd58b95d4b552a7114125fdcc0150091d5924ec49fbdc45b
5
5
  SHA512:
6
- metadata.gz: 4778556b03aacc6573fe0c03d1c348d976ee0e8f03e1f3c6f5e514c8975f7a662c6cb522a531e482f6d3f74ca8fa039eb8faf20fccde4108dad115df389e81f3
7
- data.tar.gz: 191b9afc5308b6bdb8fd2c9ce315b0bad32b8dcec339d11726e0661a1869fa5a03e3ca24b2c0e6d5bba797237935951eee4371e4ba9ebf08c777cf29aea7f991
6
+ metadata.gz: 104094be27bbfd09eb84fe20bd7180791f761bbdef98c4cf25949090fde53b36cf417f354ca6edc495936bc9ef49b91e22bfb0068c5ba2f2d19a38bdfa7975f4
7
+ data.tar.gz: 718f13031ead2fe4b1a24067fab2707acfca52cebb8504f871c8ca2df184ae8f4c22bcd29828d3c2e992a4ffcf0b043257779514872ed276a08f5a9c6401b15c
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ 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
+
9
16
  ## [0.7.2] - 2023-05-02
10
17
 
11
18
  ### Fixed
@@ -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.4"
34
+ spec.add_dependency "cipherstash-pg", ">= 1.0.0.beta.5"
35
35
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ActiveRecord
2
- CIPHERSTASH_PG_ADAPTER_VERSION = "0.7.2"
2
+ CIPHERSTASH_PG_ADAPTER_VERSION = "0.7.3"
3
3
  end
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.2
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-02 00:00:00.000000000 Z
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.4
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.4
46
+ version: 1.0.0.beta.5
47
47
  description: CipherStash PostgreSQL adapter for ActiveRecord.
48
48
  email:
49
49
  - robin@cipherstash.com