onboardbase 1.0.9 → 1.1.0
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/lib/onboardbase/version.rb +1 -1
- data/lib/onboardbase.rb +24 -0
- 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: b1743af3711480fa93000360faf5c480e9c101f1bc740cc7c6bac47868e10644
|
4
|
+
data.tar.gz: 980fc8ef15b92af76d7d8e880bce2b6421b8d6a58f814a3f8065da4aef0fcc51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0086f2e904bda6b4fa091d11fca7792cd21da8957ac75830764d7b89707e6309fc11633ea57367aceb8740b6bad46a6655973eb2e997590ed62d1be26ce7edc
|
7
|
+
data.tar.gz: 78db52e399e86484cbd7e04120b7b6919f2dff885295e948a48e9796bd2d8226a23ba964b4dcc5fb3e8a27d74a5a93639b5e1f307b6437142e6846a66fe7ec10
|
data/lib/onboardbase/version.rb
CHANGED
data/lib/onboardbase.rb
CHANGED
@@ -246,6 +246,30 @@ module Onboardbase
|
|
246
246
|
JSON.parse(decoded_data)
|
247
247
|
end
|
248
248
|
|
249
|
+
def content_path
|
250
|
+
ENV["RAILS_ENV"] ? "config/credentials/#{ENV["RAILS_ENV"]}.yml.enc" : "config/credentials.yml.enc"
|
251
|
+
end
|
252
|
+
|
253
|
+
def key_path
|
254
|
+
ENV["RAILS_ENV"] ? "config/credentials/#{ENV["RAILS_ENV"]}.key" : "config/master.key"
|
255
|
+
end
|
256
|
+
|
257
|
+
def loadAsCredentials
|
258
|
+
require "active_support/encrypted_configuration"
|
259
|
+
credentials = ActiveSupport::EncryptedConfiguration.new(
|
260
|
+
config_path: self.content_path,
|
261
|
+
key_path: self.key_path,
|
262
|
+
env_key: "RAILS_MASTER_KEY",
|
263
|
+
raise_if_missing_key: true
|
264
|
+
)
|
265
|
+
|
266
|
+
secrets = YAML.load(credentials.read)
|
267
|
+
secrets.keys.sort.each do |key|
|
268
|
+
ENV["#{key}"] = "#{secrets[key]}"
|
269
|
+
end
|
270
|
+
credentials.write(ENV.to_hash.to_yaml)
|
271
|
+
end
|
272
|
+
|
249
273
|
def loadSecrets
|
250
274
|
self.loadConfig
|
251
275
|
response = self.parseResponse?(self.makeRequest)
|