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

Notes on setApiKey and NuGet with Mono / dotnet #33

Open
jcansdale opened this issue Feb 9, 2020 · 0 comments
Open

Notes on setApiKey and NuGet with Mono / dotnet #33

jcansdale opened this issue Feb 9, 2020 · 0 comments

Comments

@jcansdale
Copy link
Owner

NuGet on Mono

(Testing on the Mac)

NuGet on Mono uses:

~/.config/NuGet/NuGet.Config
nuget setApiKey -src https://nuget.pkg.github.com/jcansdale-test xxxxxxxxxxx
or
nuget setApiKey -src https://nuget.pkg.github.com/jcansdale-test/index.json xxxxxxxxxxx

Adds the element:

  <apikeys>
    <add key="https://nuget.pkg.github.com/jcansdale-test" value="ababababababa" />
  </apikeys>

But pushing doesn't work:

> nuget push _Core.1.0.0.nupkg -src github
Pushing _Core.1.0.0.nupkg to 'https://nuget.pkg.github.com/jcansdale-test'...
  PUT https://nuget.pkg.github.com/jcansdale-test/
  NotFound https://nuget.pkg.github.com/jcansdale-test/ 1870ms
Response status code does not indicate success: 404 (Not Found).

The request looks like this:

PUT https://nuget.pkg.github.com/jcansdale-test/ HTTP/1.1
Transfer-Encoding: chunked
X-NuGet-ApiKey: xxxxxxxxxxxxxxxxxxxxxxx
X-NuGet-Session-Id: ce18d812-dc29-4b2b-8ce6-8b67cc880194
User-Agent: NuGet Command Line/5.3.1 (Unix 18.7.0.0)
X-NuGet-Client-Version: 5.3.1
Accept-Language: en-GB
Accept-Encoding: gzip, deflate
Authorization: Basic UGVyc29ababababababababbababababababbabaWRjMTdh
Content-Type: multipart/form-data; boundary="c58a7b66-b5ad-4203-b7a4-075cf4eee6b2"
Host: nuget.pkg.github.com

dotnet nuget

dotnet nuget uses:

~/.nuget/NuGet/NuGet.Config

Without an API key set we see:

warn : No API Key was provided and no API Key could be found for 'https://nuget.pkg.github.com/jcansdale-test'. To save an API Key for a source use the 'setApiKey' command.

With an API key set we see:

error: Encryption is not supported on non-Windows platforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant