Class: Ant::SSL::Inventory
- Inherits:
-
Object
- Object
- Ant::SSL::Inventory
- Defined in:
- lib/ant/ssl/inventory.rb
Overview
This provides a full inventory of PKI. It is composed of:
-
Authorities
-
Clients
-
Servers
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
Instance Method Summary collapse
- #ca(name) ⇒ Object
- #create_certificates! ⇒ Object
- #create_directory! ⇒ Object
-
#initialize(defaults, auth, clients, servers) ⇒ Inventory
constructor
A new instance of Inventory.
-
#validate_inventories! ⇒ Object
TODO: Implement validation of inventories.
Constructor Details
#initialize(defaults, auth, clients, servers) ⇒ Inventory
Returns a new instance of Inventory.
19 20 21 22 23 24 |
# File 'lib/ant/ssl/inventory.rb', line 19 def initialize(defaults, auth, clients, servers) @defaults = defaults @authorities = SubInventory.new(auth, self) @clients = SubInventory.new(clients, self) @servers = SubInventory.new(servers, self) end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
17 18 19 |
# File 'lib/ant/ssl/inventory.rb', line 17 def defaults @defaults end |
Instance Method Details
#ca(name) ⇒ Object
41 42 43 |
# File 'lib/ant/ssl/inventory.rb', line 41 def ca(name) @authorities.ca(name) end |
#create_certificates! ⇒ Object
26 27 28 29 30 |
# File 'lib/ant/ssl/inventory.rb', line 26 def create_certificates! validate_inventories! create_directory! [@authorities, @clients, @servers].each(&:create_certificates!) end |
#create_directory! ⇒ Object
37 38 39 |
# File 'lib/ant/ssl/inventory.rb', line 37 def create_directory! FileUtils.mkdir_p(@defaults['saving_directory']) end |
#validate_inventories! ⇒ Object
TODO: Implement validation of inventories
33 34 35 |
# File 'lib/ant/ssl/inventory.rb', line 33 def validate_inventories! true end |