dotnet / SqlClient

Microsoft.Data.SqlClient provides database connectivity to SQL Server for .NET applications.
MIT License
859 stars 288 forks source link

Merge | Deprecate Code Access Security #3028

Open edwardneal opened 1 day ago

edwardneal commented 1 day ago

This PR removes the implementation of the public SqlClientPermission and SqlClientPermissionAttribute types, obsoleting them with the message "Code Access Security is not supported or honored by the runtime." The SqlClientPermission CAS behaviour now aligns with the rest of .NET Framework 4.0+ and .NET Core.

CAS is still present in various places throughout the library, but none of these are public. A subsequent PR can remove these references, they looked like they'd make this one harder to review.

/cc @benrr101 - this eliminates the need to merge DBConnectionString and NameValuePermission: these types are internal, and unreferenced after this PR is merged. I'm planning to delete them. I've not got any strong opinions on how to tackle the merge of SqlClientPermission and SqlClientPermissionAttribute though; it seems odd to merge already-obsolete classes, but it's a divergence in the API surface to leave them apart.

codecov[bot] commented 1 day ago

Codecov Report

Attention: Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.

Project coverage is 72.62%. Comparing base (1b9df10) to head (2b4b93c).

Files with missing lines Patch % Lines
...rc/Microsoft/Data/SqlClient/SqlClientPermission.cs 30.00% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3028 +/- ## ========================================== - Coverage 72.64% 72.62% -0.03% ========================================== Files 285 285 Lines 59160 59011 -149 ========================================== - Hits 42979 42856 -123 + Misses 16181 16155 -26 ``` | [Flag](https://app.codecov.io/gh/dotnet/SqlClient/pull/3028/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [addons](https://app.codecov.io/gh/dotnet/SqlClient/pull/3028/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `92.58% <ø> (ø)` | | | [netcore](https://app.codecov.io/gh/dotnet/SqlClient/pull/3028/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `75.39% <ø> (+0.01%)` | :arrow_up: | | [netfx](https://app.codecov.io/gh/dotnet/SqlClient/pull/3028/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `71.03% <36.36%> (-0.06%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: