verdaccio: Unpublish fails with custom auth plugin
In the latest version the npm unpublish fails when a custom auth plugin is attached. If I remove this.plugins.push((0, _authUtils.getDefaultPlugins)()); it works.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 26 (12 by maintainers)
Same issue on my side, appears that allow_unpublish in auth.ts lookup around plugin without waiting for response. It means each auth plugin will be asked for unpublish and the first to respond will win, but others will still generate callback call. after that unpublish on storage side will be called multiple time and result on a 403 on the second attemps.
https://github.com/verdaccio/verdaccio/blob/7b67bea4b8ec5de29ffc04b1f99c9d041c14ac57/src/lib/auth.ts#L208-L217
publish is coded in a different way and has no issues : https://github.com/verdaccio/verdaccio/blob/7b67bea4b8ec5de29ffc04b1f99c9d041c14ac57/src/lib/auth.ts#L246-L261
and as @xpepermint , removing default plugin fix the issue.
Thanks, I’ll try to test it this week.
Just faced this issue after adding unpublish to GitLab plug-in. Plug-in simply calls
Package is unpublished and deleted from the storage successfully, but end response is
403 Forbidden - DELETE. Error:Repository: https://github.com/igorpupkinable/verdaccio-gitlab/tree/unpublish-action
Stack trace:
I am happy to provide more information if required.
No updates from my side, projects at work have a higher priority at the moment.
@DanielRuf Added my setup under this repo- https://github.com/ankitjain28may/verdaccio-experiments
Run these commands to install:
Now try to publish some registry and unpublish it. Hope it helps, let me know what else do you need. Thanks 😃