json-api-dotnet / JsonApiDotNetCore

A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core.
https://www.jsonapi.net
MIT License
662 stars 160 forks source link

Filter operations based on GenerateControllerEndpoints usage #1561

Closed bkoelman closed 3 weeks ago

bkoelman commented 3 weeks ago

This PR adds IAtomicOperationFilter, which is used to constrain the exposed atomic:operations. The default implementation filters based on the usage of GenerateControllerEndpoints (which defaults to All, in which case all operations are exposed).

See the related issue for notes on this breaking change.

Fixes #1560.

QUALITY CHECKLIST

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 90.83%. Comparing base (461d6d3) to head (e47faf3).

Files Patch % Lines
...NetCore/AtomicOperations/DefaultOperationFilter.cs 75.00% 1 Missing and 2 partials :warning:
...NetCore/AtomicOperations/IAtomicOperationFilter.cs 0.00% 2 Missing :warning:
...ore/Controllers/BaseJsonApiOperationsController.cs 95.55% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1561 +/- ## ========================================== - Coverage 90.84% 90.83% -0.02% ========================================== Files 346 348 +2 Lines 11097 11158 +61 Branches 1821 1828 +7 ========================================== + Hits 10081 10135 +54 - Misses 669 673 +4 - Partials 347 350 +3 ```

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