patrickhuber / wrangle

Wrangle is a solution for managing multiple configuration stores and multiple command line interfaces across multiple environments.
0 stars 0 forks source link

allow communication with credhub through socks 5 proxy #11

Open patrickhuber opened 6 years ago

patrickhuber commented 6 years ago

verify that credhub config source communication works through a socks 5 proxy

patrickhuber commented 6 years ago

this is quasi implemented because the CREDHUB_PROXY variable is utilized by the credhub library which is used by this cli.

the feature could be implemented by:

  1. Saving the value of the current CREDHUB_PROXY to a local variable
  2. If CREDHUB_PROXY is unset, ignore step 1
  3. Take the configuration from the store properties and use it to assemble the CREDHUB_PROXY var
  4. If vars are not set in the store properties skip step 3
  5. If proxy property is set, it overrides other properties. This value will be written with os.SetEnv to CREDHUB_PROXY
  6. If proxy_ip, proxy_key and proxy_user are all set, then the proxy can be assembled. If they are all unset, skip if they are partially set throw an error. The finished value will be written to CREDHUB_PROXY
  7. Push the old CREDHUB_PROXY value back on the stack. (just in case)

Popping and Pushing the CREDHUB_PROXY variable needs to be done in the scope of one request. An may not be necessary as the os.SetEnv is only scoped to the current proccess.