rails_outofband_keys 0.1.2 → 0.1.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: ba17a3f37978f5480cbfe4eaf2c9b630fb977d87d38adadc800f096c28d17463
4
- data.tar.gz: 3bb26e6d5e3167a057ddfc290c5f1dc58ee32fa706ed98b47036ee6cb2076354
3
+ metadata.gz: 36a784436805d0003b9202eee28f1a6fdce3d461f1bd897d35d83c5a19fc1738
4
+ data.tar.gz: da58352c65fdc7e632485518e7430798ff4d8ea9b1b324dbc00149f0d9aa7540
5
5
  SHA512:
6
- metadata.gz: fc1f6e8e74b6a7a4db2de13548afc0a1457ce7efd83af383dbadf94b9b82bb4d18463a4ca51299811b7e6b3730c8b4bb84d2b39b4fad07e12c56e4bee231c7a8
7
- data.tar.gz: dcd71239e65d5fc21d89ffa94d409610b7ab3cb599ce1a139746cd4247ea60cb2560da0c15e0db67be6ed901e4355e779ee23a9b45c01340a6632430fa63dfc5
6
+ metadata.gz: f18708b2c0ca5d7e3c3250cbb324a631e9adbcf69cdbffd3d528ae8be18c90e774fd191f0b706dd5aff06496c48acf02c4708ee4c7af80f926f00dbeced96dde
7
+ data.tar.gz: 61b7df727a378c470e8fab0bb813f6b9603854804c55f16ddd4b0626c9b8876d564612410d10d8908de8b480671bbbc098ef75d981dedd8a790fd3cd99f0c499
data/README.md CHANGED
@@ -56,7 +56,7 @@ On Unix-like systems, key files **must** have secure permissions. They must be o
56
56
  Add the gem to your Gemfile:
57
57
 
58
58
  ```ruby
59
- gem "rails_outofband_keys", "~> 0.1.1"
59
+ gem "rails_outofband_keys"
60
60
  ```
61
61
 
62
62
  ## License
@@ -10,12 +10,15 @@ module RailsOutofbandKeys
10
10
 
11
11
  config.before_configuration do |app|
12
12
  # Load file-based configuration.
13
- config_file = File.join(Dir.getwd, "config", "rails_outofband_keys.yml")
14
-
15
- if File.exist?(config_file)
16
- external_config = YAML.load_file(config_file)
17
- app.config.rails_outofband_keys.root_subdir = external_config["root_subdir"]
18
- app.config.rails_outofband_keys.credentials_subdir = external_config.fetch("credentials_subdir", "credentials")
13
+ config_file = app.root.join("config", "rails_outofband_keys.yml")
14
+ if config_file.file?
15
+ data = YAML.safe_load_file(config_file.to_s, permitted_classes: [], aliases: false)
16
+ data = {} unless data.is_a?(Hash)
17
+
18
+ app.config.rails_outofband_keys.root_subdir = data["root_subdir"]
19
+ if data.key?("credentials_subdir")
20
+ app.config.rails_outofband_keys.credentials_subdir = data["credentials_subdir"]
21
+ end
19
22
  end
20
23
 
21
24
  # Identify the app name for path resolution.
@@ -28,12 +31,12 @@ module RailsOutofbandKeys
28
31
  )
29
32
 
30
33
  key_path = resolver.resolve_key_path
31
- if key_path
32
- app.config.credentials.key_path = key_path
34
+ next unless key_path
33
35
 
34
- # Clear any early-cached credentials object to ensure the new path is used.
35
- app.remove_instance_variable(:@credentials) if app.instance_variable_defined?(:@credentials)
36
- end
36
+ app.config.credentials.key_path = key_path
37
+
38
+ # Clear any early-cached credentials object to ensure the new path is used.
39
+ app.remove_instance_variable(:@credentials) if app.instance_variable_defined?(:@credentials)
37
40
  end
38
41
  end
39
42
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsOutofbandKeys
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_outofband_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lori Holden