Skip to content

Database model for the dependency proxy settings

💾 The database model for the dependency proxy settings

This issue is for introducing a new model/table for the dependency proxy settings.

Table: packages_dependency_proxy_settings

Model: Packages::DependencyProxy::Setting

Columns:

  • enabled. Boolean with a default value to false.
  • project_id foreign key to projects. We want to establish a one-to-one association so we don't need a primary key, this project_id will act as the primary key.
  • enabled boolean. Default: false. Toggle to quickly enable or disable the dependency proxy.
  • maven_external_registry_url. Text (with a limit). Can't be NULL. The url of the external registry.
  • maven_external_registry_username. Text (with a limit). Can be NULL. Presence validation combined with maven_external_registry_password (either both are set or none of them are set).
  • maven_external_registry_password. Text (with a limit). Can be NULL. Presence validation combined with maven_external_registry_username (either both are set or none of them are set).

The model will have helpers and scopes as usual (as necessary) but we want to call out here that username and password can't be saved as they are. That would be a security problem. Thankfully, we have https://docs.gitlab.com/ee/development/secure_coding_guidelines.html#handling-credentials. We will need to attr_encrypted both attributes.

🔭 The Plan

From the investigation:

  1. Database Model. (👈 this issue)
  2. The Maven dependency proxy API: cache hit path (#410717 - closed).
  3. The Maven dependency proxy API: cache miss path (#410719 - closed).
  4. The dependency proxy API skeleton for Maven pac... (#410721 - closed).
  5. The dependency proxy settings GraphQL API (#410725 - closed).
  6. Dependency proxy for Maven: frontend changes (#410726 - closed).
  7. (Option) Dependency proxy for Maven: the prefill option (#410730 - closed).
  8. Document the dependency proxy for Maven (#410731 - closed).
Edited by David Fernandez