send sends the provided session response with the provided request ID.
(srv grpcapi.KopiaRepository_SessionServer, requestID int64, resp *grpcapi.SessionResponse)
| 48 | |
| 49 | // send sends the provided session response with the provided request ID. |
| 50 | func (s *Server) send(srv grpcapi.KopiaRepository_SessionServer, requestID int64, resp *grpcapi.SessionResponse) error { |
| 51 | s.sendMutex.Lock() |
| 52 | defer s.sendMutex.Unlock() |
| 53 | |
| 54 | resp.RequestId = requestID |
| 55 | |
| 56 | if err := srv.Send(resp); err != nil { |
| 57 | return errors.Wrap(err, "unable to send response") |
| 58 | } |
| 59 | |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | func (s *Server) authenticateGRPCSession(ctx context.Context, rep repo.Repository) (string, error) { |
| 64 | md, ok := metadata.FromIncomingContext(ctx) |
no test coverage detected