secrets_manager 0.2.3 → 0.2.4

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: c7044e3d12358481c0414e66253dd81da3322d7f31d61563c86844544940a36e
4
- data.tar.gz: 321320718f5a73c4ad80b9ae72b8bbd8624f079e2c73171448d0be5efc3bf4d4
3
+ metadata.gz: d6f78bf44f4a693f45c3f0bb3866fffe8993818670c8bc11fc75576075a62765
4
+ data.tar.gz: 961c7ae680195646c3c7881907b2359ac973ff5a016349cc8752ec0f4e87f151
5
5
  SHA512:
6
- metadata.gz: 1e54c383832408c4860d0ceac95244ff67441a0acf730706cd6a6cfd7a41cc648eba2aa4ad227ccc6e20663a13b5e2eac1806dc32e491285a9ada7becd5258f0
7
- data.tar.gz: aed002a0f43f9b4196972fd38134ea1efeb750151a97a99b60e1a08e81aa0ccf26ea6956ae1a56212e1e98719ea46d93cbfe0c6125e93d5d9c7c2203ebdcd224
6
+ metadata.gz: 2f61ee3edfe91765bdedd24668360b7a92bd427e86fd01e0dc1fc1ecfef7ad5aefff4334ca7338368addc850b68f683ab64bfcd0714840185342730d59f28a2a
7
+ data.tar.gz: 32f9a9da03bb54473a3e761dcdaf2a2b728f866dd00e068f44e3f957cbc3a92136d80dee43272a80b17337b63eb3800d7e15ca11cb62a84fef7663d7458f0d3d
@@ -1,9 +1,12 @@
1
1
  require 'secrets_manager/config'
2
2
  require 'secrets_manager/client'
3
+ require 'secrets_manager/helpers'
3
4
 
4
5
  module SecretsManager
5
6
  class Railtie < ::Rails::Railtie
6
7
  config.before_configuration do
8
+ include SecretsManager::Helpers
9
+
7
10
  unless File.file?(Rails.root.join('config', 'application.yml'))
8
11
  puts 'Initializing secrets via Secrets Manager gem.'
9
12
 
@@ -16,8 +19,12 @@ module SecretsManager
16
19
  secrets_config.secrets.each do |secret|
17
20
  next if File.file?(Rails.root.join(secret.path))
18
21
 
19
- aws_client.get_secret_hash(secret.id).each do |key, value|
20
- ENV[key.to_s] = value
22
+ if secret.plaintext? && secret.to_file?
23
+ write_to_file(aws_client.get_secret_string(secret.id), secret.path)
24
+ else
25
+ aws_client.get_secret_hash(secret.id).each do |key, value|
26
+ ENV[key.to_s] = value
27
+ end
21
28
  end
22
29
  end
23
30
  end
@@ -1,3 +1,3 @@
1
1
  module SecretsManager
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secrets_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - hmatic