Changelog
Notable changes to rn-forge-django, newest first, in the
Keep a Changelog format.
[Unreleased]
[0.7.0] - 2026-11-17
Changed
-
The
rn-forge-commonsrequirement admits 0.10 (<0.11). -
The
rn-forge-authrequirement is>=0.2.0,<0.3; login admission and principal projection come from 0.2. -
Login admission, transaction-cookie parsing and JSON login fields now come from
rn-forge-auth, with no behaviour change. -
Bearer/session principal projection, persisted records and fixed-window arithmetic now come from
rn-forge-auth, with no behaviour change.
Removed
TRANSACTION_COOKIEis no longer exported from the package; import it fromrn_forge.auth.
Fixed
- A tabular export no longer issues one query per row for foreign-key columns
when the viewset's queryset has no
select_related. - More query or form fields (or files) than Django's upload limits is a 400 problem instead of a 500.
- Malformed
pageSizevalues fall back to the default instead of causing a server error; oversized positive values use the cap. - Composite model lookup keys containing separators no longer collide.
- A competing idempotent request could execute after claim expiry without acquiring its own claim. Retry the claim up to three times, then return 409.
[0.6.1] - 2026-11-13
Changed
- The
rn-forge-commonsrequirement admits 0.9 (>=0.8.0,<0.10). TruncateModelMixin.truncateruns the backend'ssql_flushstatements, andSequenceGeneratorquotes PostgreSQL identifiers with psycopg'ssqlmodule; the SQL issued is equivalent.
[0.6.0] - 2026-10-29
Added
- The
/authsurface overrn-forge-auth, inrn_forge.django.auth.auth_urlpatterns(config, prefix="auth"), configured byAuthRoutesConfig, servesproviders,login/{provider},callback/{provider},session,logout,logout/all,backchannel-logout/{provider}andlogin/passwordoverLoginFlow. Providers, the account resolver and the authorization context provider arern-forge-authobjects passed in the configuration; there is no settings block for them. The development provider exists only underDEBUG. A callback error redirects to the error route with one ofaccess_denied,account_not_provisionedandlogin_failed. - Login transactions, replay records and revoked session IDs in Django's cache:
CacheTransactionStoreandCacheReplayStore, behind the__Host-login-txcookie. Theredisextra namesrn-forge-auth[redis], the client for Django's Redis cache backend. - Sessions on
django.contrib.sessions(dborcached_db).SESSION_SETTINGScarries the__Host-sessioncookie settings.Sessionsapplies a 30-minute sliding idle timeout and a 12-hour absolute timeout (AuthRoutesConfig.idle_timeoutandabsolute_timeout), and deletes a session whose version differs from its account's, whose account is inactive, or whosesession_refis revoked.GET /auth/sessiondoes not extend the session.rotate_sessiongives a session a new ID after a privilege change. - CSRF protection for session routes.
AuthCsrfMiddlewareadds theSec-Fetch-Site: cross-siterejection and theBearerAuthorizationexemption toCsrfViewMiddleware.CSRF_SETTINGSconfigures Angular'sXSRF-TOKENcookie andX-XSRF-TOKENheader, andcsrf_failure_viewanswers the403csrf-failedproblem./auth/sessionalways sets the cookie, and login and logout rotate the token.enforce_csrfruns the same check for DRF views, which arecsrf_exempt. RN_FORGE_DJANGO["AUTH"]["PROBLEM_TYPE_BASE"].auth_urlpatternsraisesImproperlyConfiguredwithout it, socsrf-failedandforbiddendiffer intype, and refuses unsafe session, CSRF and cache settings at startup.- Rate limiting:
FixedWindowLimiterandRateLimit, a fixed-window counter over Django's cache./auth/login/passwordis limited per client and per username, callbacks per client, with limits onAuthRoutesConfig. A limited request is a429too-many-requestsproblem withRetry-After. - Audit events on the
rn_forge.audit.authAppLoggerchannel: login success and failure, logout, account provisioned, rejected and disabled, authorization denied and rate limiting. - Account resolution.
DjangoAccountResolveris anAccountResolverover the Django user model and theExternalAccountlink model, unique on(issuer, subject), with the auth app's first migration, which also addsAccountStatefor the session version. A per-providerProviderPolicysetsexistingorjitprovisioning, an email-domain allowlist and the domains for which a verified email links to an existing user; an optionalsynchook copies attributes at each login, andlinkrecords service accounts.DjangoAccountStateWriterpersists session versions and theactiveflag. - Authorization from Django groups and permissions:
DjangoAuthorizationContextProvider(staff and superuser bypass as roles),connect_authorization_signalsfor cache invalidation,PermissionKeyPermissionandResourcePolicyViewMixin. PrincipalSessionAuthenticationyields asessionprincipal fromSessions.readand enforces CSRF;sessions_for(config)builds itsSessionsfromAuthRoutesConfig. A request with anAuthorizationheader is authenticated by the bearer class alone.
Changed
rn_forge_django_settingsis built on first use, so a settings module can import this package before it definesRN_FORGE_DJANGO.problem_details_exception_handlerrenders withPROBLEM_TYPE_BASEwhen it is set.- Breaking:
PrincipalBearerAuthenticationandJWKSBearerAuthenticationneedaccountsandcontextsclass attributes. They resolve the token's(issuer, subject)throughAccountResolver.lookup(never provisioning) and answer401for an unlinked or inactive account. The principal'ssubjectis the account ID, its roles, tenant and attributes come from the authorization context, and its permissions are the context's limited byscope_map. - Breaking:
DEFAULT_PERMISSION_ACTION_MAPmoved fromrn_forge.django.auth.drf.mixinstorn_forge.auth. - Breaking: depends on
rn-forge-authand importsPrincipal,Requirementand the authenticator contracts from it. Theoidcextra namesrn-forge-auth[oidc]instead ofrn-forge-web[auth]. - Breaking:
JWKSBearerAuthenticationloses itsfetchhook, and itscache_timeoutnow means the key-setlifespanin seconds, default 300 in place of 86400. The newcooldown_duration(default 30 seconds) is the fewest seconds between two key set fetches. - The
oidcandallextras no longer namern-forge-commons[auth], which no longer exists. - Breaking:
AuthorizedAPIViewandAuthorizedModelViewSetcheckPermissionKeyPermissionoverBaseAPIViewandBaseModelViewSet, soUserViewSet,GroupViewSetandPermissionViewSetstill require theirpermission_key. A subclass that relied on the removed mixins' attributes and hooks (credentials,user,is_request_authorized,validate_permissions,validate_object_permissions) must move to aRequirementor aResourcePolicy. The principal now comes fromrequest.user, the staff and superuser bypass comes from the authorization context, and an action map is the view'spermission_action_map. - The package declares the MIT licence and is published to PyPI.
Removed
- Breaking: the locally issued JWT flows are gone, with the
jwtextra anddjangorestframework-simplejwt:rn_forge.django.auth.jwt(JWTAuthentication,JWTCredentials,JWTUtils,LoginExchangeViewMixin,JWTAuthenticationViewMixin,UserTokenView) and theuser-token/route ofrn_forge.django.auth.urls. Authenticate API clients with the OIDC bearer classes inrn_forge.django.auth.drf. - Breaking: the
rn_forge.django.auth.basicandrn_forge.django.auth.samlviews (BasicLoginAPIView,BasicLoginViewMixin,SAMLLoginAPIView,SAMLLoginViewMixin,SampleSAMLLoginAPIView) are gone, along with theRN_FORGE_DJANGO["AUTH"]["SAML"]setting andAuthSAMLSettings. A SAML IdP federates through a broker that speaks OIDC. - Breaking:
BaseCredentialsandLoginPayload(rn_forge.django.auth.credentialsandrn_forge.django.auth.payload),AuthorizationViewMixinandPermissionKeyViewMixin(rn_forge.django.auth.drf.mixins) andAuthorizationPermission(rn_forge.django.auth.drf.permissions) are gone. Check permissions withPermissionKeyPermissionandResourcePolicyViewMixin. - Breaking:
BaseLoginViewMixin,BaseLoginAPIViewandLogoutAPIView(rn_forge.django.auth.drf.authentication) are gone.auth_urlpatternsserves login and logout. - Breaking: the
samlextra is gone, and with it thepython3-samldependency. - Breaking: the
RN_FORGE_DJANGO["DRF"]["VIEWS"]settings block (PERMISSION_ACTION_MAP),DRFViewsSettingsandDRFViewsSettingsDictare gone; setpermission_action_mapon the view.
[0.5.1] - 2026-10-25
Changed
- Requires its rn-forge dependencies by version range from pykit's index (ADR-0004), not by git URL.
[0.5.0] - 2026-10-16
Changed
- Breaking: the
transferextra namesrn-forge-dataand no longer pullsdjango-import-export[xlsx]; it installsdjango-import-exportalone. Thefixturesextra namesrn-forge-data[pandas]in place ofrn-forge-commons[excel,pandas].
Fixed
rn_forge.django.drf.transferimportedopenpyxlwithout declaring it, and worked only because another dependency installed it. Thetransferextra now declares it throughrn-forge-data, and the extra's smoke check imports the module from a clean install.
[0.4.0] - 2026-10-05
Added
- Soft delete in AIP-164's shape.
SoftDeleteModelMixinandSoftDeleteQuerySetinrn_forge.django.modelsadd a nullable, indexeddelete_time,soft_delete(actor=),undelete(actor=),.live()and.deleted(), with an unfiltered default manager.SoftDeleteMixininrn_forge.django.drf.viewsmakesDELETEanswer200with the resource, addsPOST {id}:undeleteandshowDeletedonlist, and answers409toPUTandPATCHon a deleted resource.WireAutoSchemadocuments the three. ReadMaskMixininrn_forge.django.drf:retrieve,listandbatch_getacceptreadMaskand answer200with only the named fields.BaseModelViewSetincludes it, andWireAutoSchemadocuments the parameter on those actions.BatchGetMixin(GET :batchGet?ids=1&ids=2) andBatchUpdateMixin(POST :batchUpdate, one JSON Merge Patch and optionalifMatchper item) inrn_forge.django.drf.transfer.BatchUpdateMixinhasbatch_update_requires_if_match,etag_codecandvalidate_batch_update_item(instance, data).batch_resource_nameis shared withBatchCreateMixin.
Changed
BatchDeleteMixindeletes each row through the view'sperform_destroyin place ofinstance.delete(), so aSoftDeleteMixinviewset soft-deletes in a batch. For any other viewset the behavior is unchanged.- Breaking:
CursorPaginationandOrderByFilteruse everyorderByterm, not the first.ordering_fieldsmay name nullable fields and relation paths,NULLsorts last in both directions, and theorderByOpenAPI description says it takes a comma-separated list. A view's non-primary-key defaultorderingsupplies the terms when the request gives noorderBy. Page tokens issued before the change are rejected with 400. - Breaking:
BaseModelViewSet'sPATCHnow takesapplication/merge-patch+json(RFC 7396) and answersapplication/jsonwith 415 andAccept-Patch.PUTandPOSTstill takeapplication/json.- The merged document is validated as a full update; a top-level
nullsets the field tonull, and read-only or unknown members are ignored. - A versioned instance enforces
If-MatchonPATCH, andretrieveandPATCHanswer with anETag. - New:
MergePatchMixinandMergePatchParser, exported fromrn_forge.django.drf.
- The merged document is validated as a full update; a top-level
- Breaking: the import and batch endpoints word their 422 details as
rn-forge-webdoes, whichrn-forge-fastapialso uses.- A request over
transfer.max_rowson:import,:batchCreateand:batchDeleteis a 422 problem with detailThe import exceeds the limit of N rows.orThe batch exceeds the limit of N rows.and noerrorsmember. It was anerrorsentry with an empty pointer. - A
:importrequest with nofilepart answersThis field is required.at/file, notNo file was submitted.. - A missing
requestsoridsmember answersThis field is required.at/requestsor/ids. An empty list or a non-list still answersA non-empty list is required.. validateOnlyandprefillaccepttrueor1, ignoring case, as before; the unsupported and unreadablefiledetails are unchanged in wording.
- A request over
Removed
- Breaking:
rn_forge.django.utils.RequestUtilsand the DRFRequestUtilsaliases are gone, soRequestUtilsnames only the DRF class.rn_forge.django.utils.RequestUtils.debug_request(request)is nowrn_forge.django.views.debug_request(request).rn_forge.django.drf.DRFUtilsis nowrn_forge.django.drf.RequestUtils.RequestUtils.get_request_param(request, key)is nowRequestUtils.get_param(request, key).RequestUtils.get_request_data(request)is nowRequestUtils.get_data(request).RequestUtils.get_request_value(request, key)is nowRequestUtils.get_value(request, key).
[0.3.0] - 2026-09-27
Released with pykit's first coordinated set of tags (release-1).
rn-forge-django-v0.1.0 to rn-forge-django-v0.2.2 predate this file; their
notes are on the GitHub Releases
page.
Fixed
BatchCreateMixinreports an invalid item's errors under DRF 3.18, which keysListSerializererrors by item index instead of listing them.