The Maven dependency proxy API: cache hit path
When the Maven dependency proxy API receives a requests for a Maven package, we will have two paths:
- The package exists in the project's package registry and can be simply returned. (cache hit)
- The package doesn't exist and needs to be pulled (+ uploaded to the project's registry). (cache miss)
This issue is for (1.). Issue for (2.) is The Maven dependency proxy API: cache miss path (#410719 - closed).
Here, we thus need:
- HEAD the package on the external registry.
- We will need the service described below.
- compare the digest with existing packages.
- if a package exists, return it.
⚙ The service for the dependency proxy
This service will need to compute two things out of a request for a given package file:
- the external url to be contacted.
- the headers that need to be set when contacting that url (credentials).
The url and the credentials can both be read from the related dependency proxy settings object.
This service needs to be scoped to maven package formats. For example: Packages::DependencyProxy::Maven::GenerateUrlAndHeadersService
.
The return value can be as simple as a hash.
This service needs to live in the EE
side as this feature is for GitLab Premium.
🔭 The Plan
- Database model for the dependency proxy settings (#410714 - closed).
- The dependency proxy API skeleton for Maven pac... (#410721 - closed).
- API cache hit path. (
👈 this issue) - The Maven dependency proxy API: cache miss path (#410719 - closed).
- The dependency proxy settings GraphQL API (#410725 - closed).
- Dependency proxy for Maven: frontend changes (#410726 - closed).
- (Option) Dependency proxy for Maven: the prefill option (#410730).
- Document the dependency proxy for Maven (#410731 - closed).
Edited by David Fernandez