Class: Dependencies::Sshkey

Inherits:
Dependency show all
Defined in:
lib/dependencies/sshkey.rb

Constant Summary collapse

DEFAULT_KEY_SIZE =
2048
DEFAULT_KEY_ALGO =
"rsa"
DEFAULT_KEY_LIFETIME_S =
3600

Constants inherited from Dependency

Dependency::DESCRIPTION_TYPE_WIDTH

Instance Attribute Summary

Attributes inherited from Dependency

#name

Instance Method Summary collapse

Methods inherited from Dependency

#always_act?, #exit_code, #initialize, #output, #success?, #type

Constructor Details

This class inherits a constructor from Dependency

Instance Method Details

#meetObject



18
19
20
21
22
23
24
25
26
# File 'lib/dependencies/sshkey.rb', line 18

def meet
	Secrets.load

	Output.warn("\nNo passphrase set for SSH key '#{priv_key_name}'") if passphrase.nil? || passphrase.empty?

	FileUtils.mkdir_p(dir_name) unless File.directory?(dir_name)
	generate_key unless File.exist?(priv_key_name) && File.exist?(pub_key_name)
	add_key if success? && should_add_key?
end

#met?Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/dependencies/sshkey.rb', line 13

def met?
	# we always need to at least update the key lifetime in the agent
	false
end

#should_meet?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/dependencies/sshkey.rb', line 32

def should_meet?
	true
end

#unmeetObject



28
29
30
# File 'lib/dependencies/sshkey.rb', line 28

def unmeet
	true
end