auth: LsatAuthenticator -> L402Authenticator
sed -i 's/LsatAuthenticator/L402Authenticator/g' aperture.go auth/authenticator.go auth/authenticator_test.go
rename package lsat to l402
git mv lsat/ l402
sed 's@aperture/lsat@aperture/l402@g' -i `git grep -l aperture/lsat`
sed -i 's@package lsat@package l402@' `git grep -l 'package lsat'`
sed -i 's@lsat\.@l402.@g' -i `git grep -l 'lsat\.'`
sed 's@l402.Id@lsat.Id@' -i mint/mint_test.go
replace lsat with l402 in the code
sed 's@lsat@l402@' -i mint/mint_test.go
sed 's@Lsat@L402@' -i l402/client_interceptor.go
sed 's@lsatstore@l402store@' -i l402/store_test.go
replace LSAT to L402 in comments
sed '/\/\//s@LSAT@L402@g' -i `git grep -l '//.*LSAT'`
replace LSAT -> L402 in the code, skip when a string starts with it
sed 's@\([^"/]\)LSAT@\1L402@g' -i `git grep -l LSAT`
In this commit, we start to set default values for the HTTP timeout
config values. Otherwise, it's possible that TCP connections will never
be closed, causing them to stack up over time, eventually consuming a
lot of memory.
In this commit, we fix a subtle bug in the parsing of the yaml config.
With the way the library works, the attribute name needs to match the
config attribute name. Otherwise, parsing just doesn't work.
The new package contains a new interface (`Challenger`) that any
new challenger must implement.
Because aperture uses the new interface instead of using directly the
`LndChallenger` struct I added the `Stop()` method to the
`mint.Challenger`. Instead of also adding the `Start()` method the constructor
returns a Challenger already "started".
As of Go 1.16, functionality provided in io/ioutil has been depreciated
in favour of the io or os packages. Now that Go has been
upgraded in go.mod, the linter will not pass without these changes.
In this commit, we start a timer if a mailbox stream is completely
un-occupied (neither read or write stream is occupied). The timer
stopped if either of the streams are occupied and is reset if both
streams are unoccupied.
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.
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.
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.
We refactor the main Aperture service code into a struct that can be
started and stopped. This allows aperture to be used more easily as a library in
other projects.
We update the compile time dependency of lnd to version 0.13.0-beta to
make it easier to run aperture in the same process as other projects
which also updated.
The runtime dependency is still kept at v0.12.0-beta as we don't use any
new RPCs.
To make sure we can capture errors in the challenger's invoice
subscription, we hand the main error channel to the challenger so it can
report back errors on it.