Skip to content
Snippets Groups Projects
Commit 07a613b6 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6668 OZG-7019 add client name to grpc calls

parent 873cc465
Branches
Tags
No related merge requests found
......@@ -40,6 +40,9 @@ import (
"net"
)
const keyClientName = "CLIENT_NAME-bin"
const clientName = "FachstellenServer"
type collaborationRouter struct {
pb.UnimplementedCollaborationServiceServer
}
......@@ -57,6 +60,7 @@ func (s *collaborationRouter) FindVorgang(ctx context.Context, in *pb.GrpcFindVo
}
func (s *collaborationRouter) handleRequest(ctx context.Context, handler func(pb.CollaborationServiceClient, context.Context) (interface{}, error)) (interface{}, error) {
ctx = metadata.AppendToOutgoingContext(ctx, keyClientName, clientName)
md, ok := metadata.FromIncomingContext(ctx)
if !ok {
return nil, status.Error(codes.InvalidArgument, "unable to retrieve metadata")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment