Skip to content

Commit bae67f1

Browse files
author
KIProtect GmbH
committed
Use random ID for 'requestConnection' request.
1 parent dbe4263 commit bae67f1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

channels/grpc_client.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ package channels
1818

1919
import (
2020
"context"
21+
"encoding/hex"
2122
"fmt"
2223
"github.com/iris-connect/eps"
2324
"github.com/iris-connect/eps/grpc"
25+
"github.com/iris-connect/eps/helpers"
2426
"github.com/kiprotect/go-helpers/forms"
2527
"net"
2628
"sync"
@@ -436,9 +438,17 @@ func (c *GRPCClientChannel) DeliverRequest(request *eps.Request) (*eps.Response,
436438
}
437439

438440
method := fmt.Sprintf("%s.requestConnection", settings.Proxy)
441+
442+
// does not need to be secure just unique for this EPS server...
443+
id, err := helpers.RandomID(8)
444+
445+
if err != nil {
446+
return nil, err
447+
}
448+
439449
request := &eps.Request{
440450
Method: method,
441-
ID: fmt.Sprintf("%s(1)", method),
451+
ID: fmt.Sprintf("%s(%s)", method, hex.EncodeToString(id)),
442452
Params: map[string]interface{}{
443453
"to": address.Operator,
444454
"channel": "grpc_server",

0 commit comments

Comments
 (0)