Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bearer token for retrieving terraform module versions #479

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

drewhemm
Copy link
Contributor

@drewhemm drewhemm commented Aug 9, 2022

This PR fixes the curl request to retrieve existing versions where the /versions endpoint for a given module is not publicly-available.

Example of module with public /versions:

$ curl "${REGISTRY_URL}dex/terrapin/aws/versions"
{"modules": [{"source": "dex/terrapin/aws", "versions": [{"version": "1.0.0"}, {"version": "1.1.0"}, {"version": "1.2.0"}, {"version": "1.3.0"}, {"version": "1.4.0"}, {"version": "1.4.1"}, {"version": "1.4.2"}, {"version": "1.4.3"}, {"version": "1.5.0"}, {"version": "1.5.1"}, {"version": "1.5.2"}, {"version": "1.5.3"}, {"version": "1.6.0"}, {"version": "1.6.1"}, {"version": "1.6.2"}, {"version": "1.6.3"}, {"version": "1.7.0"}, {"version": "2.0.0"}, {"version": "2.0.1"}, {"version": "2.1.0"}, {"version": "2.1.1"}, {"version": "2.2.0"}, {"version": "2.3.0"}, {"version": "2.3.1"}, {"version": "2.4.0"}, {"version": "2.5.0"}, {"version": "2.5.1"}, {"version": "2.6.0"}, {"version": "2.6.1"}, {"version": "2.6.2"}, {"version": "2.6.3"}, {"version": "2.6.4"}, {"version": "2.6.5"}, {"version": "3.0.0"}, {"version": "3.0.1"}, {"version": "3.0.2"}, {"version": "3.0.3"}, {"version": "3.0.5"}, {"version": "3.0.6"}, {"version": "3.0.7"}, {"version": "3.1.0"}, {"version": "3.2.0"}, {"version": "3.2.1"}, {"version": "3.2.2"}, {"version": "3.2.3"}, {"version": "3.2.4"}, {"version": "3.2.5"}, {"version": "3.3.0"}, {"version": "3.3.1"}, {"version": "3.3.2"}, {"version": "3.3.3"}, {"version": "3.4.0"}, {"version": "3.5.2"}, {"version": "3.5.3"}, {"version": "3.6.0"}, {"version": "3.6.1"}, {"version": "3.6.2"}, {"version": "3.7.0"}]}]}% 

Example of module with private /versions:

$ curl "${REGISTRY_URL}${MODULE_NAME}/versions"               
{"errors": ["Forbidden"]}% 
$ curl -H "Authorization: Bearer $TF_REGISTRY_TOKEN"  "${REGISTRY_URL}${MODULE_NAME}/versions"
{"modules": [{"source": "kafka-platform/terrapin/aws", "versions": [{"version": "4.0.0"}]}]}%   

@drewhemm drewhemm requested review from a team as code owners August 9, 2022 14:22
@drewhemm drewhemm changed the title Fix authorization bearer for existing terraform version Add bearer token for retrieving terraform module versions Aug 9, 2022
@shaunkillingbeck shaunkillingbeck removed their request for review August 10, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants