Skip to content

Commit

Permalink
feat: ability to set value of the API_DATA_IS_SENSITIVE environment…
Browse files Browse the repository at this point in the history
… variable (#915)
  • Loading branch information
Vipin654 authored Jan 27, 2025
1 parent a50d580 commit 838f9d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|package-lock.json|^.secrets.baseline$",
"lines": null
},
"generated_at": "2025-01-15T21:34:03Z",
"generated_at": "2025-01-24T15:40:02Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -216,15 +216,15 @@
"hashed_secret": "b4e929aa58c928e3e44d12e6f873f39cd8207a25",
"is_secret": false,
"is_verified": false,
"line_number": 481,
"line_number": 487,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "16282376ddaaaf2bf60be9041a7504280f3f338b",
"is_secret": false,
"is_verified": false,
"line_number": 494,
"line_number": 500,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
2 changes: 2 additions & 0 deletions testhelper/test_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type TestOptions struct {
// See examples in cloudinfo/testdata for proper format.
BestRegionYAMLPath string

ApiDataIsSensitive *bool

// Used with dynamic region selection, if any errors occur this will be the region used (fail-open)
DefaultRegion string

Expand Down
8 changes: 7 additions & 1 deletion testhelper/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path"
"strconv"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -39,7 +40,12 @@ func (options *TestOptions) TestSetup() {
// testSetup Setup test
func (options *TestOptions) testSetup() {
if !options.SkipTestSetup {
os.Setenv("API_DATA_IS_SENSITIVE", "true")

if options.ApiDataIsSensitive == nil {
os.Setenv("API_DATA_IS_SENSITIVE", "true")
} else {
os.Setenv("API_DATA_IS_SENSITIVE", strconv.FormatBool(*options.ApiDataIsSensitive))
}
// If calling test had not provided its own TerraformOptions, use the default settings
if options.TerraformOptions == nil {
// Construct the terraform options with default retryable errors to handle the most common
Expand Down

0 comments on commit 838f9d6

Please sign in to comment.