Skip to content

Commit

Permalink
The access token is now passed in a http header
Browse files Browse the repository at this point in the history
This is done to avoid exposure as the data.http.id (which contains
the URL) in the logs.

Added the MacOS .DS_Store files to .gitignore
  • Loading branch information
boris-dyga-SM committed Jan 24, 2024
1 parent 9cbefc9 commit ac6a4c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
# Crash log files
crash.log
test.log

# MacOS service files
.DS_Store

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Available targets:

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.33.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.33.0 |

## Modules

Expand Down
10 changes: 2 additions & 8 deletions modules/conformance-pack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ resource "aws_config_conformance_pack" "default" {
}

data "http" "conformance_pack" {
/*
To access a public GitHub repo the following URL is used:
https://raw.githubusercontent.com/<owner>/<repo>/<branch>/<path_to_file>

Check warning on line 16 in modules/conformance-pack/main.tf

View workflow job for this annotation

GitHub Actions / terraform-module / ci-terraform / format

[terraform fmt -recursive] reported by reviewdog 🐶 Raw Output: modules/conformance-pack/main.tf:16:- modules/conformance-pack/main.tf:16:+
To access a private GitHub repo an access token with appropriate permissions should be generated first and then provided in the url:
https://<private_access_token>@raw.githubusercontent.com/<owner>/<repo>/<branch>/<path_to_file>
*/

url = var.access_token == "" ? var.conformance_pack : "${split("://", var.conformance_pack)[0]}://${var.access_token}@${split("://", var.conformance_pack)[1]}"
url = var.conformance_pack
request_headers = var.access_token == "" ? {} : { Authorization = "token ${ var.access_token }" }

Check warning on line 18 in modules/conformance-pack/main.tf

View workflow job for this annotation

GitHub Actions / terraform-module / ci-terraform / format

[terraform fmt -recursive] reported by reviewdog 🐶 Raw Output: modules/conformance-pack/main.tf:18:- request_headers = var.access_token == "" ? {} : { Authorization = "token ${ var.access_token }" } modules/conformance-pack/main.tf:18:+ request_headers = var.access_token == "" ? {} : { Authorization = "token ${var.access_token}" }
}

0 comments on commit ac6a4c7

Please sign in to comment.