Class: Puppet::SSL::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/ssl/validator.rb

Overview

API for certificate verification

Direct Known Subclasses

NoValidator

Defined Under Namespace

Classes: DefaultValidator, NoValidator

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_validatorPuppet::SSL::Validator

Factory method for creating an instance of the default Puppet validator. This method does not have to be implemented by concrete implementations of this API.

Returns:



26
27
28
# File 'lib/puppet/ssl/validator.rb', line 26

def self.default_validator()
  Puppet::SSL::Validator::DefaultValidator.new()
end

.no_validatorPuppet::SSL::Validator

Factory method for creating an instance of a null/no validator. This method does not have to be implemented by concrete implementations of this API.

Returns:



15
16
17
# File 'lib/puppet/ssl/validator.rb', line 15

def self.no_validator()
  @@no_validator_cache ||= Puppet::SSL::Validator::NoValidator.new()
end

Instance Method Details

#peer_certsArray<Puppet::SSL::Certificate>

Array of peer certificates

Returns:

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/puppet/ssl/validator.rb', line 35

def peer_certs
  raise NotImplementedError, "Concrete class should have implemented this method"
end

#setup_connection(connection) ⇒ void

This method returns an undefined value.

Registers the connection to validate.

Parameters:

  • connection (Net::HTTP)

    The connection to validate

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/puppet/ssl/validator.rb', line 56

def setup_connection(connection)
  raise NotImplementedError, "Concrete class should have implemented this method"
end

#verify_errorsArray<String>?

Contains the result of validation

Returns:

  • (Array<String>, nil)

    nil, empty Array, or Array with messages

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/puppet/ssl/validator.rb', line 44

def verify_errors
  raise NotImplementedError, "Concrete class should have implemented this method"
end