microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.21k stars 515 forks source link

[Suggestion] It would be better to add an action "Re-enter credentials" after connecting "Generic Registry V2" registry with empty name and password #4117

Closed v-xinda closed 11 months ago

v-xinda commented 11 months ago

OS: All Build Version: 20231012.1 Regression: Not a regression

Repro Steps:

  1. F1 -> Click "Docker Registries: Connect Registry..." -> Click "Generic Registry V2" registry -> Type "http://localhost:5100/" -> Type empty for the name and password.
  2. Navigate to the "Registries" view -> Expand "Generic Registry V2" registry -> Expand "http://localhost:5100/" -> Right click the error massage.
  3. Check whether there is an action "Re-enter credentials".

Actual: There is no action "Re-enter credentials".

Screenshot 2023-10-12 at 17 27 16

Suggestion: It would be better to add an action "Re-enter credentials" after connecting "Generic Registry V2" registry with empty name and password. Like below:

Screenshot 2023-10-12 at 17 27 03

More Info:

  1. This issue also reproduces for the DockerHub registry.
  2. This issue doesn't reproduce for the GitHub registry.
alexyaang commented 11 months ago

This seems to be an easy fix, we'll need to change this to username === undefined || username === null. @bwateratmsft would you be okay with this?

https://github.com/microsoft/vscode-docker-extensibility/blob/ab6a5b21ec58079079ff1ff52c60761a02fe0cc6/packages/vscode-docker-registries/src/auth/BasicAuthProvider.ts#L17

bwateratmsft commented 11 months ago

This is so we can intentionally allow an empty username correct?

alexyaang commented 11 months ago

@bwateratmsft yes

bwateratmsft commented 11 months ago

I think your proposal makes sense