To avoid running into an issue in the race unit test with the Prometheus
histogram metrics that aren't concurrency safe, we don't register any of
them if Prometheus isn't enabled in the first place.
This shouldn't be an issue in production, since we don't start multiple
instances of Aperture _within the same process_ at the same time.
Set the ping and pong intervals of the websocket proxy to zero in order
to disable them. This is needed since a browser client is unable to
respond to these pings.
With this commit we fix a bug in the hashmail server that didn't return
a read stream properly if it was closed from the client side.
Co-authored-by: Elle Mouton <elle.mouton@gmail.com>
We want aperture to handle some of the incoming requests on its own,
without forwarding/proxying them to a remote backend. Those "local"
services can register themselves and will be given every request for
inspection. If a service decides to handle it locally, the request is
passed to that service and not forwarded.
Our yaml parsing is unaffected, but this change allows us to specify
these groups one param at a time. We do not update services because they
require special grouping, so we leave that as a json parameter.
This commit adds a DynamicPrice member to the Services struct and uses
its values to determine if a GRPCPricer or DefaultPricer should be
initialised. The commit also updates the sample-conf.yaml file with the
new config options.
This commit adds a new pricer package which contains a Pricer interface
and two implementations of the interface. The Pricer interface can be
used to query the price of a certain path. The two implementations are
as follows: a DefaultPricer which returns the same price for all paths
of a service, and a GRPCPricer which queries a backend grpc server for
the price of a given path.
This commit adds the proto definitions along with the generated proto
files for a prices service that can be used to request the price of a
specific path.
To make it easier to use aperture in a setup where we only need its
proxy functionality but not its LSAT capabilities, we add the option to
disable the authenticator. This makes it possible to run aperture
without needing to connect it to an lnd node.