Commit Graph

49 Commits

Author SHA1 Message Date
Oliver Gugger
8b731e87e4 Merge pull request #19 from guggero/server-interceptor
auth: add server interceptor
2020-01-07 14:37:48 +01:00
Oliver Gugger
a402e403bc auth+log: add log subsystem name as constant 2020-01-07 14:37:07 +01:00
Oliver Gugger
45e4bb49d5 auth: add server interceptor 2020-01-07 14:37:07 +01:00
Oliver Gugger
02584d1f38 mod: update to latest loop and lnd versions 2020-01-03 16:44:08 +01:00
Oliver Gugger
f4d62e0a7f Merge pull request #17 from guggero/makefile
make: add Makefile and linter configuration
2019-12-04 11:00:21 +01:00
Oliver Gugger
c6c62b9472 multi: fix all linter errors 2019-12-04 10:58:04 +01:00
Oliver Gugger
41cd93c319 make: add Makefile and linter configuration 2019-12-04 10:47:59 +01:00
Oliver Gugger
a6a5a0e302 Merge pull request #16 from guggero/auth-whitelist
proxy: add authentication whitelist
2019-12-04 10:46:39 +01:00
Oliver Gugger
b60460feee proxy: add test for auth whitelist 2019-12-04 10:45:08 +01:00
Oliver Gugger
51c7deac05 proxy: replace certificate generation with cert package 2019-12-04 10:45:07 +01:00
Oliver Gugger
c2e9d540ba proxy: add auth whitelist for paths 2019-12-04 10:45:07 +01:00
Oliver Gugger
3e2d486f75 auth: add auth level constant 2019-11-29 17:12:53 +01:00
Oliver Gugger
d58c70588d auth: remove unused constant 2019-11-29 16:15:40 +01:00
Oliver Gugger
8928e68bf2 Merge pull request #12 from wpaulino/lsat-mint
multi: introduce proper LSAT creation and verification
2019-11-28 14:25:46 +01:00
Wilmer Paulino
831a41b33e macaroons: remove temporary macaroon creation and verification logic 2019-11-26 11:14:11 -08:00
Wilmer Paulino
530894a5ed auth: remove unused Challenger interface 2019-11-26 11:13:45 -08:00
Wilmer Paulino
38cd0e7847 auth: integrate proper macaroon creation and verification
We move the proxy from using its placeholder macaroon creation and
verification to instead use the agreed upon macaroon design. Much of
this is solely a refactor, but some new functionality has also been
introduced as part of integrating the LSAT mint:

1. A request's target service is now verified to ensure its attached
   LSAT is authorized.

2. The preimage is now checked against the token's committed payment
   hash to ensure it has been paid for.
2019-11-26 11:13:19 -08:00
Wilmer Paulino
95c405b0c7 auth+proxy: extend Authenticator methods with target service name
The target service name remains unused in its current form, but will be
required in order to verify that an incoming request with an LSAT
attached is authorized to access the service being attempted. We can
derive this from the request's host field, but we choose to extend the
methods with the additional parameter in order to prevent parsing the
host field again to determine which service is being accessed.
2019-11-26 11:12:48 -08:00
Wilmer Paulino
7b676b8b91 auth: use concrete preimage type in FromHeader and SetHeader 2019-11-26 11:12:20 -08:00
Wilmer Paulino
25851ae16d kirin: add static service limiter
The service limiter holds all of the constraints that should be applied
to a given service at the base tier. These are currently static and are
parsed from the proxy's configuration file as a temporary work-around.
Eventually, we plan to integrate this with etcd as well in order to
achieve dynamic service discovery.
2019-11-25 17:08:35 -08:00
Wilmer Paulino
02f2a287b0 kirin: add etcd-backed secret store
This will store the secret of each LSAT minted by the proxy, which is
crucial for LSAT verification. The secrets are stored under a new
"secrets" key prefixed by the top level LSAT etcd key, and each secret
can be found by its unique identifier prefixed with the secrets key.
2019-11-25 17:08:34 -08:00
Wilmer Paulino
401c0e2d38 kirin: add etcd client configuration
Allows the ability for the proxy to connect to an etcd cluster for any
reliable data storage purposes. No data is being stored yet as of this
commit, but we'll be storing LSAT secrets at a later commit.

One key component in this commit is that we introduce a new top level
key that will serve to hold all LSAT proxy-related data. Any nested keys
should be prefixed with said top level key.

Co-authored-by: Oliver Gugger <gugger@gmail.com>
2019-11-25 17:08:32 -08:00
Wilmer Paulino
9f291ddbf9 mint: introduce proper LSAT creation and verification
This package adheres to the agreed upon internal design document of the
macaroon portion of an LSAT. It is able to mint LSATs for a set of
services at any tier, each containing their desired set of constraints.

LSAT verification so far only ensures the that token was minted by us
and that the target service attempted to be accessed is authorized
according to the white-listed services contained in the token.
2019-11-25 17:07:08 -08:00
Wilmer Paulino
abcd7a9828 build: update to loop version containing loop utilities 2019-11-25 17:07:02 -08:00
Wilmer Paulino
c317071270 build: downgrade to loop-compatible lnd version
This addresses a build issue when importing kirin into nautilus.

Co-authored-by: Oliver Gugger <gugger@gmail.com>
2019-11-25 17:05:56 -08:00
Olaoluwa Osuntokun
21471bb9b7 Merge pull request #15 from wpaulino/travis
build: set up travis
2019-11-25 18:52:21 -06:00
Wilmer Paulino
2aa9d7ae85 build: set up travis 2019-11-22 17:08:45 -08:00
Olaoluwa Osuntokun
9da38301ec Merge pull request #14 from guggero/cert
kirin: auto create self-signed cert if none is provided
2019-11-19 17:55:34 -08:00
Oliver Gugger
d8ed6bb449 kirin: auto create self-signed cert if none is provided 2019-11-19 15:32:42 +01:00
Olaoluwa Osuntokun
b90299ed4c Merge pull request #10 from guggero/loop-ready
prepare for loop integration
2019-11-18 17:55:08 -08:00
Oliver Gugger
aef413da0a auth+proxy: forward auth to backend 2019-11-18 10:41:12 +01:00
Oliver Gugger
8f4dfc5d57 auth+macaroons: allow authorization by macaroon only 2019-11-18 10:41:11 +01:00
Oliver Gugger
4b0a83b46a proxy: test HTTP and gRPC proxying 2019-11-15 09:45:06 +01:00
Oliver Gugger
00f661318f proxy: send error as gRPC error 2019-11-15 09:45:06 +01:00
Wilmer Paulino
a20e47e79b Merge pull request #9 from guggero/proxy-demo
initial proxy with freebie DB and lnd backend
2019-11-12 18:59:42 -08:00
Oliver Gugger
564deb6545 proxy: add demo and README with the use cases 2019-11-12 12:02:14 +01:00
Oliver Gugger
e704ba4aa9 proxy: add prefix logger to log remote IP address 2019-11-12 12:02:14 +01:00
Oliver Gugger
38c17f4de8 proxy: dispatch all non-matched requests to static file server 2019-11-12 12:02:14 +01:00
Oliver Gugger
672766b340 proxy: allow update of backend services 2019-11-12 12:02:13 +01:00
Oliver Gugger
8cbb4fc4fb auth: create invoice request with closure, add challenger 2019-11-12 12:02:09 +01:00
Oliver Gugger
c8cbeb9ab1 config: add static file root 2019-11-06 13:21:56 +01:00
Oliver Gugger
a44e9fbd22 freebie+proxy: add memory based freebie DB implementation 2019-11-06 13:21:56 +01:00
Oliver Gugger
83395c0c98 proxy+auth: add log statements 2019-11-06 13:21:55 +01:00
Oliver Gugger
7e0c1dd97e multi: add persistent logger 2019-11-06 13:21:51 +01:00
Oliver Gugger
5a3b8b79d2 proxy: implement basic proxy functionality 2019-11-06 13:21:45 +01:00
Oliver Gugger
4d1fbbf4d6 proxy: add static file server 2019-11-04 12:43:31 +01:00
Oliver Gugger
9552a70cb9 proxy: match service with regular expressions 2019-11-04 12:43:25 +01:00
Valentine Wallace
279fa2a64b Initial version of the proxy.
Missing: logging, an Authenticator implementing the LSAT HTTP
and gRPC protocol.
2019-09-12 16:41:25 -07:00
Olaoluwa Osuntokun
e32095f2a7 Initial commit 2019-01-30 14:56:14 -08:00