diff --git a/CHANGELOG.md b/CHANGELOG.md index a2a9b48..a15ff82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## Latest -* Registry response to module version download path must be 204, not 200, because the server returns empty body. Download link is passed by means of X-Terraform-Get response header. Both terraform and opentofu support that (in fact they do support both 200 and 204). None of the production registries use 204 at the moment. +* Added X-Terraform-Version request header for module calls +* Registry response to module version download path must be 204, not 200, because the server returns empty body. Download link is passed by means of X-Terraform-Get response header. Both terraform and opentofu support that (in fact they do support both 200 and 204). * Added response errors to the model. * Updated the regex for module download URL * Added release github action, publishing the resulting openapi specification. diff --git a/model/module.smithy b/model/module.smithy index 328e644..725d8bc 100644 --- a/model/module.smithy +++ b/model/module.smithy @@ -5,6 +5,7 @@ namespace tf.registry.module use tf.registry.errors#NotFound use tf.registry.shapes#NamespaceDef use tf.registry.shapes#SemVer +use tf.registry.shapes#TFVersion use tf.registry.shapes#githubModuleDownloadURL resource Module { @@ -26,6 +27,9 @@ operation GetModuleVersion { @input structure GetModuleVersionInput { + @httpHeader("X-Terraform-Version") + xterraformversion: TFVersion + @required @httpLabel namespace: NamespaceDef = "terraform-aws-modules" @@ -63,6 +67,9 @@ operation ListModuleVersions { @input structure ListModuleVersionsInput { + @httpHeader("X-Terraform-Version") + xterraformversion: TFVersion + @required @httpLabel namespace: NamespaceDef = "terraform-aws-modules" diff --git a/model/shapes.smithy b/model/shapes.smithy index 875efd5..6f195de 100644 --- a/model/shapes.smithy +++ b/model/shapes.smithy @@ -36,3 +36,10 @@ string NamespaceDef // semver @pattern("^(([0-9]{1}|[1-9][0-9])\\.){2}([0-9]{1}|[1-9][0-9]{1,2})$") string SemVer + +// terraform version +// semver | semver-beta +@pattern( + "^((([0-9]{1}|[1-9][0-9])\\.){2}([0-9]{1}|[1-9][0-9]{1,2}))$|(([0-9]{1}|[1-9][0-9])\\.){2}([0-9]{1}|[1-9][0-9]{1,2})-\\w+$" +) +string TFVersion