Class: SecretBroker::EJsonSecretsFile
- Inherits:
-
Object
- Object
- SecretBroker::EJsonSecretsFile
- Defined in:
- lib/secret_broker/ejson_secrets_file.rb
Instance Method Summary collapse
-
#initialize(env) ⇒ EJsonSecretsFile
constructor
A new instance of EJsonSecretsFile.
- #to_h ⇒ Object
Constructor Details
#initialize(env) ⇒ EJsonSecretsFile
Returns a new instance of EJsonSecretsFile.
6 7 8 |
# File 'lib/secret_broker/ejson_secrets_file.rb', line 6 def initialize(env) @env = env end |
Instance Method Details
#to_h ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/secret_broker/ejson_secrets_file.rb', line 10 def to_h return {} unless file_path.file? stdout_str, stderr_str, status = Open3.capture3 "ejson decrypt #{file_path.to_path}" fail "ejson decrypt did not run successfully. stderr: #{stderr_str}" unless status.success? JSON.parse stdout_str end |