fix(backend/s3): properly parse boolean environment variables for FIPS and DualStack endpoints#38042
Conversation
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
…S and DualStack endpoints The boolAttrDefaultEnvVarOk function was incorrectly treating any non-empty environment variable value as 'true'. This caused AWS_USE_FIPS_ENDPOINT=false and AWS_USE_DUALSTACK_ENDPOINT=false to incorrectly enable these endpoints. The fix uses strconv.ParseBool to properly parse boolean values from environment variables, accepting standard boolean representations: - true: "1", "t", "T", "TRUE", "true", "True" - false: "0", "f", "F", "FALSE", "false", "False" Invalid boolean values in environment variables are now ignored, falling back to the default behavior. Fixes hashicorp#37601
84584e7 to
3f3b767
Compare
|
This appears to be a duplicate of #37940 -- can this be closed while we focus on the preceding PR? |
|
Hello @gautamrajur - thank you for taking the time to open this. The primary difference between this and #37940 is that "truthy" values ( With this in mind we will be closing this out in favor of #37940. |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Description
The
boolAttrDefaultEnvVarOkfunction was incorrectly treating any non-empty environment variable value astrue. This causedAWS_USE_FIPS_ENDPOINT=falseandAWS_USE_DUALSTACK_ENDPOINT=falseto incorrectly enable these endpoints instead of disabling them.The fix uses
strconv.ParseBoolto properly parse boolean values from environment variables, accepting standard boolean representations:"1","t","T","TRUE","true","True""0","f","F","FALSE","false","False"Invalid boolean values in environment variables are now ignored, falling back to the default behavior.
Fixes #37601
Target Release
1.15.x
Rollback Plan
Changes to Security Controls
No changes to security controls.
CHANGELOG entry