module Puppet::Network::Authorization

Public Class Methods

authconfigloader_class=(klass) click to toggle source

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

  # File lib/puppet/network/authorization.rb
5 def authconfigloader_class=(klass)
6   @authconfigloader_class = klass
7 end
check_external_authorization(method, path) click to toggle source

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

   # File lib/puppet/network/authorization.rb
11 def check_external_authorization(method, path)
12   if @authconfigloader_class.nil?
13     message = "Forbidden request: #{path} (method #{method})"
14     raise Puppet::Network::HTTP::Error::HTTPNotAuthorizedError.new(message, Puppet::Network::HTTP::Issues::FAILED_AUTHORIZATION)
15   end
16 end