fix(middleware-serde): mark error entry non-enumerable #3426
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.
Issue
Ref: D38831498
Description
The
$response
trait includes raw response for AWS service errors only. It's a low-risk that AWS service will include sensitive information in the error responses, but the possibility still exists.This issue is scoped only with the logger, which means the logger should not print out the raw HTTP response for errors by default. This is because customer can access the raw HTTP response in variety of ways in the JavaScript SDK, we cannot prevent them from accessing potentially sensitive information.
This change makes the
$response
inenumerable makes sense here, so that the logger won't print the raw Http response by default. However, if customer need to access the raw Http response when handling the error, they can still access them specifically byerror.$response
.Testing
Unit test
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.