rage / tmc-vscode

TestMyCode extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=moocfi.test-my-code
MIT License
25 stars 6 forks source link

Error: Request failed: Proxy Authentication Required #685

Open WeiterWeiterFertigstellen opened 1 year ago

WeiterWeiterFertigstellen commented 1 year ago

Describe the bug We use a http proxy with authentication. Is it possible to use the proxy set in the Windows system settings or specify one?

[2023-08-31 05:57:30:437] [INFO] Starting moocfi.test-my-code in "production" mode.
[2023-08-31 05:57:30:437] [INFO] Visual Studio Code version: 1.81.1
[2023-08-31 05:57:30:437] [INFO] moocfi.test-my-code version: 2.1.5
[2023-08-31 05:57:30:437] [INFO] Currently open workspace: undefined
[2023-08-31 05:57:30:437] [INFO] Platform win32 Arch x64
[2023-08-31 05:57:30:437] [INFO] TMC-Langs version: tmc-langs-cli-x86_64-pc-windows-msvc-0.25.2.exe
[2023-08-31 05:57:30:439] [INFO] Downloading TMC-langs from https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-pc-windows-msvc-0.25.2.exe to c:\Users\user\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli\tmc-langs-cli-x86_64-pc-windows-msvc-0.25.2.exe
[2023-08-31 05:57:30:533] [ERROR] An error occurred while downloading TMC-langs:
Error — Request failed: Proxy Authentication Required — Error: Request failed: Proxy Authentication Required
    at c:\Users\user\.vscode\extensions\moocfi.test-my-code-2.1.5\dist\lib.js:2:537006
    at Generator.next (<anonymous>)
    at o (c:\Users\user\.vscode\extensions\moocfi.test-my-code-2.1.5\dist\lib.js:2:536077)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

To Reproduce Error appears after downloading the addon/using it for the first time.

Expected behavior It should automatically detect the proxy set in the windows settings or provide a function to specifiy one.

Desktop (please complete the following information):

TMC Extension logs

[2023-08-31 05:57:30:437] [INFO] Starting moocfi.test-my-code in "production" mode.
[2023-08-31 05:57:30:437] [INFO] Visual Studio Code version: 1.81.1
[2023-08-31 05:57:30:437] [INFO] moocfi.test-my-code version: 2.1.5
[2023-08-31 05:57:30:437] [INFO] Currently open workspace: undefined
[2023-08-31 05:57:30:437] [INFO] Platform win32 Arch x64
[2023-08-31 05:57:30:437] [INFO] TMC-Langs version: tmc-langs-cli-x86_64-pc-windows-msvc-0.25.2.exe
[2023-08-31 05:57:30:439] [INFO] Downloading TMC-langs from https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-pc-windows-msvc-0.25.2.exe to c:\Users\user\AppData\Roaming\Code\User\globalStorage\moocfi.test-my-code\cli\tmc-langs-cli-x86_64-pc-windows-msvc-0.25.2.exe
[2023-08-31 05:57:30:533] [ERROR] An error occurred while downloading TMC-langs:
Error — Request failed: Proxy Authentication Required — Error: Request failed: Proxy Authentication Required
    at c:\Users\user\.vscode\extensions\moocfi.test-my-code-2.1.5\dist\lib.js:2:537006
    at Generator.next (<anonymous>)
    at o (c:\Users\user\.vscode\extensions\moocfi.test-my-code-2.1.5\dist\lib.js:2:536077)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
Heliozoa commented 1 year ago

VSCode extensions do not currently support proxies: https://code.visualstudio.com/docs/setup/network#_legacy-proxy-server-support, https://github.com/microsoft/vscode/issues/12588 All the existing workarounds seem to require writing the password in plaintext to an environment variable or something similar to that, which is obviously not great. It doesn't seem like Microsoft is in any hurry to implement a fix either, so there many not be any good solution right now.

I think we could maybe detect that an authenticated proxy is in use and prompt the user for the username and password and then use those details to make requests both from the extension and the langs CLI which is used by the extension, but such a feature would be pretty low priority right now.

WeiterWeiterFertigstellen commented 9 months ago

@Heliozoa Any news on this?