mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 12:14:21 +01:00
* 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
24 lines
645 B
Go
24 lines
645 B
Go
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(svc *macaroons.Service) grpc.ServerOption {
|
|
return grpc.UnaryInterceptor(middleware.ChainUnaryServer(
|
|
unaryLogger,
|
|
unaryMacaroonAuthHandler(svc),
|
|
))
|
|
}
|
|
|
|
// StreamInterceptor returns the stream interceptor with a logrus log
|
|
func StreamInterceptor(svc *macaroons.Service) grpc.ServerOption {
|
|
return grpc.StreamInterceptor(middleware.ChainStreamServer(
|
|
streamLogger,
|
|
streamMacaroonAuthHandler(svc),
|
|
))
|
|
}
|