Skip to content

Commit

Permalink
Use random ID for 'requestConnection' request.
Browse files Browse the repository at this point in the history
  • Loading branch information
KIProtect GmbH committed Mar 24, 2022
1 parent dbe4263 commit bae67f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion channels/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ package channels

import (
"context"
"encoding/hex"
"fmt"
"github.com/iris-connect/eps"
"github.com/iris-connect/eps/grpc"
"github.com/iris-connect/eps/helpers"
"github.com/kiprotect/go-helpers/forms"
"net"
"sync"
Expand Down Expand Up @@ -436,9 +438,17 @@ func (c *GRPCClientChannel) DeliverRequest(request *eps.Request) (*eps.Response,
}

method := fmt.Sprintf("%s.requestConnection", settings.Proxy)

// does not need to be secure just unique for this EPS server...
id, err := helpers.RandomID(8)

if err != nil {
return nil, err
}

request := &eps.Request{
Method: method,
ID: fmt.Sprintf("%s(1)", method),
ID: fmt.Sprintf("%s(%s)", method, hex.EncodeToString(id)),
Params: map[string]interface{}{
"to": address.Operator,
"channel": "grpc_server",
Expand Down

0 comments on commit bae67f1

Please sign in to comment.