Skip to content

WIP: Terraform module registry

Dmitry Chepurovskiy requested to merge dm3ch/gitlab:terraform-registry into master

What does this MR do?

Adds api methods that make gitlab acts as a terraform module registry.

Currently implemented only endpoints for version listing and module download

Suddenly it's just only proof of concept. And many thing still should be reworked.

Current problems:

  1. Terraform module registry service discovery is based on /.well-known/terraform.json call. So it would require gitlab-omnibus nginx config changes to make it proxy this request to ruby backend
  2. Authorization wasn't implemented yet
  3. Currently downloading is based on endpoint that download archive for specified sha. If i right understand it's not good because it would require archiving on each download. So for my opinion it would be better to make it based on artifacts.
  4. Terraform module registry has special endpoint (with auth support) <base_url>/:namespace/:name/:provider/download that returns URL where module archive could be downloaded. But suddenly terraform doesn't provide auth credentials for file download request itself, so the only way to make secure downloading is providing one-time(short-lived) download URIs or URIs with one-time(short-lived) tokens as a GET parameter.
  5. Only repositories with terraform-<provider>-<name> name format currently supported. It's made to simplify repository finding (for API handlers).
  6. One repository could contain only one terraform module

#31770 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports