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:
- 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.
- It does not provide individual file access, only downloading of the archive. This will not work due to the protocols we need to support.
- 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:
- PAT tokens, which have the same access level as the associated user (None, R, or R/W)
- Deploy Tokens
- 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