activerecord-cipherstash-pg-adapter 0.6.0 → 0.6.1

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: f49b439e9bfe2874fc67bf0f4064ba66a3659a9e67b207e156ddb2b3cf8c5bb2
4
- data.tar.gz: 02347f9e3efe1f15da8dd6c11e8745c424d7dd9f65b493640ea57f41370dd7b3
3
+ metadata.gz: 3b22c3a2c87a993eaf0833dd013954e25925e6675cec8ff40798ad4ee932db0e
4
+ data.tar.gz: fc7ed2b4e78b808d1e0618a4d2db0897dd053ff022115037f46035bbd2afa8e4
5
5
  SHA512:
6
- metadata.gz: 703fb309bb186e2350856b0f5fabae1e373685e13552afb53cfb04fb2630866f271cbbf2efebe305e9a06bc5f62dbc3808379d2037286e4af42a9052bae8185a
7
- data.tar.gz: 5885728f591239c6f6893dbd9f2b19bb75976bd01237fedb24a9fcf42804ce78315b5da1831af0cf35961ea6210c072fc28c520bfbc703157cd163dc369a9c60
6
+ metadata.gz: 077cb9e80c55e8ec7f8677e273cdab265ac32eae95270cdbed7f6805591f793bb7482d51b288029dc8365b5f52d58405f7c69606464351ef3d014e582bbd6c18
7
+ data.tar.gz: c4da8c6e9f12e0fa96c4a5c32a78bdc3f3028d27e189062971c5db4e0730bbe823690cd4ed80f332c5f335bd5294003e43d4e054f29ba38d5d3ce4db2dc147e6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.6.1] - 2023-04-26
4
+
5
+ ### Fixed
6
+
7
+ - Removed Rails as a hard dependency
8
+
3
9
  ## [0.6.0] - 2023-04-20
4
10
 
5
11
  ### Changed
@@ -0,0 +1,40 @@
1
+ require 'rails'
2
+
3
+ module ActiveRecord
4
+ module ConnectionAdapters
5
+ module CipherStashPG
6
+ class Railtie < ::Rails::Railtie
7
+ rake_tasks do
8
+ load "cipherstash_tasks.rake"
9
+ end
10
+
11
+ initializer "postgres_cipherstash_adapter.configure" do
12
+ if defined?(Rails.application.credentials)
13
+ cs_credentials = Rails.application.credentials.try(:cipherstash)
14
+
15
+ client_id = cs_credentials&.fetch(:client_id, nil)
16
+ client_key = cs_credentials&.fetch(:client_key, nil)
17
+ workspace_id = cs_credentials&.fetch(:workspace_id, nil)
18
+ client_access_key = cs_credentials&.fetch(:client_access_key, nil)
19
+
20
+ unless client_id.nil?
21
+ ENV["CS_CLIENT_ID"] = client_id
22
+ end
23
+
24
+ unless client_key.nil?
25
+ ENV["CS_CLIENT_KEY"] = client_key
26
+ end
27
+
28
+ unless workspace_id.nil?
29
+ ENV["CS_WORKSPACE_ID"] = workspace_id
30
+ end
31
+
32
+ unless client_access_key.nil?
33
+ ENV["CS_CLIENT_ACCESS_KEY"] = client_access_key
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -31,13 +31,12 @@
31
31
 
32
32
  require "cipherstash-pg"
33
33
 
34
- case Rails::VERSION::MAJOR
34
+ case ActiveRecord::VERSION::MAJOR
35
35
  when 7
36
36
  require "active_record/connection_adapters/7.0/postgres_cipherstash_adapter"
37
37
  when 6
38
38
  require "active_record/connection_adapters/6.1/postgres_cipherstash_adapter"
39
39
  else
40
- STDERR.puts "CipherStash only supports Rails versions 6.x and 7.x"
40
+ STDERR.puts "CipherStash only supports ActiveRecord versions 6.x and 7.x"
41
41
  exit 1
42
42
  end
43
-
@@ -3,43 +3,11 @@ require "active_record"
3
3
 
4
4
  require "active_record/connection_adapters/cipherstash_pg/database_extensions"
5
5
  require "active_record/connection_adapters/cipherstash_pg/database_tasks"
6
+ require "active_record/connection_adapters/cipherstash_pg/railtie" if defined?(Rails::Railtie)
6
7
 
7
8
  module ActiveRecord
8
9
  module ConnectionAdapters
9
10
  module CipherStashPG
10
- class Railtie < ::Rails::Railtie
11
- rake_tasks do
12
- load "cipherstash_tasks.rake"
13
- end
14
-
15
- initializer "postgres_cipherstash_adapter.configure" do
16
- if defined?(Rails.application.credentials)
17
- cs_credentials = Rails.application.credentials.try(:cipherstash)
18
-
19
- client_id = cs_credentials&.fetch(:client_id, nil)
20
- client_key = cs_credentials&.fetch(:client_key, nil)
21
- workspace_id = cs_credentials&.fetch(:workspace_id, nil)
22
- client_access_key = cs_credentials&.fetch(:client_access_key, nil)
23
-
24
- unless client_id.nil?
25
- ENV["CS_CLIENT_ID"] = client_id
26
- end
27
-
28
- unless client_key.nil?
29
- ENV["CS_CLIENT_KEY"] = client_key
30
- end
31
-
32
- unless workspace_id.nil?
33
- ENV["CS_WORKSPACE_ID"] = workspace_id
34
- end
35
-
36
- unless client_access_key.nil?
37
- ENV["CS_CLIENT_ACCESS_KEY"] = client_access_key
38
- end
39
- end
40
- end
41
- end
42
-
43
11
  # Method to install CipherStash custom ORE types
44
12
  def self.install
45
13
  CipherStashPG::DatabaseExtensions.install
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ActiveRecord
2
- CIPHERSTASH_PG_ADAPTER_VERSION = "0.6.0"
2
+ CIPHERSTASH_PG_ADAPTER_VERSION = "0.6.1"
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.6.0
4
+ version: 0.6.1
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-04-20 00:00:00.000000000 Z
11
+ date: 2023-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -138,6 +138,7 @@ files:
138
138
  - lib/active_record/connection_adapters/cipherstash_column_mapper.rb
139
139
  - lib/active_record/connection_adapters/cipherstash_pg/database_extensions.rb
140
140
  - lib/active_record/connection_adapters/cipherstash_pg/database_tasks.rb
141
+ - lib/active_record/connection_adapters/cipherstash_pg/railtie.rb
141
142
  - lib/active_record/connection_adapters/postgres_cipherstash_adapter.rb
142
143
  - lib/activerecord-cipherstash-pg-adapter.rb
143
144
  - lib/cipherstash_tasks.rake