Protected packages: Add REST API for package protection rules
Context
- As part of the epic &5574 , project maintainer or owner need to have a way to define the
PackageProtectionRules
of the project via REST API - At the moment, there is a GraphQL API and a frontend UI that can be used to CRUD package protection rules; however, the REST API is important because some tools clients are not able to use the GraphQL API, e.g. terraform, etc.
Proposal
- Authorization:
PackageProtectionRules
can only changed by project maintainer or higher => consider implementation with declarative framework - Endpoint route:
api/v4/projects/:id/packages/protection/rules
REST Endpoint | MR |
---|---|
GET api/v4/projects/:id/packages/protection/rules |
!153436 (merged) |
POST api/v4/projects/:id/packages/protection/rules |
!153571 (merged) |
PATCH api/v4/projects/:id/packages/protection/rules |
!153577 (merged) |
DELETE api/v4/projects/:id/packages/protection/rules |
!151741 (merged) |
Checklist / Implementation plan
Edited by Nicholas Wittstruck