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

Class Method Details

.[]=(key, value) ⇒ Object



16
17
18
# File 'lib/samson_secret_puller.rb', line 16

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



26
27
28
29
30
31
32
# File 'lib/samson_secret_puller.rb', line 26

def replace_ENV! # rubocop:disable Style/MethodName
  old = $VERBOSE
  $VERBOSE = nil
  Object.const_set(:ENV, self)
ensure
  $VERBOSE = old
end

.to_hObject



20
21
22
# File 'lib/samson_secret_puller.rb', line 20

def to_h
  secrets
end