Skip to content

Ensure HTTP header values are redacted#1490

Merged
bart-vmware merged 1 commit into
mainfrom
http-redact-headers
Mar 18, 2025
Merged

Ensure HTTP header values are redacted#1490
bart-vmware merged 1 commit into
mainfrom
http-redact-headers

Conversation

@bart-vmware
Copy link
Copy Markdown
Member

@bart-vmware bart-vmware commented Mar 17, 2025

Description

By referencing v9 of Microsoft.Extensions.Http, we activate the breaking change that redacts all HTTP headers by default.

I have verified the behavior can be overruled from outside of Steeltoe using (globally):

builder.Services.ConfigureHttpClientDefaults(clientBuilder => clientBuilder.RedactLoggedHeaders(_ => false));

and locally:

builder.Services.AddHttpClient("CloudFoundrySecurity").RedactLoggedHeaders(_ => false);

Adding any of the lines above causes the test CloudFoundrySecurityMiddlewareTest.Redacts_HTTP_headers to fail.

Fixes #1447

Quality checklist

  • Your code complies with our Coding Style.
  • You've updated unit and/or integration tests for your change, where applicable.
  • You've updated documentation for your change, where applicable.
    If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
  • You've added required license files and/or file headers (explaining where the code came from with proper attribution), where code is copied from StackOverflow, a blog, or OSS.

@bart-vmware bart-vmware marked this pull request as ready for review March 17, 2025 17:30
@bart-vmware bart-vmware requested a review from TimHess March 17, 2025 17:30
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@TimHess TimHess left a comment

Choose a reason for hiding this comment

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

LGTM

@TimHess TimHess added this to the 4.0.0-rc1 milestone Mar 17, 2025
@bart-vmware bart-vmware added the ReleaseLine/4.x Identified as a feature/fix for the 4.x release line label Mar 18, 2025
@bart-vmware bart-vmware merged commit ac34e9a into main Mar 18, 2025
@bart-vmware bart-vmware deleted the http-redact-headers branch March 18, 2025 08:16
@bart-vmware bart-vmware added Component/Management Issues related to Steeltoe Management (actuators) Component/Discovery Issues related to Steeltoe Service Discovery labels May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component/Discovery Issues related to Steeltoe Service Discovery Component/Management Issues related to Steeltoe Management (actuators) ReleaseLine/4.x Identified as a feature/fix for the 4.x release line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review header redaction

2 participants