Skip to content
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

Only cache authorization policies if permitted by policy provider #7705

Merged

Conversation

tobias-tengler
Copy link
Collaborator

@tobias-tengler tobias-tengler commented Nov 9, 2024

Authorization policies should only be cached if the AllowsCachingPolicies property on the IAuthorizationPolicyProvider is set to true.

The policies will stay cached for the vast majority of Hot Chocolate users, since the property is true for the DefaultAuthorizationPolicyProvider, but developers choosing to implement a custom IAuthorizationPolicyProvider now have control over the caching behavior and Hot Chocolate is once again aligned to regular ASP.NET Core ;)

Fixes #7704

@tobias-tengler tobias-tengler force-pushed the tte/only-cache-policies-if-permitted-by-policyprovider branch from 5ff7efc to dab3d9f Compare November 9, 2024 14:56
@tobias-tengler tobias-tengler added the 👓 ready-for-review The PR is ready for review. label Nov 9, 2024
@michaelstaib michaelstaib merged commit 02b1ca8 into main Nov 9, 2024
101 checks passed
@michaelstaib michaelstaib deleted the tte/only-cache-policies-if-permitted-by-policyprovider branch November 9, 2024 15:06
Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.93%. Comparing base (984e263) to head (dab3d9f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7705   +/-   ##
=======================================
  Coverage   73.93%   73.93%           
=======================================
  Files        2917     2917           
  Lines      151097   151116   +19     
  Branches    17556    17560    +4     
=======================================
+ Hits       111716   111732   +16     
- Misses      33527    33529    +2     
- Partials     5854     5855    +1     
Flag Coverage Δ
unittests 73.93% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants