npm/pacote

[BUG] CDN download doesn't use provided HTTP Authorization token (even if it's provided hardcoded in the URL)

Opened this issue · 0 comments

baybal commented

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Authorization token is not passed to downloader, nor from the credential storage, nor from URL directly

$ npm i -S git+https://oauth2:ghp_************@github.com/************/private_repo.git

npm http fetch GET 404 https://codeload.github.com/me/private_repo/tar.gz/hash 1294ms (cache skip)

Expected Behavior

Auth passed to downloader from credential storage

npm http fetch GET 200 https://codeload.github.com/me/private_repo/tar.gz/hash 1294ms (cache skip)

Steps To Reproduce

  1. Create a private repo on GitHub
  2. Create read only GitHub token
  3. $ npm i -S git+https://oauth2:ghp_************@github.com/************/************.git
  4. See it missing cache, and reverting to git+ssh

Environment

  • npm:9.8.1
  • Node:v20.6.1
  • OS:Linux
  • platform:Dell XPS 13