mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 20:24:21 +01:00
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:
committed by
GitHub
parent
059e837794
commit
57ce08f239
@@ -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),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user