Skip to content

Optimize log sanitization with SearchValues for improved performance#3341

Merged
mdchennu merged 7 commits intodevfrom
copilot/update-log-sanitization-method
Oct 14, 2025
Merged

Optimize log sanitization with SearchValues for improved performance#3341
mdchennu merged 7 commits intodevfrom
copilot/update-log-sanitization-method

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 8, 2025

Summary

Updated the Sanitize method in LogHelper.cs to use SearchValues<char> for improved performance on .NET 8+, while maintaining full backward compatibility with older frameworks.

Changes Made

  • Added conditional using System.Buffers directive for .NET 8+
  • Created static SearchValues<char> field with all 108 control and format characters
  • Implemented efficient SearchValues-based sanitization for .NET 8+
  • Maintained original implementation as fallback for older frameworks
  • Preserved identical output format (\r, \n, \t, \uXXXX)
  • Added 15 comprehensive tests covering all character types and edge cases
  • Fixed encoding issues on lines 462 and 482 (preserved original file encoding)
  • Added targeted benchmark for log sanitization performance

Benchmark Added

Created LogSanitizationBenchmarks.cs with the following scenarios:

  • Baseline: String with no special characters (tests early return optimization)
  • Common control chars: Strings with \r, \n, \t
  • Unicode format chars: Zero-width spaces, directional marks
  • Mixed chars: Combination of control and format characters
  • Long strings: Both with and without special characters to test performance at scale

Run with: dotnet run -c release -f net9.0 --filter Microsoft.IdentityModel.Benchmarks.LogSanitizationBenchmarks*

Character Set (108 total)

  • All ASCII control characters (U+0000-U+001F, U+007F-U+009F)
  • All Unicode format characters (Cf category)
  • Including: zero-width spaces, directional marks, and other format characters

Testing

  • All 72 tests pass on .NET 8 (57 original + 15 new)
  • All 72 tests pass on .NET 9
  • Output format verified identical to previous implementation
  • Backward compatibility maintained for all target frameworks
  • Benchmark builds successfully for net6.0, net8.0, and net9.0
  • File encoding preserved on lines 462 and 482
Original prompt

This section details on the original issue you should resolve

<issue_title>Log sanitization with use of SearchValues v1</issue_title>
<issue_description>Problem Statement.
We want to update the Sanitize method:

to utilize SearchValues. All values which need to be sanitized can be added to a SearchValues collection.

Specific Characters to Sanitize:

  • '\r' (Carriage Return, U+000D)
  • '\n' (Line Feed, U+000A)
  • '\t' (Tab, U+0009)
  • All other ASCII control characters: U+0000-U+0008, U+000B-U+000C, U+000E-U+001F, U+007F-U+009F
  • All Unicode characters where char.IsControl(c) is true (Unicode category Cc)
  • All Unicode characters where CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.Format (Unicode category Cf), e.g.:
    • U+200B (Zero Width Space)
    • U+200C (Zero Width Non-Joiner)
    • U+200D (Zero Width Joiner)
    • U+200E (Left-to-Right Mark)
    • U+200F (Right-to-Left Mark)
    • U+202A-U+202E (Directional formatting)
    • U+2060-U+206F (Various format characters)
    • U+FEFF (Zero Width No-Break Space)

Implementation Clarifications:

  • The referenced SanitizeEntryFromFilePath method from dotnet/runtime should be used as a performance pattern reference only. The actual character set for sanitization should follow this issue's explicit enumeration.
  • The new implementation must produce identical output to the current method, including string formatting (e.g., using "\u{(int)c:X4}" for control/format characters).

Steps:

  1. Update the Sanitize method to have a SearchValues collection that includes the above values. The list of control and format characters should be fully enumerated and hardcoded into a static SearchValues collection.
  2. Update the Sanitize method to follow the structure of the method called SanitizeEntryFromFilePath: dotnet/runtime/src/libraries/Common/src/System/IO/Archiving.Utils.Windows.cs#L11
  3. Update tests accordingly. If tests to cover the following edge cases are not present, add them: Strings with no sanitizable characters (performance fast path), Strings with only ASCII control characters, Strings with Unicode format characters. Very long strings, and Null/empty string handling

Only update the Sanitize method as described above; do not update any other methods.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #3338

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Update Sanitize method to use SearchValues for sanitization Optimize log sanitization with SearchValues for improved performance Oct 8, 2025
Copilot AI requested a review from mdchennu October 8, 2025 18:54
@mdchennu
Copy link
Copy Markdown
Contributor

mdchennu commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 8, 2025

@copilot please update the tests in this file: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/test/Microsoft.IdentityModel.Logging.Tests/LogHelperTests.c...

I've added 15 comprehensive tests to LogHelperTests.cs covering:

  • Empty strings and strings with no special characters
  • Control characters (ASCII and Unicode)
  • Format characters (zero-width spaces, directional marks, soft hyphens)
  • Arabic format characters
  • Interlinear annotation characters
  • Edge cases (consecutive chars, chars at start/end, long strings)
  • Mix of all character types

All 72 tests pass on both .NET 8 and .NET 9. See commit 4f47a7d.

@mdchennu mdchennu marked this pull request as ready for review October 8, 2025 20:50
@mdchennu mdchennu requested a review from a team as a code owner October 8, 2025 20:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 8, 2025

Summary

Summary
Generated on: 10/8/2025 - 8:53:37 PM
Coverage date: 10/8/2025 - 8:44:16 PM - 10/8/2025 - 8:52:54 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 8, 2025

Summary

Summary
Generated on: 10/8/2025 - 9:02:10 PM
Coverage date: 10/8/2025 - 8:53:32 PM - 10/8/2025 - 9:01:27 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 8, 2025

Summary

Summary
Generated on: 10/8/2025 - 9:03:01 PM
Coverage date: 10/8/2025 - 8:54:20 PM - 10/8/2025 - 9:02:18 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@keegan-caruso
Copy link
Copy Markdown
Contributor

Can we have a more targeted benchmark for just the logging sanitization?

Comment thread src/Microsoft.IdentityModel.Logging/LogHelper.cs Outdated
Comment thread src/Microsoft.IdentityModel.Logging/LogHelper.cs Outdated
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 9, 2025

Can we have a more targeted benchmark for just the logging sanitization?

I've added a targeted benchmark specifically for log sanitization in LogSanitizationBenchmarks.cs. It tests 6 different scenarios:

  1. Baseline - No special characters (tests early return optimization)
  2. Common control chars (\r, \n, \t)
  3. Unicode format chars (zero-width spaces, directional marks)
  4. Mixed control and format characters
  5. Long strings without special characters
  6. Long strings with sparse special characters

Run with: dotnet run -c release -f net9.0 --filter Microsoft.IdentityModel.Benchmarks.LogSanitizationBenchmarks*

See commit 9a2f8e5.

gunndabad added a commit to DFE-Digital/teaching-record-system that referenced this pull request Apr 17, 2026
…nIdConnect (#3222)

[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Updated
[Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web)
from 4.0.1 to 4.6.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Identity.Web's
releases](https://github.com/AzureAD/microsoft-identity-web/releases)._

## 4.6.0

## What's Changed

* Move boilerplate code skills to IdWeb, and add Aspire DevApp
demonstrating Blazor authentication components by @​Copilot in
AzureAD/microsoft-identity-web#3721
* Bump MSAL to 4.83.1 and re-enable Managed Identity CAE tests by
@​Copilot in AzureAD/microsoft-identity-web#3746
* Bump Abstractions to 11.2 by @​bgavrilMS in
AzureAD/microsoft-identity-web#3749
* Update documentation to reference Blazor helpers from
Microsoft.Identity.Web package by @​Copilot in
AzureAD/microsoft-identity-web#3723


**Full Changelog**:
AzureAD/microsoft-identity-web@4.5.0...4.6.0

## 4.4.0

### New features
- Add AOT-compatible web API authentication for .NET 10+. See
[#​3705](AzureAD/microsoft-identity-web#3705)
and
[#​3664](AzureAD/microsoft-identity-web#3664).
- Propagate long-running web API session key back to callers in user
token acquisition. See
[#​3728](AzureAD/microsoft-identity-web#3728).
- Add OBO event initialization for OBO APIs. See
[#​3724](AzureAD/microsoft-identity-web#3724).
- Add support for calling `WithClientClaims` flow for token acquisition.
See
[#​3623](AzureAD/microsoft-identity-web#3623).
- Add `OnBeforeTokenAcquisitionForOnBehalfOf` event. See
[#​3680](AzureAD/microsoft-identity-web#3680).

### Bug fixes
- Throw `InvalidOperationException` with actionable message when a
custom credential is not registered. See
[#​3626](AzureAD/microsoft-identity-web#3626).
- Fix event firing for
`InvokeOnBeforeTokenAcquisitionForOnBehalfOfAsync`. See
[#​3717](AzureAD/microsoft-identity-web#3717).
- Update `OnBeforeTokenAcquisitionForOnBehalfOf` to construct
`ClaimsPrincipal` from token. See
[#​3714](AzureAD/microsoft-identity-web#3714).
- Add a retry counter for acquire token and updated tests with a fake
secret. See
[#​3682](AzureAD/microsoft-identity-web#3682).
- Fix OBO user error handling. See
[#​3712](AzureAD/microsoft-identity-web#3712).
- Fix override merging for app token (and others). See
[#​3644](AzureAD/microsoft-identity-web#3644).
- Fix certificate reload logic to only trigger on certificate-specific
errors. See
[#​3653](AzureAD/microsoft-identity-web#3653).
- Update ROPC flow CCA to pass `SendX5C` to MSAL. See
[#​3671](AzureAD/microsoft-identity-web#3671).

### Dependencies updates
- Bump `qs` in `/tests/DevApps/SidecarAdapter/typescript`. See
[#​3725](AzureAD/microsoft-identity-web#3725).
- Downgrade Microsoft.Extensions.Configuration.Binder to 2.1.0 on .NET
Framework. See
[#​3730](AzureAD/microsoft-identity-web#3730).
- Update .NET SDK to 10.0.103 to address DOTNET-Security-10.0
vulnerability. See
[#​3726](AzureAD/microsoft-identity-web#3726).
- Upgrade to Microsoft.Identity.Abstractions 11 for AoT compatibility.
See
[#​3699](AzureAD/microsoft-identity-web#3699).
- Update to MSAL 4.81.0. See
[#​3665](AzureAD/microsoft-identity-web#3665).

### Documentation
- Add documentation for auto-generated session key for long-running OBO
session. See
[#​3729](AzureAD/microsoft-identity-web#3729).
- Improve the Aspire doc article and skills. See
[#​3695](AzureAD/microsoft-identity-web#3695).
- Add an article and agent skill to add Entra ID to an Aspire app. See
[#​3689](AzureAD/microsoft-identity-web#3689).
- Fix misleading comment in
`CertificatelessOptions.ManagedIdentityClientId`. See
[#​3667](AzureAD/microsoft-identity-web#3667).
- Add Copilot explore tool functionality. See
[#​3694](AzureAD/microsoft-identity-web#3694).

### Fundamentals
- Remove unnecessary warning suppression. See
[#​3715](AzureAD/microsoft-identity-web#3715).
- Migrate labs to Lab.API 2.x (first pass). See
[#​3710](AzureAD/microsoft-identity-web#3710).
- Update Sidecar E2E test constants. See
[#​3693](AzureAD/microsoft-identity-web#3693).
- Fix intermittent failures in `CertificatesObserverTests`. See
[#​3687](AzureAD/microsoft-identity-web#3687).
- Add validation baseline exclusions. See
[#​3684](AzureAD/microsoft-identity-web#3684).
- Add dSTS integration tests. See
[#​3677](AzureAD/microsoft-identity-web#3677).
- Fix FIC test. See
[#​3663](AzureAD/microsoft-identity-web#3663).
- Update IdentityWeb version, build logic, and validation. See
[#​3659](AzureAD/microsoft-identity-web#3659).

### New Contributors
* @​XiaoxinMS2 made their first contribution in
AzureAD/microsoft-identity-web#3677
* @​RyAuld made their first contribution in
AzureAD/microsoft-identity-web#3687
* @​agocke made their first contribution in
AzureAD/microsoft-identity-web#3664
* @​MZOLN made their first contribution in
AzureAD/microsoft-identity-web#3700
* @​christian-posta made their first contribution in
AzureAD/microsoft-identity-web#3644
* @​4gust made their first contribution in
AzureAD/microsoft-identity-web#3682
* @​rayluo made their first contribution in
AzureAD/microsoft-identity-web#3714

## 4.4.0-preview.1

### New features
- Add AOT-compatible web API authentication for .NET 10+. See
[#​3705](AzureAD/microsoft-identity-web#3705)
and
[#​3664](AzureAD/microsoft-identity-web#3664).
- Propagate long-running web API session key back to callers in user
token acquisition. See
[#​3728](AzureAD/microsoft-identity-web#3728).
- Add OBO event initialization for OBO APIs. See
[#​3724](AzureAD/microsoft-identity-web#3724).
- Add support for calling `WithClientClaims` flow for token acquisition.
See
[#​3623](AzureAD/microsoft-identity-web#3623).
- Add `OnBeforeTokenAcquisitionForOnBehalfOf` event. See
[#​3680](AzureAD/microsoft-identity-web#3680).

### Bug fixes
- Throw `InvalidOperationException` with actionable message when a
custom credential is not registered. See
[#​3626](AzureAD/microsoft-identity-web#3626).
- Fix event firing for
`InvokeOnBeforeTokenAcquisitionForOnBehalfOfAsync`. See
[#​3717](AzureAD/microsoft-identity-web#3717).
- Update `OnBeforeTokenAcquisitionForOnBehalfOf` to construct
`ClaimsPrincipal` from token. See
[#​3714](AzureAD/microsoft-identity-web#3714).
- Add a retry counter for acquire token and updated tests with a fake
secret. See
[#​3682](AzureAD/microsoft-identity-web#3682).
- Fix OBO user error handling. See
[#​3712](AzureAD/microsoft-identity-web#3712).
- Fix override merging for app token (and others). See
[#​3644](AzureAD/microsoft-identity-web#3644).
- Fix certificate reload logic to only trigger on certificate-specific
errors. See
[#​3653](AzureAD/microsoft-identity-web#3653).
- Update ROPC flow CCA to pass `SendX5C` to MSAL. See
[#​3671](AzureAD/microsoft-identity-web#3671).

### Dependencies updates
- Bump `qs` in `/tests/DevApps/SidecarAdapter/typescript`. See
[#​3725](AzureAD/microsoft-identity-web#3725).
- Downgrade Microsoft.Extensions.Configuration.Binder to 2.1.0 on .NET
Framework. See
[#​3730](AzureAD/microsoft-identity-web#3730).
- Update .NET SDK to 10.0.103 to address DOTNET-Security-10.0
vulnerability. See
[#​3726](AzureAD/microsoft-identity-web#3726).
- Upgrade to Microsoft.Identity.Abstractions 11 for AoT compatibility.
See
[#​3699](AzureAD/microsoft-identity-web#3699).
- Update to MSAL 4.81.0. See
[#​3665](AzureAD/microsoft-identity-web#3665).

### Documentation
- Add documentation for auto-generated session key for long-running OBO
session. See
[#​3729](AzureAD/microsoft-identity-web#3729).
- Improve the Aspire doc article and skills. See
[#​3695](AzureAD/microsoft-identity-web#3695).
- Add an article and agent skill to add Entra ID to an Aspire app. See
[#​3689](AzureAD/microsoft-identity-web#3689).
- Fix misleading comment in
`CertificatelessOptions.ManagedIdentityClientId`. See
[#​3667](AzureAD/microsoft-identity-web#3667).
- Add Copilot explore tool functionality. See
[#​3694](AzureAD/microsoft-identity-web#3694).

### Fundamentals
- Remove unnecessary warning suppression. See
[#​3715](AzureAD/microsoft-identity-web#3715).
- Migrate labs to Lab.API 2.x (first pass). See
[#​3710](AzureAD/microsoft-identity-web#3710).
- Update Sidecar E2E test constants. See
[#​3693](AzureAD/microsoft-identity-web#3693).
- Fix intermittent failures in `CertificatesObserverTests`. See
[#​3687](AzureAD/microsoft-identity-web#3687).
- Add validation baseline exclusions. See
[#​3684](AzureAD/microsoft-identity-web#3684).
- Add dSTS integration tests. See
[#​3677](AzureAD/microsoft-identity-web#3677).
- Fix FIC test. See
[#​3663](AzureAD/microsoft-identity-web#3663).
- Update IdentityWeb version, build logic, and validation. See
[#​3659](AzureAD/microsoft-identity-web#3659).

## 4.3.0

### New features
- Added token binding (mTLS PoP) scenario for confidential client
(app-only) token acquisition and downstream API calls. See
[#​3622](AzureAD/microsoft-identity-web#3622).

### Dependencies updates
- Bumped **qs** from 6.14.0 to 6.14.1 in
/tests/DevApps/SidecarAdapter/typescript. See [#​3660](
AzureAD/microsoft-identity-web#3660).

### Documentation
- Modernized Identity Web documentation, which is now can be found in
[docs](https://github.com/AzureAD/microsoft-identity-web/tree/master/docs).
See
[#​3566](AzureAD/microsoft-identity-web#3566).
- Added token binding (mTLS PoP) documentation. See
[#​3661](AzureAD/microsoft-identity-web#3661).

## 4.2.0

# What's Changed

## New features

- Added CAE claims support for FIC + Managed Identity. See #​3647 for
details.
- Added AddMicrosoftIdentityMessageHandler extension methods for
IHttpClientBuilder. See #​3649 for details.

## Bug fixes


- Fixed tenant not being propagated in credential FIC acquisition. See
#​3633 for details.
- Fixed ForAgentIdentity hardcoded 'AzureAd' ConfigurationSection to
respect AuthenticationOptionsName. See #​3635 for details.
- Fixed GetTokenAcquirer to propagate MicrosoftEntraApplicationOptions
properties. See #​3651 for details.
- Added meaningful error message when identity configuration is missing.
See #​3637 for details.

## Dependencies updates

- Update Microsoft.Identity.Abstractions to version 10.0.0.
- Bump express from 5.1.0 to 5.2.0 in
/tests/DevApps/SidecarAdapter/typescript. #​3636
- Bump jws from 3.2.2 to 3.2.3 in
/tests/DevApps/SidecarAdapter/typescript. #​3641

## Fundamentals

- Update support policy. #​3656
- Update agent identity coordinates in E2E tests after deauth. #​3640
- Update E2E agent identity configuration to new tenant. #​3646


**Full Changelog**:
AzureAD/microsoft-identity-web@4.1.1...4.2.0

## 4.1.1

### Bug fixes
- Authority-only configuration parsing improvements: Early parsing of
Authority into Instance/TenantId and defensive fallback in
PrepareAuthorityInstanceForMsal. Behavior is backward compatible;
Authority is still ignored when Instance/TenantId explicitly
provided—now surfaced via a warning. See
[#​3612](AzureAD/microsoft-identity-web#3612).

### New features
- Added warning diagnostics for conflicting Authority vs
Instance/TenantId: Emitting a single structured warning when both styles
are provided. See
[#​3611](AzureAD/microsoft-identity-web#3611).

### Fundamentals
- Expanded authority test matrix: Coverage for AAD (v1/v2), B2C (/tfp/
normalization, policy path), CIAM (PreserveAuthority), query parameters,
scheme-less forms, and conflict scenarios. See
[#​3610](AzureAD/microsoft-identity-web#3610).

## 4.1.0

### New features
- Migrate to .NET 10 GA.
[#​3449](AzureAD/microsoft-identity-web#3449)
and
[#​3590](AzureAD/microsoft-identity-web#3590)

### Dependencies updates
- Bump MSAL.NET to version
[4.79.2](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/releases/tag/4.79.2)
and handle changes to deprecated WithExtraQueryParameters APIs.
[#​3583](AzureAD/microsoft-identity-web#3583)
- Update Microsoft.IdentityModel and Abstractions versions.
[#​3604](AzureAD/microsoft-identity-web#3604)
- Update coverlet.collector to 6.0.4.
[#​3587](AzureAD/microsoft-identity-web#3587)
- Update package validation baseline version to 4.0.0.
[#​3589](AzureAD/microsoft-identity-web#3589)
- Bump js-yaml from 4.1.0 to 4.1.1 in
/tests/DevApps/SidecarAdapter/typescript.
[#​3595](AzureAD/microsoft-identity-web#3595)

### Entra ID SDK sidecar
- Restrict hosts to localhost for sidecar.
[#​3579](AzureAD/microsoft-identity-web#3579)
- Update http file to match endpoints.
[#​3555](AzureAD/microsoft-identity-web#3555)
- Revise sidecar issue template for Entra ID.
[#​3577](AzureAD/microsoft-identity-web#3577)

### Documentation
- Update README to include Entra SDK container info.
[#​3578](AzureAD/microsoft-identity-web#3578)

### Fundamentals
- Include NET 9.0 in template-install-dependencies.
[#​3593](AzureAD/microsoft-identity-web#3593)
- Fix CodeQL alerts.
[#​3591](AzureAD/microsoft-identity-web#3591)
- Suppression file is needed.
[#​3592](AzureAD/microsoft-identity-web#3592)

Commits viewable in [compare
view](AzureAD/microsoft-identity-web@4.0.1...4.6.0).
</details>

Updated
[Microsoft.IdentityModel.Protocols.OpenIdConnect](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet)
from 8.14.0 to 8.15.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.IdentityModel.Protocols.OpenIdConnect's
releases](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases)._

## 8.15.0

## New Features
- **Add ECDsa support in `X509SecurityKey` and
`JsonWebKeyConverter.ConvertFromX509SecurityKey`**
Extended `X509SecurityKey` and
`JsonWebKeyConverter.ConvertFromX509SecurityKey` to support ECDSA keys.
See PR
[#​2377](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#2377)
for details.

## Bug Fixes
- **Sanitize logs to avoid leaking sensitive data**  
Updated logging to sanitize sensitive values, reducing the risk of
inadvertently exposing secrets or PII in logs.
See PR
[#​3316](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3316)
for details.
- **Optimize log sanitization with `SearchValues`**  
Improved the performance of the log sanitization logic introduced
earlier by using `SearchValues`, making sanitization more efficient in
high-throughput scenarios.
See PR
[#​3341](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3341)
for details.
- **Update test for `IDX10400`**  
Adjusted the `IDX10400` test to align with the current behavior and
error messaging.
See PR
[#​3314](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3314)
for details.

## Fundamentals
- **Add supported algorithm tests**  
Added new tests to validate the set of supported cryptographic
algorithms, increasing confidence in algorithm coverage and
compatibility.
See PR
[#​3296](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3296)
for details.
- **Migrate repository agent rules from `.clinerules` to `agents.md`**  
Moved repository agent/AI-assist rules into markdown documentation to
make them more visible and easier to maintain.
See PR
[#​3313](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3313)
for details.
- **Migrate `Microsoft.IdentityModel.TestExtensions` from
Newtonsoft.Json to System.Text.Json**
Updated `Microsoft.IdentityModel.TestExtensions` to use
`System.Text.Json` instead of `Newtonsoft.Json`, aligning tests with the
runtime serialization stack.
See PR
[#​3356](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3356)
for details.
- **Disable code coverage comments**  
Turned off automated code coverage comments on PRs to reduce noise while
retaining coverage data elsewhere.
See PR
[#​3349](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3349)
for details.
- **Fix CodeQL alerts**  
Addressed CodeQL-reported issues to improve security posture and static
analysis cleanliness.
See PR
[#​3364](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3364)
for details.

### .NET 10 / SDK and tooling updates
- **Building with .NET 10 preview / RC 1**  
Updated the repository to build and test against .NET 10.0 preview/RC1,
ensuring early compatibility with the upcoming runtime.
See PRs
[#​3287](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3287),
[#​3357](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3357),
and
[#​3358](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3358)
for details.
- **Fix .NET 10 test execution consistency**  
Ensured consistent use of the `TargetNetNext` parameter across build,
test, and pack phases so .NET 10.0 tests execute reliably.
See PR
[#​3337](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3337)
for details.
- **Update project files and workflows for .NET 10.0 compatibility**  
Adjusted project files and CI workflows to correctly target and run on
.NET 10.0, including test and pack scenarios.
See PR
[#​3363](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3363)
for details.
- **Update .NET version to meet CG compliance**  
Updated the .NET version references to be compliant with corporate
governance (CG) requirements.
See PR
[#​3353](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3353)
for details.
- **Update Coverlet collector and test SDK**  
  - Bumped `CoverletCollectorVersion` to 6.0.4.  
See PR
[#​3333](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#3333)
for details.
- Upgraded `Microsoft.NET.Test.Sdk` to a newer version for improved test
reliability and tooling support.
 ... (truncated)

Commits viewable in [compare
view](AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@8.14.0...8.15.0).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Gunn <[email protected]>
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.

Log sanitization with use of SearchValues v1

5 participants