| In order to switch the http report processor and other server-side termini to using the new HTTP Client API, we need to provide a puppetserver implementation of the API. However, we don't want to introduce an incompatibility in puppet 6.x such that it requires a specific version of puppetserver 6.x to work. So the idea is to create an implementation of the HTTP Client API which adapts the legacy Puppet::Network::HttpPool.http_client_class that puppetserver currently registers. For this ticket: 1. Create Puppet::HTTP::ExternalClient which implements a subset of the Puppet::HTTP::Client API, get and post as those are the only methods implemented in puppetserver 2. All other public methods should raise NotImplementedError, like create_session, put, etc. 3. When get or post are called, the external client should create an instance of Puppet::Network::HttpPool.http_client_class and adapt the Client API to the legacy Connection API. So raise instances of Puppet::HTTP::HTTPError or subclasses, return Puppet::HTTP::Response objects, etc. 4. Register the Puppet::HTTP::ExternalClient in the puppet runtime when the HttpPool.http_client_class= method is called. |