Add job and deploy token authentication to npm dist-tag routes
What does this MR do and why?
Allow using job & deploy tokens to authenticate against npm dist-tag endpoints.
Screenshots or screen recordings
Screenshots are required for UI changes and are strongly recommended for all other merge requests.
How to set up and validate locally
Authenticate using the CI_JOB_TOKEN:
- Publish a new npm package or use an already published one.
- Make sure you are authenticating via the
.npmrcusingCI_JOB_TOKEN. -
Use
dist-tagcommands in.gitlab-ci.ymlto add or remove tags to a specific package version. - After your pipeline run successfully, you should see any addition/deletion of tags reflected in the package registry list.
Authenticate using the deploy token:
- Create a project/group deploy token.
- Store the token password in a ci/cd variable
- Make sure you are authenticating via the
.npmrcusing the ci/cd variable you stored the deploy token in. -
Use
dist-tagcommands in.gitlab-ci.ymlto add or remove tags to a specific package version. - After your pipeline run successfully, you should see any addition/deletion of tags reflected in the package registry list.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #258835 (closed)
Edited by Moaz Khalifa