Class: Zanzibar::Actions::Bundle

Inherits:
Base
  • Object
show all
Defined in:
lib/zanzibar/actions/bundle.rb

Overview

Download or verify the secrets in a Zanzifile

Instance Attribute Summary collapse

Attributes inherited from Base

#logger, #options

Instance Method Summary collapse

Constructor Details

#initialize(ui, options, args = {}) ⇒ Bundle

An action that will fetch secrets defined in a Zanzifile



31
32
33
34
# File 'lib/zanzibar/actions/bundle.rb', line 31

def initialize(ui, options, args = {})
  super(ui, options)
  @update = args[:update]
end

Instance Attribute Details

#local_secretsObject

The resolved secrets from the Zanzifile.resolved



19
20
21
# File 'lib/zanzibar/actions/bundle.rb', line 19

def local_secrets
  @local_secrets
end

#remote_secretsObject

The unresolved secrets from the Zanzifile



15
16
17
# File 'lib/zanzibar/actions/bundle.rb', line 15

def remote_secrets
  @remote_secrets
end

#settingsObject

The settings defined in the Zanzifile



11
12
13
# File 'lib/zanzibar/actions/bundle.rb', line 11

def settings
  @settings
end

#updateObject

Whether to disregard local secrets and re-download regardness



23
24
25
# File 'lib/zanzibar/actions/bundle.rb', line 23

def update
  @update
end

#zanzibar=(value) ⇒ Object

Our Zanzibar client



27
28
29
# File 'lib/zanzibar/actions/bundle.rb', line 27

def zanzibar=(value)
  @zanzibar = value
end

Instance Method Details

#runObject

Coordinate downloading to secrets (or skipping ones we already have)



38
39
40
41
42
43
44
45
46
# File 'lib/zanzibar/actions/bundle.rb', line 38

def run
  ensure_zanzifile
  load_required_secrets
  ensure_secrets_path
  validate_environment
  load_resolved_secrets if resolved_file?
  validate_local_secrets unless @update
  run!
end