-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/8.0] Improve usage of Type.GetType
when activating types in data protection
#54762
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ateInstance<IXmlDecryptor>
…taProtection.Tests/XmlEncryption/XmlEncryptionExtensionsTests.cs
amcasey
approved these changes
Mar 26, 2024
oskogstad
added a commit
to digdir/dialogporten
that referenced
this pull request
May 26, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [Microsoft.AspNetCore.Authentication.JwtBearer](https://asp.net/) ([source](https://github.com/dotnet/aspnetcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.AspNetCore.Authentication.JwtBearer/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.AspNetCore.Authentication.JwtBearer/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.AspNetCore.Authentication.JwtBearer/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.AspNetCore.Authentication.JwtBearer/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [Microsoft.AspNetCore.Mvc.NewtonsoftJson](https://asp.net/) ([source](https://github.com/dotnet/aspnetcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.AspNetCore.Mvc.NewtonsoftJson/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [Microsoft.AspNetCore.OpenApi](https://asp.net/) ([source](https://github.com/dotnet/aspnetcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.AspNetCore.OpenApi/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.AspNetCore.OpenApi/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.AspNetCore.OpenApi/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.AspNetCore.OpenApi/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [Microsoft.EntityFrameworkCore.Relational](https://docs.microsoft.com/ef/core/) ([source](https://github.com/dotnet/efcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.EntityFrameworkCore.Relational/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.EntityFrameworkCore.Relational/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.EntityFrameworkCore.Relational/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.EntityFrameworkCore.Relational/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [Microsoft.EntityFrameworkCore.Tools](https://docs.microsoft.com/ef/core/) ([source](https://github.com/dotnet/efcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.EntityFrameworkCore.Tools/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.EntityFrameworkCore.Tools/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.EntityFrameworkCore.Tools/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.EntityFrameworkCore.Tools/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [Microsoft.Extensions.Caching.StackExchangeRedis](https://asp.net/) ([source](https://github.com/dotnet/aspnetcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.Extensions.Caching.StackExchangeRedis/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.Extensions.Caching.StackExchangeRedis/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.Extensions.Caching.StackExchangeRedis/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.Extensions.Caching.StackExchangeRedis/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [Microsoft.Extensions.Http.Polly](https://asp.net/) ([source](https://github.com/dotnet/aspnetcore)) | `8.0.4` -> `8.0.5` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/Microsoft.Extensions.Http.Polly/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Microsoft.Extensions.Http.Polly/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Microsoft.Extensions.Http.Polly/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Microsoft.Extensions.Http.Polly/8.0.4/8.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>dotnet/aspnetcore (Microsoft.AspNetCore.Authentication.JwtBearer)</summary> ### [`v8.0.5`](https://github.com/dotnet/aspnetcore/releases/tag/v8.0.5): .NET 8.0.5 [Release](https://github.com/dotnet/core/releases/tag/v8.0.5) ##### What's Changed - \[release/8.0] Update dependencies from dotnet/source-build-externals by [@​dotnet-maestro](https://github.com/dotnet-maestro) in [dotnet/aspnetcore#54744 - Update branding to 8.0.5 by [@​vseanreesermsft](https://github.com/vseanreesermsft) in [dotnet/aspnetcore#54907 - \[release/8.0] Convert to 1ES templates by [@​RussKie](https://github.com/RussKie) in [dotnet/aspnetcore#54660 - Increase logs and delays in CanLaunchPhotinoWebViewAndClickButton by [@​Eilon](https://github.com/Eilon) in [dotnet/aspnetcore#54608 - \[release/8.0] (deps): Bump src/submodules/googletest from `31993df` to `77afe8e` by [@​dependabot](https://github.com/dependabot) in [dotnet/aspnetcore#54872 - \[release/8.0] Reduce helix-matrix timeout to 5 hours by [@​github-actions](https://github.com/github-actions) in [dotnet/aspnetcore#54778 - \[release/8.0] Preserve RemoteAuthenticationContext during trimming if used in JS interop by [@​halter73](https://github.com/halter73) in [dotnet/aspnetcore#54655 - \[release/8.0] Improve usage of `Type.GetType` when activating types in data protection by [@​github-actions](https://github.com/github-actions) in [dotnet/aspnetcore#54762 - \[release/8.0] Fix route analyzer performance with highly concatenated strings by [@​github-actions](https://github.com/github-actions) in [dotnet/aspnetcore#54763 - \[release/8.0] Suppress .ps1 SDL errors by [@​wtgodbe](https://github.com/wtgodbe) in [dotnet/aspnetcore#54915 - \[release/8.0] Backport test fixes by [@​MackinnonBuck](https://github.com/MackinnonBuck) in [dotnet/aspnetcore#54912 - \[release/8.0] Skip SpotBugs for now by [@​wtgodbe](https://github.com/wtgodbe) in [dotnet/aspnetcore#54952 - Merging internal commits for release/8.0 by [@​vseanreesermsft](https://github.com/vseanreesermsft) in [dotnet/aspnetcore#55034 - \[release/8.0] Update dependencies from dotnet/arcade by [@​dotnet-maestro](https://github.com/dotnet-maestro) in [dotnet/aspnetcore#55061 - \[release/8.0] Update Wix version by [@​github-actions](https://github.com/github-actions) in [dotnet/aspnetcore#55101 **Full Changelog**: dotnet/aspnetcore@v8.0.4...v8.0.5 </details> <details> <summary>dotnet/efcore (Microsoft.EntityFrameworkCore.Relational)</summary> ### [`v8.0.5`](https://github.com/dotnet/efcore/releases/tag/v8.0.5): EF Core 8.0.5 This is a [patch release of EF Core 8.0](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/8.0.5) containing only updates to dependencies. There are no additional fixes in this release beyond those already shipped in EF Core 8.0.4. </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 7am on Sunday,before 7am on Wednesday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/digdir/dialogporten). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ole Jørgen Skogstad <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #54256 to release/8.0
/cc @JamesNK @khellang
Improve usage of
Type.GetType
when activating types in data protectionMicrosoft.AspNetCore.DataProtection was changed in .NET 8 to support AOT. One of the changes caused
Type.GetType(typeName, throwOnError)
to be called earlier than it was in .NET 7 in earlier. In rare circumstances this causes a regression and an error to be thrown.The error occurs if an app is using a custom data protection decryptor, such as
Azure.Extensions.AspNetCore.DataProtection.Keys
from Azure, and the app is on .NET Framework (the data protection supports .NET Framework targets). Even thoughthrowOnError
is false in the call toType.GetType
, .NET Framework strong name binding can still cause the method to fail with an error.The fix is to:
Type.GetType
. An error is treated the same as failing to resolve the type. This makesType.GetType
behavior consistent between .NET 5+ and .NET FrameworkType.GetType
. This is a performance optimization to reduce the need to callType.GetType
. We don't want .NET Framework to throw excessive internal exceptions and hurt performance.Fixes #54253
Fixes #48910
Customer Impact
Microsoft.AspNetCore.DataProtection package 8.0.x can't be used with custom encryptors/decryptors on .NET Framework.
Regression?
This scenario worked without error with
Microsoft.AspNetCore.DataProtection
package 7.0.x and earlier.Risk
Minor changes to the
Microsoft.AspNetCore.DataProtection
library.Verification
Before (error):
![image](https://private-user-images.githubusercontent.com/303201/318634488-6808e2de-6ab8-492f-8f2f-22112e1d1bf2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTE1OTAsIm5iZiI6MTcyNTU5MTI5MCwicGF0aCI6Ii8zMDMyMDEvMzE4NjM0NDg4LTY4MDhlMmRlLTZhYjgtNDkyZi04ZjJmLTIyMTEyZTFkMWJmMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwNlQwMjU0NTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNjY4YzkxZjNmOWY0MTNiNjZhY2RiMzVjNmZiMjIxYjUyZDE0MjBlNmM1ZjhjY2Q4MDA3YTdmNTA3N2ZhODViJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.fuIZa3f-A4UfPih2Fd-NdXjShhKMBmdG5Ptt6jd7wjk)
After (success):
![image](https://private-user-images.githubusercontent.com/303201/318634551-833efec7-e188-4e49-b9fd-9a8f1a14fd10.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTE1OTAsIm5iZiI6MTcyNTU5MTI5MCwicGF0aCI6Ii8zMDMyMDEvMzE4NjM0NTUxLTgzM2VmZWM3LWUxODgtNGU0OS1iOWZkLTlhOGYxYTE0ZmQxMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwNlQwMjU0NTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NjI5MDkwMGQ4YzdiMDY5MTAxNzA1ZjQ3ZjY1OTIxNWU4YmJjMmFkYTE0OTZiYTRjM2Q5YmY4ZjFkZGFiNTA0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.v6hCSziulFcEOPWjngfJBolMJZCyvn1ARqag8QaciYA)
Packaging changes reviewed?
When servicing release/2.1