Skip to content

Maven Virtual Registry: Registry models API

🔭 Issues plan

  1. Maven Virtual Registry: Database models (#467972 - closed).
  2. Maven Virtual Registry: Permissions policy (#467977 - closed).
  3. Maven Virtual Registry: Registry models API (#467979 - closed). 👈 You're here.
  4. Maven Virtual Registry: Maven API endpoint (#467982 - closed).
  5. Maven Virtual Registry: Cache logic (#467983 - closed).
  6. Maven Registry: Cached responses destruction (#468113 - closed).
  7. Improve workhorse dependencyproxy logic (#461561 - closed).
  8. Maven Virtual Registry: Documentation (#468115 - closed).
  9. Maven Virtual Registry: Performance review (#468116 - closed).
  10. Maven Virtual Registry: feature flag cleanup (#468117).

🗒 Description

The API endpoints should be located in the standalone resources.

1️⃣ Registries

Route Notes
GET /api/v4/virtual_registries/packages/maven/registries Get the list of all maven registries (only 1 in this scope).
GET /api/v4/virtual_registries/packages/maven/registries/:registry_id Get a specific maven registry
POST /api/v4/virtual_registries/packages/maven/registries Create a specific maven registry. Attributes will be mainly the cache settings.
PUT /api/v4/virtual_registries/packages/maven/registries/:registry_id Updating a specific maven registry.
DELETE /api/v4/virtual_registries/packages/maven/registries/:registry_id Delete a specific maven registry.

The attributes that can be passed for the POST and PUT requests:

  • (POST only) group_id. The root Group id.
  • cache_validity_period_hours. 0 or positive integer.

2️⃣ Upstreams

Route Notes
GET /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams Get the list of all upstreams. (only 1 in this scope).
GET /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams/:upstream_id Get a specific upstream.
POST /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams Create an upstream. Attributes will be essentially the url and the optional credentials.
PUT /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams/:upstream_id Update an upstream.
DELETE /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams/:upstream_id Delete an upstream.

The attributes that can be passed for the POST and PUT requests:

  • (POST only) registry_id. The VirtualRegistries::Maven::Registry id.
  • url. The upstream url.
  • username. The username to use against the upstream.
  • password. The password to use against the upstream.

The password should be a write once, read non attribute. In other words, it should not be possible to read the password back.

3️⃣ Cached responses

Route Notes
GET /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams/:upstream_id/cached_responses We should support a fuzzy search on the relative path attribute.
DELETE /api/v4/virtual_registries/packages/maven/registries/:registry_id/upstreams/:upstream_id/cached_responses/:cached_response_id cached_response_id can be the encoded relative_path as it is unique within upstream id and we don't really need a primary key on cached responses.

The GET request has the following attributes:

  • search. Search term to match the relative_path field of cached responses. Simple fuzzy search supported such as *foo*bar.

🔮 Additional considerations

Edited by David Fernandez