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

Authentication support #160

Closed
wants to merge 4 commits into from

Conversation

infinisil
Copy link
Contributor

@infinisil infinisil commented Apr 26, 2022

Implement npm registry authentication, allowing access to private registries via .npmrc

This PR also includes the first two commits from #151 since the same changes are needed for authentication support.

Unfortunately the NixOS VM test for authentication created in this PR can't run in GitHub Actions, but it works locally.

TODO:

  • Implement .npmrc fields _authToken and _auth
  • Create a basic test for _authToken
  • Implement .npmrc fields _password and username (this might not be possible)
  • Test a package-lock.json and .npmrc generated by npm (the current one is hand-written)
  • Try to actually run npm with the example from the current test
  • Handle environment variables in .npmrc, see https://stackoverflow.com/questions/53099434/using-auth-tokens-in-npmrc
  • Improve the code, individual functions should be split off
  • More tests, especially for the internal functions used, but also more VM tests for different authentication mechanisms
  • Documentation

This allows more flexibility for the future, such as support for:
- Source patches
- Fetch authentication
For future authentication support
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-29/18903/1

@infinisil infinisil closed this Feb 12, 2024
@infinisil infinisil deleted the authentication branch February 12, 2024 01:30
@elmarsto
Copy link

@infinisil Darn it, this is was a feature I kind of needed. What do you recommend instead of this branch?

@infinisil
Copy link
Contributor Author

@elmarsto Not using npmlock2nix right now unfortunately. Feel free to use my code though for a new PR or fork

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

Successfully merging this pull request may close these issues.

3 participants