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

Generalize req/res body redaction #131

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Conversation

john-odonnell
Copy link
Contributor

@john-odonnell john-odonnell commented Apr 21, 2023

Desired Outcome

DRYing this up. redactRequestBody and redactResponseBody did a lot of the same stuff, but I couldn't set up a generic type to represent them both.

Implemented Changes

Instead of running body redaction logic against *http.Request and *http.Response objects, operate against pointers to their ReadCloser bodies and int64 content-lengths.

Connected Issue/Story

N/A

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@john-odonnell john-odonnell marked this pull request as ready for review April 21, 2023 17:01
@john-odonnell john-odonnell requested a review from a team as a code owner April 21, 2023 17:01
szh
szh previously approved these changes Apr 24, 2023
Copy link
Contributor

@szh szh left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@codeclimate
Copy link

codeclimate bot commented Apr 26, 2023

Code Climate has analyzed commit 78ce00c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 82.2% (0.0% change).

View more on Code Climate.

@john-odonnell john-odonnell merged commit 0ac17da into master Apr 26, 2023
@john-odonnell john-odonnell deleted the generalize-body-dump branch April 26, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants