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.



7
8
9
# File 'lib/puppet/network/authorization.rb', line 7

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.



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

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