Files
ark/server/internal/interface/grpc/interceptors/interceptor.go
Louis Singer 9fc49d9f08 Add AdminService (#176)
* add admin service

* go mod tidy

* fix linter: grpc.Dial

* fix ocean get balance

* fix linter

* add .vscode to gitignore

* rework admin balance API

* fix mockedwallet in covenantless pkg

* make proto
2024-05-31 15:46:46 +02:00

20 lines
537 B
Go

package interceptors
import (
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"google.golang.org/grpc"
)
// UnaryInterceptor returns the unary interceptor
func UnaryInterceptor(user, pass string) grpc.ServerOption {
return grpc.UnaryInterceptor(middleware.ChainUnaryServer(
unaryAuthenticator(user, pass),
unaryLogger,
))
}
// StreamInterceptor returns the stream interceptor with a logrus log
func StreamInterceptor() grpc.ServerOption {
return grpc.StreamInterceptor(middleware.ChainStreamServer(streamLogger))
}