buzzfeed / sso

sso, aka S.S.Octopus, aka octoboi, is a single sign-on solution for securing internal services
MIT License
3.07k stars 187 forks source link

sso_proxy: use ProxyFromEnvironment in http Transport #310

Closed saithejareddy closed 3 years ago

saithejareddy commented 3 years ago

Problem

As described in #305, the HTTP client used in sso_proxy doesn't allow for use of HTTP_PROXY environment variables -- meaning traffic can't be passed through a proxy if desired.

Solution

Make use of the http.ProxyFromEnvironment method, which allows for usage of these environment variables. This is not added in http_client.go https://github.com/buzzfeed/sso/blob/main/internal/proxy/providers/http_client.go#L11

codecov[bot] commented 3 years ago

Codecov Report

Merging #310 (244da51) into jusshersmith-auth-ProxyFromEnvironment (63e450a) will increase coverage by 0.89%. The diff coverage is 83.85%.

Impacted file tree graph

@@                            Coverage Diff                             @@
##           jusshersmith-auth-ProxyFromEnvironment     #310      +/-   ##
==========================================================================
+ Coverage                                   61.84%   62.73%   +0.89%     
==========================================================================
  Files                                          57       58       +1     
  Lines                                        4188     4286      +98     
==========================================================================
+ Hits                                         2590     2689      +99     
+ Misses                                       1388     1382       -6     
- Partials                                      210      215       +5     
Impacted Files Coverage Δ
internal/proxy/logging_handler.go 16.32% <0.00%> (ø)
internal/proxy/proxy.go 16.00% <0.00%> (-2.61%) :arrow_down:
internal/proxy/proxy_config.go 76.21% <ø> (ø)
internal/proxy/options.go 82.07% <85.00%> (-1.52%) :arrow_down:
internal/proxy/configuration.go 89.80% <89.80%> (ø)
internal/proxy/metrics.go 86.20% <100.00%> (ø)
internal/proxy/oauthproxy.go 54.26% <100.00%> (+0.47%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 63e450a...244da51. Read the comment docs.