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_*: use ProxyFromEnvironment in http Transport #307

Closed Jusshersmith closed 3 years ago

Jusshersmith commented 3 years ago

Problem

As described in https://github.com/buzzfeed/sso/issues/305, some HTTP clients used in sso_auth and sso_proxy don'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.

We already make use of this in one HTTP client within sso_proxy here: https://github.com/buzzfeed/sso/blob/03e1259e8ce040a5b3937ce684598aa1f9bb980b/internal/proxy/reverse_proxy.go#L53

codecov[bot] commented 3 years ago

Codecov Report

Merging #307 (26d56b0) into main (290f27e) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #307   +/-   ##
=======================================
  Coverage   62.73%   62.73%           
=======================================
  Files          58       58           
  Lines        4286     4286           
=======================================
  Hits         2689     2689           
  Misses       1382     1382           
  Partials      215      215           

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 290f27e...26d56b0. Read the comment docs.