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

Add support for publish authentication #37

Open
carlosouro opened this issue Nov 3, 2013 · 4 comments
Open

Add support for publish authentication #37

carlosouro opened this issue Nov 3, 2013 · 4 comments

Comments

@carlosouro
Copy link

Hi,

the idea is to add the support for npm adduser and npm owner interfaces (which already support --registry), and protect write APIs enforcing authentication by default.

I am assuming that with multiple npm registry support, ~/.npmrc will also support users per registry? If not we might have to discuss how to handle it.

Reggie is the main contender for a lightweight private registry companies can use to publish their private stuff and we really need one, so, glad to help out :)

Cheers

@bajtos
Copy link
Collaborator

bajtos commented Nov 4, 2013

I am assuming that with multiple npm registry support, ~/.npmrc will also support users per registry? If not we might have to discuss how to handle it.

Unfortunately npm cache does not support multiple registries. If you use the same login & password for npmjs.org and your Reggie server, then the authentication may work. Though not very efficiently, as npm will have to renegotiate the session every time you switch between registries.

A better solution might be to add a command-line argument --cache={dir} to force npm to use a different cache for your proxy. I suppose it's not that bad, as one can easily create an alias for this:

$ alias npm-priv=npm --registry={reggie-url} --cache=$HOME/.npm-private
$ npm-priv add-user
$ npm-priv owner
# etc.

@carlosouro
Copy link
Author

I am perfectly ok with this registry/cache solution being the standard.

If all agree with the solution, I'll start hacking it on a fork

@bajtos
Copy link
Collaborator

bajtos commented Nov 5, 2013

If all agree with the solution, I'll start hacking it on a fork

I suppose "all" means me and @mbrevoort. Since Mike has other commitments and might not have time to look at this issue, feel free to start hacking on this even if he doesn't comment. Maybe wait until the end of this week to give him a chance to express his opinion.

Please read the Contributing guide and don't forget to write tests for the new functionality.

@carlosouro
Copy link
Author

Will do.
Not going to start before the weekend anyway :)

Cheers guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants