You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tests): repair CI failures from legacy auth rebuild + cache authorized ids
Move query_registrations import from dojo.authorization.__init__ to
apps.py ready() so the per-app auth-filter registry is guaranteed
populated by the time any code path imports dojo.authorization.query_filters.
The eager package-init import was raising mid-app-load circular ImportErrors
that the try/except in each queries.py silently swallowed, leaving callers
with the stub get_auth_filter that returns None — every per-model auth
filter was bypassed and querysets returned unfiltered results.
Cache the authorized product / product-type id sets per request and use
set membership in _user_authorized_for instead of repeated
authorized_users.filter(pk=user.pk).exists() probes; Alert dispatch skips
the user_id FK existence check in clean_fields since the user instance
was just fetched from the DB.
Unit-test alignments under legacy auth: UserProfileSerializer no longer
returns RBAC carriers, UsersTest.deleted_objects is 12 not 13, and the
ZAP-import query baselines drop to 1378/1256 (one EXISTS-per-recipient
per dispatch goes away, net -7 against pre-Track-B).
Integration tests: rewrite product_member / product_type_member flows
for the authorized_users add/revoke UI (no per-member role), and delete
group_test / product_group_test / product_type_group_test outright —
groups don't exist under legacy auth.
0 commit comments