microsoft / vscode-ripgrep

For consuming the ripgrep binary from microsoft/ripgrep-prebuilt in a Node project
Other
112 stars 48 forks source link

Pass proxy credentials to PowerShell #20

Closed fgreinacher closed 3 years ago

fgreinacher commented 3 years ago

Fixes the problem mentioned in https://github.com/microsoft/vscode-ripgrep/issues/5#issuecomment-811901359

fgreinacher commented 3 years ago

@slhultgren Would be great if you could check whether this solves the issue in your setup.

slhultgren commented 3 years ago

@fgreinacher Thanks, this works well if the HTTP_PROXY env var includes user and password as unescaped text.

For us we also do some basic "obfuscating" on the password so that it is at least not immediately human readable to %-- sequences, so I also had to add a line: const decodedPassword = decodeURIComponent(password);

and use the decodedPassword for this part: "ConvertTo-SecureString '${decodedPassword}' -AsPlainText -Force".

fgreinacher commented 3 years ago

@fgreinacher Thanks, this works well if the HTTP_PROXY env var includes user and password as unescaped text.

For us we also do some basic "obfuscating" on the password so that it is at least not immediately human readable to %-- sequences, so I also had to add a line: const decodedPassword = decodeURIComponent(password);

and use the decodedPassword for this part: "ConvertTo-SecureString '${decodedPassword}' -AsPlainText -Force".

Thanks! Updated with 45ac9ff599d1c3523a77d2c341f02d481ac36d77.