-
Notifications
You must be signed in to change notification settings - Fork 258
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 cli nuget does not support -k for passing apikey/auth for restore #8812
Comments
The recommended approach for authenticate are plugins. See https://docs.microsoft.com/en-us/nuget/reference/extensibility/nuget-cross-platform-authentication-plugin. Given that the plugins need a provider side action, the next best thing are creds in config file. nuget.exe has the sources command for, which on windows will encrypt the PAT. dotnet nuget sources is coming soon in #4126, but it's yet unclear whether the PATs will be encrypted on all platforms. Given that information, personally I'd be in favor of that experience instead of adding a password option for dotnet restore, especially when considered that nuget.exe restore doesn't support one either. @NuGet/nuget-client Thoughts? |
More context : We are using alpine based dotnet core images as our base image to run our dotnet core applications. nuget.config is fine for local, but in CI (gitlab) we can set the variables and pass them to nuget.exe . |
I guess fallback option could be to replace the credentials in nuget.config using something like sed in the CI agent, the values coming in from CI variables. But this doesnt look clean :( |
NuGet supports environment variable expansion in nuget.config. See related issue: #8662 |
This really seems like a pretty big gap to me. CI is usually set up using api keys, most CI tools recommend using it that way. But if the same CI tool can't restore a nuget package with an api key, it seems like a non-starter. Must there be multiple means of authenticating the same account in one system? |
Currently, we are trying to restore from Private Nuget repo (Artifactroy) which requires authentication.
In order to do that we need to execute this comand :
dotnet restore -s ${ARTIFACTORY_FEED_URL} -k ${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}
it looks like -k is not supported with dotnet restore
The text was updated successfully, but these errors were encountered: