Class: Facts::Windows::SshfpAlgorithm

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/facts/windows/sshfp_algorithm.rb

Constant Summary collapse

FACT_NAME =
'sshfp_.*'
TYPE =
:legacy

Instance Method Summary collapse

Instance Method Details

#call_the_resolverObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/facter/facts/windows/sshfp_algorithm.rb', line 9

def call_the_resolver
  facts = []
  privileged = Facter::Resolvers::Identity.resolve(:privileged)

  return facts unless privileged

  result = Facter::Resolvers::Windows::Ssh.resolve(:ssh)

  result&.each do |ssh|
    facts << Facter::ResolvedFact.new("sshfp_#{ssh.name.to_sym}",
                                      "#{ssh.fingerprint.sha1}\n#{ssh.fingerprint.sha256}", :legacy)
  end
  facts
end