Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-2780

Provide a server impl of the new Puppet http client

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: SERVER 7.0.0
    • Component/s: None
    • Template:
    • Team:
      Froyo
    • Sprint:
      Froyo 2020/10/26
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      Puppet Server now provides an HTTP client whose API conforms to the HTTP client provided by Puppet. This new client is stored in the Puppet runtime as `Puppet.runtime[:http]`.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Currently Puppet Server implements a wrapper around the Apache AsyncHttp library (with help from the puppetlabs/clj-http-client library).

      Coremmunity has reworked the http client in Puppet and the contract that extensions should implement (like there is one now).

      We should create a new HttpClient in Puppet Server that implements the new interface and if the new interface is available we should configure Puppet with it.

      Here are some notes from previous discussions:

      I was thinking puppetserver could register its client (similar to the existing `Puppet::Server::HttpClient`) but with the following differences:

      • A Puppet::Server::HttpClient object is created for a given server/port/use_ssl, and later the request path/query parameters/headers are passed to the get/post method. With the new API, the get/post methods receive the full URL.
      • The existing Puppet::Server::HttpClient maps HTTP response codes back to Net::HTTP, but that's no longer necessary. Puppetserver can create a Puppet::HTTP::Response object directly with the status code, message, etc. and return that (or a subclass of it)
      • The client can raise `Puppet::HTTP::HTTPError` or more specific subclasses if it wants instead of deriving from SocketError
         
        Example implementation registration: https://gist.github.com/joshcooper/98344933dbd8c44d63acd9183e1481b3

       
      Whoever picks this up should reach out to Josh Cooper for further details.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              maggie Maggie Dreyer
              Reporter:
              justin Justin Stoller
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support