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:
- 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 - Authorization wasn't implemented yet
- 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.
- 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. - Only repositories with
terraform-<provider>-<name>
name format currently supported. It's made to simplify repository finding (for API handlers). - One repository could contain only one terraform module
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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