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 +4 -4
- data/README.md +1 -1
- data/lib/rails_outofband_keys/railtie.rb +14 -11
- data/lib/rails_outofband_keys/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 36a784436805d0003b9202eee28f1a6fdce3d461f1bd897d35d83c5a19fc1738
|
|
4
|
+
data.tar.gz: da58352c65fdc7e632485518e7430798ff4d8ea9b1b324dbc00149f0d9aa7540
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f18708b2c0ca5d7e3c3250cbb324a631e9adbcf69cdbffd3d528ae8be18c90e774fd191f0b706dd5aff06496c48acf02c4708ee4c7af80f926f00dbeced96dde
|
|
7
|
+
data.tar.gz: 61b7df727a378c470e8fab0bb813f6b9603854804c55f16ddd4b0626c9b8876d564612410d10d8908de8b480671bbbc098ef75d981dedd8a790fd3cd99f0c499
|
data/README.md
CHANGED
|
@@ -10,12 +10,15 @@ module RailsOutofbandKeys
|
|
|
10
10
|
|
|
11
11
|
config.before_configuration do |app|
|
|
12
12
|
# Load file-based configuration.
|
|
13
|
-
config_file =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
app.config.rails_outofband_keys.
|
|
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
|
-
|
|
32
|
-
app.config.credentials.key_path = key_path
|
|
34
|
+
next unless key_path
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|