Skip to content

Commit

Permalink
Merge pull request #1985 from gravitational/rjones/revendor-roundtrip
Browse files Browse the repository at this point in the history
Revendor roundtrip
  • Loading branch information
russjones authored Jun 2, 2018
2 parents 2fbba6c + 87010f5 commit 82f383d
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 121 deletions.
238 changes: 207 additions & 31 deletions Gopkg.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ ignored = ["github.com/Sirupsen/logrus"]
branch = "master"

[[constraint]]
branch = "master"
name = "github.com/gravitational/roundtrip"
revision = "6a87d116a90b9c4e73bedc19ebc9c17f1b43d826"

[[constraint]]
version = "0.0.1"
Expand Down
6 changes: 5 additions & 1 deletion lib/auth/clt.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ func NewTLSClientWithDialer(dialContext DialContext, cfg *tls.Config, params ...
}

clientParams := append(
[]roundtrip.ClientParam{roundtrip.HTTPClient(&http.Client{Transport: transport})},
[]roundtrip.ClientParam{
roundtrip.HTTPClient(&http.Client{Transport: transport}),
roundtrip.SanitizerEnabled(true),
},
params...,
)
roundtripClient, err := roundtrip.NewClient("https://"+teleport.APIDomain, CurrentVersion, clientParams...)
Expand Down Expand Up @@ -181,6 +184,7 @@ func NewClient(addr string, dialer Dialer, params ...roundtrip.ClientParam) (*Cl
roundtrip.HTTPClient(&http.Client{
Transport: transport,
}),
roundtrip.SanitizerEnabled(true),
// TODO (ekontsevoy) this tracer pollutes the logs making it harder to work
// on issues that have nothing to do with the auth API, consider activating it
// via special environment variable?
Expand Down
4 changes: 3 additions & 1 deletion lib/auth/trustedcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@ func (s *AuthServer) sendValidateRequestToProxy(host string, validateRequest *Va
Host: host,
}

var opts []roundtrip.ClientParam
opts := []roundtrip.ClientParam{
roundtrip.SanitizerEnabled(true),
}

if lib.IsInsecureDevMode() {
log.Warn("The setting insecureSkipVerify is used to communicate with proxy. Make sure you intend to run Teleport in insecure mode!")
Expand Down
1 change: 1 addition & 0 deletions lib/client/https_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func newClientWithPool(pool *x509.CertPool) *http.Client {
}

func NewWebClient(url string, opts ...roundtrip.ClientParam) (*WebClient, error) {
opts = append(opts, roundtrip.SanitizerEnabled(true))
clt, err := roundtrip.NewClient(url, teleport.WebAPIVersion, opts...)
if err != nil {
return nil, trace.Wrap(err)
Expand Down
Loading

0 comments on commit 82f383d

Please sign in to comment.