Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuGet needs a nicer error message when dealing with encrypted credentials #2197

Closed
blackdwarf opened this issue Feb 26, 2016 · 9 comments
Closed
Assignees
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Platform:Xplat Priority:2 Issues for the current backlog. Type:Bug

Comments

@blackdwarf
Copy link

As per dotnet/cli#1286.

/cc @mgravell

@yishaigalatzer yishaigalatzer added Priority:2 Issues for the current backlog. Type:Bug Area:ErrorHandling warnings and errors/log messages & related error codes. Platform:Xplat labels Feb 26, 2016
@yishaigalatzer
Copy link

I'm thinking this would be quite a common scenario, so lets prioritize it higher.

Pri 0 - Throw a good error message, saying what went wrong in what file and in what line/char
Bonus points - See if we can delay load the credentials, or only load them for active feeds. We should discuss which of the two is best.

This also looks similar to the bug on your plate where a password as a * char in it

@sklivvz
Copy link

sklivvz commented Feb 26, 2016

Also, it shouldn't really blow up at all if the credentials are not needed or used -- at the moment they merely need to be in the global config, and it will be an issue even if the local config has a "clear" and therefore should not read them.

@yishaigalatzer
Copy link

@sklivvz not sure what you are adding here? Can you clarify that compared to my comment above?

See if we can delay load the credentials, or only load them for active feeds. We should discuss which of the two is best.

@sklivvz
Copy link

sklivvz commented Feb 26, 2016

This is the default configuration which is generated by dotnet new:

  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>

Notice the comment. Other sources should not be inherited. Not inherited sources should actually be ignored, not delay loaded.

@yishaigalatzer
Copy link

Duh :)

@blackdwarf
Copy link
Author

Soooo...is this like another bug or something? The thing?

@sklivvz
Copy link

sklivvz commented Feb 27, 2016

@blackdwarf after giving a look at the code base and little thought. I think it's three bugs (in the sense that it's probably going to take three patches):

Bug 1: encrypted passwords should be supported and not throw

Bug 2: the caller method chain should handle any exceptions when loading the package sources (including the one from Bug 1) and give appropriate feedback when loading fails

Bug 3: package sources "cleared" in the configuration should not be loaded or parsed

Fixing Bug 1 or Bug 3 would fix the issue as originally reported. Fixing Bug 2 would not, as the command line calls would still fail with a valid configuration. However I think it's highly appropriate that a decent error message is thrown to the end user if shit goes ill anyways.

@mgravell
Copy link

Bug 4: disabled global options should be parsed

On Sat, 27 Feb 2016 10:36 Marco Cecconi, notifications@github.com wrote:

@blackdwarf https://github.com/blackdwarf after giving a look at the
code base and little thought. I think it's three bugs (in the sense that
it's probably going to take three patches):

Bug 1: encrypted passwords should be supported and not throw

Bug 2: the caller method chain should handle any exceptions when
loading the package sources (including the one from Bug 1) and give
appropriate feedback when loading fails

Bug 3: package sources "cleared" in the configuration
#2197 (comment) should
not be loaded or parsed

Fixing Bug 1 or Bug 3 would fix the issue as originally reported. Fixing
Bug 2 would not, as the command line calls would still fail with a valid
configuration. However I think it's highly appropriate that a decent error
message is thrown to the end user if shit goes ill anyways.


Reply to this email directly or view it on GitHub
#2197 (comment).

@yishaigalatzer
Copy link

Except coreclr does not support the encryption on Windows at the moment. So this works well on desktop CLR but not one core (at least yet).

Agree with the rest

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Mar 1, 2016
zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Platform:Xplat Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

5 participants