Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lib-dynamodb): fix use of log filters in conjunction with DynamDBDocumentClient #4249

Merged
merged 2 commits into from
Dec 5, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Dec 2, 2022

Issue

#3846

Description

DynamoDBDocument client changes input and output shapes. The logger middleware calls filter functions that expect the base shapes and results in errors.

in this PR:

  • in logger middleware, use the overrides for log filtering if they exist
  • in dynamodbdocument base command, use the previously implemented middleware to insert overrides for log filtering into the handler context

This ensures filtering functions are called on the original input and output shapes unaffected by dynamodbdocument marshaling.

Testing

manual Put and Query command using the dynamodbdocument client.

@kuhe kuhe requested a review from a team as a code owner December 2, 2022 21:25
@@ -41,7 +41,8 @@ describe("DynamoDBDocumentClientCommand", () => {
expect(options).toEqual({
name: "DocumentMarshall",
override: true,
step: "initialize",
relation: "before",
toMiddleware: "serializerMiddleware",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't strictly necessary since the serializer in in the serialize stage and this was in the initialize stage, but more explicit

@@ -50,7 +51,8 @@ describe("DynamoDBDocumentClientCommand", () => {
expect(options).toEqual({
name: "DocumentUnmarshall",
override: true,
step: "deserialize",
relation: "before",
toMiddleware: "deserializerMiddleware",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safer to be explicit about this, but it was already in this order

@kuhe kuhe merged commit 1534f62 into aws:main Dec 5, 2022
@kuhe kuhe deleted the fix/document-client branch December 5, 2022 17:49
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants