-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(plugin-npm-cli): fix login flow with the registry #1848
Conversation
I'd need some help to improve the code, not sure where to put things or create methods and so on and test updates/create are missing |
Thanks for looking into it! Quick questions before discussing the implementation:
|
I need to look into those points then. For point one I'd like to do that, actually It maybe fixed at Verdaccio, but not sure if would be a breaking change, we still support npm5 and I'm not sure side effects. I'll back when I have more news. |
Any news on this? I faced these issues with yarn berry regards this and it makes Vercaddio impossible to use and basically yarn berry useless to publish packages. I was hoping to get away from Yarn1 + Lerna + sematic-release by using yarn berry and couple of extra scripts or possibly make yarn berry plugin for sematic-release style publish, but seems that is impossible currently if using Verdaccio. I was going to use Vercaddio as testbed for development and Verdaccio is the internal enterprise registry, so it needs to work. |
Still checking, I'm swimming in the amazing world of registries and other pkg manager lately, no clear solution yet.
Why? This PR is about
If you enable Unless I missing something from your side, let me know.
|
Thank you for this. I was able to get the publish work with verdaccio, but it does differ slightly in yarn2 from npm, which I used as a comparison to get better logging. I could not figure out how yarn2 would give more verbose logging. Following caveats which I had to solve:
Probably just need to add some additional CI steps for this as the "normal" configuration is not enough. EDIT: Just to clarify why this configuration. The company internal registry (Verdaccio) is accessed through scoping (and packages are only published to that one) and any other packages are accessed directly from their own registries. Verdaccio is not used as proxy to public registries. |
Update regards publishing to scoped registry server. The documentation says that |
This comment has been minimized.
This comment has been minimized.
This commit fixes `yarn npm login` when the remote registry is Verdaccio. When a user already exists, the registry replies with `409 Conflict`. The official npm client then retrieves the latest user state and inserts a revision, using HTTP basic authentication. This step was missing, and this commits adds it. The change was tested to work with a private Verdaccio registry. It should now be as reliable as the official npm client. - Closes yarnpkg#1044 - Closes yarnpkg#1848 - Closes verdaccio/verdaccio#1737
This commit fixes `yarn npm login` when the remote registry is Verdaccio. When a user already exists, the registry replies with `409 Conflict`. The official npm client then retrieves the latest user state and inserts a revision, using HTTP basic authentication. This step was missing, and this commits adds it. The change was tested to work with a private Verdaccio registry. It should now be as reliable as the official npm client. - Closes yarnpkg#1044 - Closes yarnpkg#1848 - Closes verdaccio/verdaccio#1737
This commit fixes `yarn npm login` when the remote registry is Verdaccio. When a user already exists, the registry replies with `409 Conflict`. The official npm client then retrieves the latest user state and inserts a revision, using HTTP basic authentication. This step was missing, and this commits adds it. The change was tested to work with a private Verdaccio registry. It should now be as reliable as the official npm client. - Closes yarnpkg#1044 - Closes yarnpkg#1848 - Closes verdaccio/verdaccio#1737
This commit fixes `yarn npm login` when the remote registry is Verdaccio. When a user already exists, the registry replies with `409 Conflict`. The official npm client then retrieves the latest user state and inserts a revision, using HTTP basic authentication. This step was missing, and this commits adds it. The change was tested to work with a private Verdaccio registry. It should now be as reliable as the official npm client. - Closes yarnpkg#1044 - Closes yarnpkg#1848 - Closes verdaccio/verdaccio#1737
**What's the problem this PR addresses?** This commit fixes `yarn npm login` when the remote registry is Verdaccio. - Closes #1044 - Closes #1848 - Closes verdaccio/verdaccio#1737 ... **How did you fix it?** When a user already exists, the registry replies with `409 Conflict`. The official npm client then retrieves the latest user state and inserts a revision, using HTTP basic authentication. This step was missing, and this commits adds it. The change was tested to work with a private Verdaccio registry. It should now be as reliable as the official npm client. ... **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
**What's the problem this PR addresses?** This commit fixes `yarn npm login` when the remote registry is Verdaccio. - Closes #1044 - Closes #1848 - Closes verdaccio/verdaccio#1737 ... **How did you fix it?** When a user already exists, the registry replies with `409 Conflict`. The official npm client then retrieves the latest user state and inserts a revision, using HTTP basic authentication. This step was missing, and this commits adds it. The change was tested to work with a private Verdaccio registry. It should now be as reliable as the official npm client. ... **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. (cherry picked from commit db6210f)
What's the problem this PR addresses?
Add the missing logic the registry requires to login a user already registered.
Fixes #1044
How did you fix it?
Add missing request to perform a full login. The flow is like this:
npmAuthToken
on the first requestnpmAuthToken
and registry will rely on that to return the logged userok
message.npmAuthToken
must be sendChecklist