Skip to content

Commit

Permalink
Removed debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pspieker-stripe committed Jul 2, 2024
1 parent 2f2cf52 commit 6b8c7dc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/rs/xid v1.2.1
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.0
github.com/stripe/goproxy v0.0.0-20231206175114-560c3ba6a2a1
github.com/stripe/goproxy v0.0.0-20240702223215-529f11a6f861
golang.org/x/net v0.17.0
gopkg.in/urfave/cli.v1 v1.20.0
gopkg.in/yaml.v2 v2.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stripe/goproxy v0.0.0-20231206175114-560c3ba6a2a1 h1:kA8wVCrTI7UE2Z8oj24W75/J+IUA/fFn8vYYXs/sJeE=
github.com/stripe/goproxy v0.0.0-20231206175114-560c3ba6a2a1/go.mod h1:hF2CVgH4++5ijZiy9grGVP8Fsi4u+SMOtbnIKYbMUjY=
github.com/stripe/goproxy v0.0.0-20240702223215-529f11a6f861 h1:dlR0X8/38L9ip1ydDazfTRyPe0iW6cepmIcaygH2r5Q=
github.com/stripe/goproxy v0.0.0-20240702223215-529f11a6f861/go.mod h1:hF2CVgH4++5ijZiy9grGVP8Fsi4u+SMOtbnIKYbMUjY=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
19 changes: 0 additions & 19 deletions pkg/smokescreen/smokescreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ func rejectResponse(pctx *goproxy.ProxyCtx, err error) *http.Response {
var msg, status string
var code int

fmt.Println("**********")
fmt.Println(pctx.Resp)
fmt.Println(err)
fmt.Println("**********")
if e, ok := err.(net.Error); ok {
// net.Dial timeout
if e.Timeout() {
Expand Down Expand Up @@ -524,8 +520,6 @@ func BuildProxy(config *Config) *goproxy.ProxyHttpServer {
pctx.Resp = rejectResponse(pctx, err)
return goproxy.RejectConnect, ""
}
fmt.Println("-----MADE IT HERE--------------")

return goproxy.OkConnect, destination
})

Expand Down Expand Up @@ -553,9 +547,6 @@ func BuildProxy(config *Config) *goproxy.ProxyHttpServer {
sctx.cfg.AcceptResponseHandler(sctx, resp)
}
}
fmt.Println("-----------------------------")
fmt.Println(pctx.Error)
fmt.Println("-----------------------------")

if resp == nil && pctx.Error != nil {
return rejectResponse(pctx, pctx.Error)
Expand Down Expand Up @@ -951,13 +942,6 @@ func checkACLsForRequest(config *Config, req *http.Request, destination hostport
if connectProxyHost != "" {
connectProxyUrl, err := url.Parse(connectProxyHost)

config.Log.WithFields(logrus.Fields{
"headers": req.Header,
"upstream_proxy_name": req.Header.Get("X-Upstream-Https-Proxy"),
"destination_host": destination.Host,
"proxy_host": connectProxyUrl.Hostname(),
}).Info("Info about the headers and destination host.")

if err != nil {
config.Log.WithFields(logrus.Fields{
"error": err,
Expand All @@ -974,9 +958,6 @@ func checkACLsForRequest(config *Config, req *http.Request, destination hostport
connectProxyHost = connectProxyUrl.Hostname()
}

// TODO: add proxy auth params fi if the decision is to allow the request
// this will likely mean modifying the config struct

ACLDecision, err := config.EgressACL.Decide(role, destination.Host, connectProxyHost)
decision.project = ACLDecision.Project
decision.reason = ACLDecision.Reason
Expand Down
13 changes: 11 additions & 2 deletions vendor/github.com/stripe/goproxy/https.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ github.com/sirupsen/logrus/hooks/test
## explicit; go 1.13
github.com/stretchr/testify/assert
github.com/stretchr/testify/require
# github.com/stripe/goproxy v0.0.0-20231206175114-560c3ba6a2a1
# github.com/stripe/goproxy v0.0.0-20240702223215-529f11a6f861
## explicit; go 1.13
github.com/stripe/goproxy
# golang.org/x/mod v0.8.0
Expand Down

0 comments on commit 6b8c7dc

Please sign in to comment.