Support macaroons and TLS && Add arkd wallet cmds (#232)

* Update protos

* Update handlers

* Support macaroons and TLS

* Add arkd cli

* Minor fixes

* Update deps

* Fixes

* Update makefile

* Fixes

* Fix

* Fix

* Fix

* Remove trusted onboarding from client

* Completely remove trusted onboarding

* Fix compose files and add --no-macaroon flag to arkd cli

* Lint

* Remove e2e for trusted onboarding

* Add sleep time
This commit is contained in:
Pietralberto Mazza
2024-08-09 17:59:31 +02:00
committed by GitHub
parent 059e837794
commit 57ce08f239
105 changed files with 12111 additions and 1617 deletions

View File

@@ -1,19 +1,23 @@
package interceptors
import (
"github.com/ark-network/tools/macaroons"
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"google.golang.org/grpc"
)
// UnaryInterceptor returns the unary interceptor
func UnaryInterceptor(user, pass string) grpc.ServerOption {
func UnaryInterceptor(svc *macaroons.Service) grpc.ServerOption {
return grpc.UnaryInterceptor(middleware.ChainUnaryServer(
unaryAuthenticator(user, pass),
unaryLogger,
unaryMacaroonAuthHandler(svc),
))
}
// StreamInterceptor returns the stream interceptor with a logrus log
func StreamInterceptor() grpc.ServerOption {
return grpc.StreamInterceptor(middleware.ChainStreamServer(streamLogger))
func StreamInterceptor(svc *macaroons.Service) grpc.ServerOption {
return grpc.StreamInterceptor(middleware.ChainStreamServer(
streamLogger,
streamMacaroonAuthHandler(svc),
))
}