Implement "Repository lease check" across registry CUD endpoints (behind environment feature toggle)

Context

Repository leases as defined in Investigate: Container registry "Rename Lease" (#896 - closed) were introduced to the registry in #895 (closed). We now want to be able to stop CUD operations across all endpoints when a lease is in effect, to guard against data inconsistency.

Note: This does not enable the checks on any environments (that will be tackled in #1036 (closed))

Tasks

  • On each user initialized request to the registry, make sure the project path specified in the JWT (see: gitlab#406795 (closed)) does not have an ongoing rename-lease as implemented in #960 (closed). If an ongoing rename lease exist fail with a 409 Conflict (see: #896 (closed))
  • Add log lines to help identify when a check found or did not find a lease under the project path during the check.
  • Add the necessary API documentation and/or flow diagrams for performing repository rename requests (!1326 (merged))
  • Make sure the redis checks are gated by the environment variables introduced in #1035 (closed) so they can easily be turned of if need be
Edited by SAhmed