Skip to content

[WIP] Update Azure Core logging to allow 'azure-deprecating' header - #49946

Open
heaths with Copilot wants to merge 2 commits into
mainfrom
copilot/update-azure-core-logging-defaults
Open

[WIP] Update Azure Core logging to allow 'azure-deprecating' header#49946
heaths with Copilot wants to merge 2 commits into
mainfrom
copilot/update-azure-core-logging-defaults

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
  • Add AZURE_DEPRECATING constant to com.azure.core.http.HttpHeaderName
  • Add AZURE_DEPRECATING constant to io.clientcore.core.http.models.HttpHeaderName
  • Add azure-deprecating to DEFAULT_HEADERS_ALLOWLIST in HttpLogOptions
  • Add azure-deprecating to DEFAULT_HEADERS_ALLOWLIST in HttpInstrumentationOptions
  • Update CHANGELOG.md for azure-core
  • Update CHANGELOG.md for clientcore/core
  • Update/add test coverage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
35 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Add `azure-deprecating` to the default unsanitized/allowed response header
list in both `azure-core` (HttpLogOptions) and `clientcore/core`
(HttpInstrumentationOptions), so the header is logged without redaction
by default. Also add the corresponding `AZURE_DEPRECATING` constant to
both `HttpHeaderName` classes and update tests and changelogs.

Related: https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#deprecating-behavior-notification

Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
Copilot AI requested a review from heaths July 27, 2026 21:44
/**
* {@code azure-deprecating}
*/
public static final HttpHeaderName AZURE_DEPRECATING = fromString("azure-deprecating");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

clientcore is meant to be agnostic of underlying services it's calling, shouldn't have an Azure-based header here.

@heaths
heaths marked this pull request as ready for review July 27, 2026 22:07
@heaths
heaths requested a review from JonathanGiles as a code owner July 27, 2026 22:07
Copilot AI review requested due to automatic review settings July 27, 2026 22:07
@heaths
heaths requested review from a team, samvaity and vcolin7 as code owners July 27, 2026 22:07
@heaths

heaths commented Jul 27, 2026

Copy link
Copy Markdown
Member

@copilot update PR title and description with a summary of changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
34 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Azure Core (azure-core) and Client Core (clientcore) HTTP logging allowlists to treat the azure-deprecating response/request header as safe to log without redaction, and adds corresponding HttpHeaderName constants plus regression tests.

Changes:

  • Added AZURE_DEPRECATING to both com.azure.core.http.HttpHeaderName and io.clientcore.core.http.models.HttpHeaderName.
  • Added azure-deprecating to the default allowed header allowlists in HttpLogOptions and HttpInstrumentationOptions.
  • Added/updated tests and CHANGELOG entries to cover the new default allowlist behavior.
Show a summary per file
File Description
sdk/core/azure-core/src/test/java/com/azure/core/http/policy/HttpLogOptionsTest.java Adds a regression test for azure-deprecating being included by default.
sdk/core/azure-core/src/main/java/com/azure/core/http/policy/HttpLogOptions.java Extends the default header allowlist to include AZURE_DEPRECATING.
sdk/core/azure-core/src/main/java/com/azure/core/http/HttpHeaderName.java Introduces HttpHeaderName.AZURE_DEPRECATING.
sdk/core/azure-core/CHANGELOG.md Documents the new default logging behavior (needs cleanup per comments).
sdk/clientcore/core/src/test/java/io/clientcore/core/http/pipeline/HttpInstrumentationLoggingTests.java Adds a regression test for the default allowlist containing AZURE_DEPRECATING.
sdk/clientcore/core/src/main/java/io/clientcore/core/http/pipeline/HttpInstrumentationOptions.java Extends the default header allowlist to include AZURE_DEPRECATING.
sdk/clientcore/core/src/main/java/io/clientcore/core/http/models/HttpHeaderName.java Introduces HttpHeaderName.AZURE_DEPRECATING.
sdk/clientcore/core/CHANGELOG.md Documents the new default logging behavior (wording should match actual behavior).

Review details

  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment on lines +40 to +44
@Test
public void defaultAllowlistContainsAzureDeprecating() {
assertTrue(HttpLogOptions.DEFAULT_HEADERS_ALLOWLIST.contains(HttpHeaderName.AZURE_DEPRECATING),
"azure-deprecating should be in the default headers allowlist");
}

### Features Added

- Added `azure-deprecating` to the default allowed (unsanitized) HTTP response header list so it is logged without redaction. ([#XXXXX](https://github.com/Azure/azure-sdk-for-java/pull/XXXXX))

### Features Added

- Added `azure-deprecating` to the default allowed (unsanitized) HTTP response header list so it is logged without redaction.

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update PR title and description with a summary of changes.

Updated the PR title to "Add azure-deprecating to default allowed HTTP response headers" and rewrote the description to summarize the cumulative changes in the PR.

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.

4 participants