Add NPM registry support to GitLab packages
What does this MR do?
Add NPM registry support to GitLab packages:
- A user should be able to upload new packages to GitLab via
npm publish
. - A user should be able to install scoped package dependency from GitLab via
npm install
. - Authentication is done via oauth token.
npm login
is not supported at this stage.
Implementation
This MR adds 3 API endpoints:
-
GET packages/npm/:package_name
allows NPM to receive information about the package and all available versions. -
GET projects/:id/packages/npm/:package_name/-/*file_name
allows NPM to download a package file. -
PUT projects/:id/packages/npm/:package_name
is where npm will send JSON about uploaded package including base64 encoded content of package itself
Screenshot
Existing UI was reused 100%.
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
EE specific content should be in the top level /ee
folder -
For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan? -
Security reports checked/validated by reviewer
Closes #5934 (closed)
Edited by Dmytro Zaporozhets (DZ)