Skip to content

Commit

Permalink
Struct Client exposes sensitive data (#784) (#786)
Browse files Browse the repository at this point in the history
(cherry picked from commit ecd5ee1)

Co-authored-by: Sergio Mena <sergio@informal.systems>
  • Loading branch information
mergify[bot] and sergio-mena committed May 4, 2023
1 parent 0193de9 commit d363c69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rpc/jsonrpc/client/http_json_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ var _ HTTPClient = (*Client)(nil)
var _ Caller = (*Client)(nil)
var _ Caller = (*RequestBatch)(nil)

var _ fmt.Stringer = (*Client)(nil)

// New returns a Client pointed at the given address.
// An error is returned on invalid remote. The function panics when remote is nil.
func New(remote string) (*Client, error) {
Expand Down Expand Up @@ -232,6 +234,10 @@ func getHTTPRespErrPrefix(resp *http.Response) string {
return fmt.Sprintf("error in json rpc client, with http response metadata: (Status: %s, Protocol %s)", resp.Status, resp.Proto)
}

func (c *Client) String() string {
return fmt.Sprintf("&Client{user=%v, addr=%v, client=%v, nextReqID=%v}", c.username, c.address, c.client, c.nextReqID)
}

// NewRequestBatch starts a batch of requests for this client.
func (c *Client) NewRequestBatch() *RequestBatch {
return &RequestBatch{
Expand Down

0 comments on commit d363c69

Please sign in to comment.