activerecord-cipherstash-pg-adapter 0.5.0 → 0.6.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: 1a76ecda67534aee78fe658b78c5ba3f7834f59c229b7391d75fd736d7aa4e23
4
- data.tar.gz: 13284339b37ab578d8ce181a9c291bb4826f556caedbac55f9cc2b9cb1fb3084
3
+ metadata.gz: f49b439e9bfe2874fc67bf0f4064ba66a3659a9e67b207e156ddb2b3cf8c5bb2
4
+ data.tar.gz: 02347f9e3efe1f15da8dd6c11e8745c424d7dd9f65b493640ea57f41370dd7b3
5
5
  SHA512:
6
- metadata.gz: 9644a5705b513fa4356f193995fc5b462acac8d66fba7c02031a51e3a0ad2e864865d84f561ea70ec0582129815a38920b3e557c1a29753597c86f0346c6d5df
7
- data.tar.gz: cc240e5e9b255e4075cfc9ea13c40cf9b5715b8cd1b4a82f4dff8b98ae9112999413afaff9a10984947a2629d334868d95888e36b5ff3ea29fb82d5f29344ee4
6
+ metadata.gz: 703fb309bb186e2350856b0f5fabae1e373685e13552afb53cfb04fb2630866f271cbbf2efebe305e9a06bc5f62dbc3808379d2037286e4af42a9052bae8185a
7
+ data.tar.gz: 5885728f591239c6f6893dbd9f2b19bb75976bd01237fedb24a9fcf42804ce78315b5da1831af0cf35961ea6210c072fc28c520bfbc703157cd163dc369a9c60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.6.0] - 2023-04-20
4
+
5
+ ### Changed
6
+
7
+ - Updated the adapter name constant to be the same as the ActiveRecord PostgreSQL adapter.
8
+
9
+ ### Fixed
10
+
11
+ - Logic around Rails credentials taking precedence over local env vars.
12
+
3
13
  ## [0.5.0] - 2023-04-19
4
14
 
5
15
  ### Added
@@ -53,7 +53,7 @@ module ActiveRecord
53
53
 
54
54
  module ConnectionAdapters
55
55
  class CipherStashPGAdapter < AbstractAdapter
56
- ADAPTER_NAME = "CipherStash PostgreSQL"
56
+ ADAPTER_NAME = "PostgreSQL"
57
57
 
58
58
  class << self
59
59
  def new_client(conn_params)
@@ -54,7 +54,7 @@ module ActiveRecord
54
54
 
55
55
  module ConnectionAdapters
56
56
  class CipherStashPGAdapter < AbstractAdapter
57
- ADAPTER_NAME = "CipherStash PostgreSQL"
57
+ ADAPTER_NAME = "PostgreSQL"
58
58
 
59
59
  class << self
60
60
  def new_client(conn_params)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  # Why the funky filename
4
- # (lib/active_record/connection_adapters/cipherstash_pg_adapter.rb)
4
+ # (lib/active_record/connection_adapters/postgres_cipherstash_adapter.rb)
5
5
  # that doesn't match the gem structure? It's to hook into Rails.
6
6
  #
7
7
  # See this chunk from:
@@ -15,10 +15,27 @@ module ActiveRecord
15
15
  initializer "postgres_cipherstash_adapter.configure" do
16
16
  if defined?(Rails.application.credentials)
17
17
  cs_credentials = Rails.application.credentials.try(:cipherstash)
18
- ENV["CS_CLIENT_ID"] = cs_credentials&.fetch(:client_id, nil)
19
- ENV["CS_CLIENT_KEY"] = cs_credentials&.fetch(:client_key, nil)
20
- ENV["CS_WORKSPACE_ID"] = cs_credentials&.fetch(:workspace_id, nil)
21
- ENV["CS_CLIENT_ACCESS_KEY"] = cs_credentials&.fetch(:client_access_key, nil)
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
22
39
  end
23
40
  end
24
41
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ActiveRecord
2
- CIPHERSTASH_PG_ADAPTER_VERSION = "0.5.0"
2
+ CIPHERSTASH_PG_ADAPTER_VERSION = "0.6.0"
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.5.0
4
+ version: 0.6.0
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-19 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord