In this version we focused on reworking on throttling internal API and our DjangoSession auth support.
Breaking changes
- Breaking: Renamed
APIRedirectErrortoRedirectTo, #922 - Breaking: Split
BaseThrottleBackendintoBaseThrottleAsyncBackend
andBaseThrottleSyncBackend, #942 - Breaking: Renamed
DjangoCacheintoSyncDjangoCache,
addedAsyncDjangoCache, #942 - Breaking: Changed
BaseThrottleBackendAPI: now it requires
.incrand.getmethods, the first one should ideally
be an atomic increment, the second one is for reading objects only, #942 - Breaking: Removed
BaseThrottleAlgorithm.recordmethod,
nowBaseThrottleAlgorithm.accessmust also record accesses.
This will help to make throttling more atomic, #942
Migrations prompt
User-facing changes:
Apply this change to the code that uses `django-modern-rest`:
1. Replace `dmr.response.APIRedirectError` with `dmr.response.RedirectTo`
2. Replace `dmr.throttling.backend.DjangoCache`
with `dmr.throttling.backend.SyncDjangoCache` for sync throttles
and with `dmr.throttling.backend.AsyncDjangoCache` for async throttlesFeatures
- Added
SyncRedisandAsyncRedisthrottling backends, #977 - Added
RefreshTokenSyncControllerandRefreshTokenAsyncController
to issue new access/refresh token pairs from a valid refresh token, #907 - Added
validate_negotiationmetadata flag, so we can explicitly validate,
that returned response followed the negotiation process, #711 - Added
accepted_headeras a faster alternative
todjango'sHttpRequest.accepts, #854
Bugfixes
- Fixed OpenAPI schema for Django session auth
whenCSRF_USE_SESSIONS=True, #674 - Fixed that
itemSchemawas possible to be rendered
in OpenAPI3.0.0and3.1.0, #908 - Fixed response validation when global error handler returns
HttpResponsewith a different content type than the negotiated
renderer, #711 - Fixed
collectstaticfailure when usingManifestStaticFilesStorage, #927 - Fixed
datetimevalidation when using.to_response, #938 - Fixed a bug that
ObtainTokensAsyncControllerwas not setting
therequest.auserattribute, #953 - Fixed a bug that
JWTSyncAuthwas not settingrequest.auser, #953 - Fixed
ResponseNegotiatorraisingNotAcceptableErroron streaming
endpoints whenAccept: text/event-streamwas sent without
application/json(the default browserEventSourcecase), which
made 4xx/5xx error bodies and response validation crash with a 500
instead of rendering the configured non-streaming default, #962 - Fixed that original traceback was not shown
forBaseSchemaGenerator.get_schema, #961
Misc
- Optimized
dmr_clientanddmr_rftest fixtures to usemsgspec
for JSON encoding and decoding when available, #889 and #976 - Optimized how per-endpoint throttle locks are used, #942
New Contributors
- @sh1rokovs made their first contribution in #711
- @azad-mammedov made their first contribution in #913
- @Stranger6667 made their first contribution in #917
- @hydrauluu made their first contribution in #940
- @Peopl3s made their first contribution in #947
- @mvanhorn made their first contribution in #950
- @MikeVL made their first contribution in #964
Full Changelog: 0.7.0...0.8.0