Module: SamsonSecretPuller
- Extended by:
- Forwardable
- Defined in:
- lib/samson_secret_puller.rb
Defined Under Namespace
Classes: TimeoutError
Constant Summary collapse
- FOLDER =
'/secrets'.freeze
- TIMEOUT =
60
- ENV =
store a copy since we might replace ENV on Object
ENV
Class Method Summary collapse
- .[]=(key, value) ⇒ Object
-
.replace_ENV! ⇒ Object
When we run in kubernetes we need to read secrets from ENV and secret storage but other parts of the apps or gems do not need to know about this.
- .to_h ⇒ Object
- .to_hash ⇒ Object
Class Method Details
.[]=(key, value) ⇒ Object
29 30 31 |
# File 'lib/samson_secret_puller.rb', line 29 def []=(key, value) ENV[key] = secrets[key] = value end |
.replace_ENV! ⇒ Object
When we run in kubernetes we need to read secrets from ENV and secret storage but other parts of the apps or gems do not need to know about this
35 36 37 38 39 40 41 |
# File 'lib/samson_secret_puller.rb', line 35 def replace_ENV! # rubocop:disable Style/MethodName old = $VERBOSE $VERBOSE = nil Object.const_set(:ENV, self) ensure $VERBOSE = old end |
.to_h ⇒ Object
21 22 23 |
# File 'lib/samson_secret_puller.rb', line 21 def to_h secrets.dup end |
.to_hash ⇒ Object
25 26 27 |
# File 'lib/samson_secret_puller.rb', line 25 def to_hash secrets.dup end |