Module: Puppet::Network::Authorization

Defined in:
lib/puppet/network/authorization.rb

Class Method Summary collapse

Class Method Details

.authconfigloader_class=(klass) ⇒ Object

This method is deprecated and will be removed in a future release.


5
6
7
# File 'lib/puppet/network/authorization.rb', line 5

def authconfigloader_class=(klass)
  @authconfigloader_class = klass
end

.check_external_authorization(method, path) ⇒ Object

Verify something external to puppet is authorizing REST requests, so we don't fail insecurely due to misconfiguration.


11
12
13
14
15
16
# File 'lib/puppet/network/authorization.rb', line 11

def check_external_authorization(method, path)
  if @authconfigloader_class.nil?
    message = "Forbidden request: #{path} (method #{method})"
    raise Puppet::Network::HTTP::Error::HTTPNotAuthorizedError.new(message, Puppet::Network::HTTP::Issues::FAILED_AUTHORIZATION)
  end
end