[WIP] Update Azure Core logging to allow 'azure-deprecating' header#49946
Conversation
|
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>
| /** | ||
| * {@code azure-deprecating} | ||
| */ | ||
| public static final HttpHeaderName AZURE_DEPRECATING = fromString("azure-deprecating"); |
There was a problem hiding this comment.
clientcore is meant to be agnostic of underlying services it's calling, shouldn't have an Azure-based header here.
|
@copilot update PR title and description with a summary of changes. |
|
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. |
There was a problem hiding this comment.
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_DEPRECATINGto bothcom.azure.core.http.HttpHeaderNameandio.clientcore.core.http.models.HttpHeaderName. - Added
azure-deprecatingto the default allowed header allowlists inHttpLogOptionsandHttpInstrumentationOptions. - 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
| @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. |
Updated the PR title to "Add |
AZURE_DEPRECATINGconstant tocom.azure.core.http.HttpHeaderNameAZURE_DEPRECATINGconstant toio.clientcore.core.http.models.HttpHeaderNameazure-deprecatingtoDEFAULT_HEADERS_ALLOWLISTinHttpLogOptionsazure-deprecatingtoDEFAULT_HEADERS_ALLOWLISTinHttpInstrumentationOptionsCHANGELOG.mdforazure-coreCHANGELOG.mdforclientcore/core