Protected containers: Delete protection
Context
This is part of Container Registry: Granular protection for rep... (&9825). See this epic's description for context. Here we'll focus on the described Delete protection
.
Change
backend rails
Backend-
Add a new attribute to image repositories on the Rails side ( container_repositories
table) to denote when they are locked against deletes => Protected containers: Add basic model and migra... (!133297 - merged) -
Allow frontend calls triggered by project owners/maintainers to toggle the delete protection for individual repositories; -
When a user requests a JWT token to allow them to delete against a given image repository, Rails should (within the container registry auth service) check if the corresponding repository is locked against deletes and refuse the request if so, effectively protecting the repository and all images within; -
Refuse frontend/API requests to delete a container repository if deletion protection is turned on for that repository. -
REST API endpoint DELETE ':id/registry/repositories/:repository_id': Refuse REST API requests to delete a container repository if deletion protection is turned on for that repository. => Protected containers: Integrate delete protecti... (!183729 - merged) -
REST API endpoint DELETE ':id/registry/repositories/:repository_id/tags': Refuse REST API requests to delete a container repository if deletion protection is turned on for that repository. -
REST API endpoint DELETE ':id/registry/repositories/:repository_id/tags/:tag_name': Refuse REST API requests to delete a container repository if deletion protection is turned on for that repository. -
GraphQL mutation destroyContainerRepository
: Refuse GraphQL requests to delete a container repository if underlying container repository is deletion protected. => Protected containers: Integrate delete protecti... (!183545) -
GraphQL mutation destroyContainerRepositoryTags
: Refuse GraphQL requests to delete a container tags if underlying container repository is deletion protected. => ??
frontend UX
Frontend-
Create a new project configuration section/setting where users can see the list of container repositories and toggle delete protection for them. Requires UX Design; -
Allow project owners/maintainers to toggle the delete protection for individual repositories; -
Display a special label (?) alongside container repositories with delete protection enabled in the repository list view. Requires UX Design.
documentation
Documentation-
Make it clear that changes to the delete protection policy will take up to N
minutes to come into effect, whereN
is the configured JWT token expiry. -
Make it clear that deletion protection does not apply to tag cleanup policies, those act on individual tags, this protection is for the repository as a whole.
Edited by Gerardo Navarro