[go: up one dir, main page]

Skip to content

Create new `repositories` API endpoint

We should create a new API endpoint for our binary repository.

While we have an Artifacts API, it is undesirable for a few reasons:

  1. It is tied to a specific job. Which job pushed the changes does not matter, and would make working with the repository much more difficult.
  2. It does not provide individual file access, only downloading of the archive. This will not work due to the protocols we need to support.
  3. We will likely need multiple "repositories" in a given project, for example with Maven plugin repositories, snapshots, etc.

Authentication

We should support the following authentication tokens:

  1. PAT tokens, which have the same access level as the associated user (None, R, or R/W)
  2. Deploy Tokens
  3. Job tokens, which would provide R/W access based on the branch protection levels. For example we may want to restrict write access to only protected branches like master.

API endpoint

Proposed API route: /projects/:id/repositories/:repository_name

From that endpoint, raw file access should be available. For example /projects/:id/repositories/:repository_id/README.md should get you the README.md file.

Edited by Joshua Lambert