LG-14128 Stop that the TMx response body is empty on errored transactions#11145
Merged
LG-14128 Stop that the TMx response body is empty on errored transactions#11145
Conversation
…ions We use ThreatMetrix as part of our proofing process. When we get a response from ThreatMetrix we log the response body along with some other metadata about the response. The response body contains sensitive PII that cannot be logged so before logging the response body is passed through the `ResponseRedacter` which redacts sensitive info. The `ResponseRedacter` gaurds against nil response bodies by returning returning a response with an error with the description `TMx response body was empty'. As a result, any time there is no response body to be logged we see that error in our logs. This can be confusing when other errors occur, for example network timeouts or connection failures. It makes it appear as though the issue is a missing response body. This commit modifies the `DdpResult` to only redact the response body when it is present. When it is absent a nil value is returned. This will cause the empty response body to quit being logged and appearing in cloudwatch when exceptions occur. [skip changelog]
zachmargolis
approved these changes
Aug 26, 2024
Contributor
|
Do we want to add a test when the response is present but empty? |
KeithNava
approved these changes
Aug 26, 2024
matthinz
approved these changes
Aug 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We use ThreatMetrix as part of our proofing process. When we get a response from ThreatMetrix we log the response body along with some other metadata about the response. The response body contains sensitive PII that cannot be logged so before logging the response body is passed through the
ResponseRedacterwhich redacts sensitive info.The
ResponseRedactergaurds against nil response bodies by returning returning a response with an error with the description `TMx response body was empty'. As a result, any time there is no response body to be logged we see that error in our logs. This can be confusing when other errors occur, for example network timeouts or connection failures. It makes it appear as though the issue is a missing response body.This commit modifies the
DdpResultto only redact the response body when it is present. When it is absent a nil value is returned. This will cause the empty response body to quit being logged and appearing in cloudwatch when exceptions occur.