Add NPM registry support to GitLab packages

Merged Dmytro Zaporozhets (DZ) requested to merge 5934-npm-package-management-mvc into master

What does this MR do?

Add NPM registry support to GitLab packages:

  1. A user should be able to upload new packages to GitLab via npm publish.
  2. A user should be able to install scoped package dependency from GitLab via npm install.
  3. Authentication is done via oauth token. npm login is not supported at this stage.

Implementation

This MR adds 3 API endpoints:

  1. GET packages/npm/:package_name allows NPM to receive information about the package and all available versions.
  2. GET projects/:id/packages/npm/:package_name/-/*file_name allows NPM to download a package file.
  3. 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%.

Screenshot_20181225_220704

What are the relevant issue numbers?

#5934 (closed)

Does this MR meet the acceptance criteria?

Closes #5934 (closed)

Edited by Dmytro Zaporozhets (DZ)