-
Notifications
You must be signed in to change notification settings - Fork 256
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
dotnet list package --vulnerable requires constant login to 3rd party nuget feed #12456
Comments
Azure DevOps doesn't support marking packages as vulnerable or deprecated like nuget.org does. There are feature requests for Azure DevOps team to support these features.
To prove that AzDo doesn't support vulnerable packages yet, I tried following steps.
VS displays the package version as vulnerable for nuget.org package source. VS doesn't display the package version as vulnerable for Azure DevOps feed because they don't support package vulnerability metadata. I am closing as not a bug. Please feel free to reopen this bug if you think otherwise. |
@kartheekp-ms I think you misunderstood. The issue is not about azure devops or their support for vulnerable packages. This issue is about dotnet list package constantly requesting a login if a private feed is added as a package soruce. That feed for me does not contain any official packages, just private ones. I additionally have nuget.org as a package source. So to replicate:
Expectation: Reality: It seems to be a variant of a similar bug as described in #12077 |
(Reopening the issue because the customer has a follow-up question) I forgot to mention one statement in my previous response. In general, NuGet retries HTTP requests 3 times when the response is not 200 (there are few cases this retry count may vary, I don't remember all of them now). Given that the feed is private the server challenges for credentials (401 response) for the first request. NuGet then invokes Credential Provider with Given that we already fixed #12090 issue, I assume NuGet retry logic is causing these authentication prompts because the vulnerability information is not present in the feed. I will try to reproduce the issue sometime next sprint following the steps mentioned in above comment and validate my assumptions.
Given that you have a combination of public and private NuGet feed in NuGet.Config file, I highly recommend onboarding on to Package Source Mapping feature as per the best practices. This feature also reduces the restore time because the sources are queried for packages only if configured correctly. |
@kartheekp-ms Could you please give an update about this bug? The explanation you gave in your last comment makes sense, but have you confirmed it? edit: Or maybe not. According to your explanation only I'm also running into this problem right now with the current SDK version (7.0.302). I already use Package Source Mapping like you suggested in your comment, but I don't see how this helps in this case. I still always get a login request when running a Is there any workaround available? Example of my NuGet.config file: <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="mysource" value="https://pkgs.dev.azure.com/myorg/_packaging/mysource/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="mysource">
<package pattern="somepackage" />
<package pattern="myprefix.*" />
</packageSource>
</packageSourceMapping>
</configuration> |
@kartheekp-ms Any news on this bug? For now, I have to use a user-specific NuGet.config file (in |
Idk if this issue still valid here, but in case you have dotnet restore successful but separate dotnet commands like Use this authentication task prior to the analysis.
|
@ZhekaZeh This bug is about calling |
I'm seeing the same behaviour, when an Azure DevOps Artifacts feed is configured,
|
Also, FWIW, I see this behaviour on both Linux and Windows so it doesn't appear to be environmental in origin. |
Duplicate of #11210. Please refer to the linked issue for updates on this bug. |
My apologies for closing this issue as a duplicate of #11210. Upon further investigation, I found that they are unrelated. Hence reopening this issue. |
@kartheekp-ms Thanks for fixing this! Which version will include the fix? |
@cremor - This fix will be part of preview versions of the .NET 8 SDK (especially 8.0.3xx and above) that can be downloaded from GitHub. If you want this fix in the previous LTS versions of the .NET SDK, please upvote this comment and also let us know which version of the SDK you are interested in getting this fix. |
Hi @kartheekp-ms, this is definitely not fixed for me using the latest .NET 8.0.400 SDK. I have exactly the same scenario as described in this issue:
|
@kartheekp-ms why this is issue is again closed? In local the problem still exist. In local: This is the
====== I want to add that doing this just works: |
NuGet Product Used
dotnet.exe
Product Version
.NET SDK 7.0.200
Worked before?
No response
Impact
It's more difficult to complete my work
Repro Steps & Context
On calling
dotnet list package --interactive --vulnerable
I have to constantly sign in via the web browser for an internal nuget feed.Without the
--vulnerable
switch it seems to use my cached login and I don't even need to login once.Expected behavior:
I would expect to login at most once for the command to finish.
Log Output:
log.txt
Verbose Logs
No response
The text was updated successfully, but these errors were encountered: