Skip to content

x-ms-authorization-auxiliary header should be redactedΒ #17271

@jiasli

Description

@jiasli

Is your feature request related to a problem? Please describe.

x-ms-authorization-auxiliary header's value is logged by NetworkTraceLoggingPolicy, because only authorization header is redacted.

Even though x-ms-authorization-auxiliary is not supported by Track 2 SDK yet (#8313), Azure CLI is manually adding this header to support cross-tenant auth (Azure/azure-cli#16797).

Describe the solution you'd like

Make an ARMNetworkTraceLoggingPolicy, just like ARMHttpLoggingPolicy. SDKs should use ARMNetworkTraceLoggingPolicy instead of NetworkTraceLoggingPolicy, so that x-ms-authorization-auxiliary can also be redacted.

NetworkTraceLoggingPolicy is created in xxxClientConfiguration, like NetworkManagementClientConfiguration (which belongs to a specific SDK):

self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)

We should change this line to

self.logging_policy = kwargs.get('logging_policy') or policies.ARMNetworkTraceLoggingPolicy(**kwargs)

but this of course requires all existing SDKs to be regenerated.

Describe alternatives you've considered

Add the redacting x-ms-authorization-auxiliary behavior directly to NetworkTraceLoggingPolicy from azure-core.

Metadata

Metadata

Assignees

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions