Method: Puppet::Network::Authorization.check_external_authorization

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

.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