• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 40477312109
59%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 27 Oct 2026 09:02AM UTC
Jobs 10
Files 933
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Oct 2026 08:58AM UTC coverage: 83.641% (+0.08%) from 83.56%
40477312109

push

github

web-flow
fix(mfa): use allauth Authenticator as the only source of MFA state DEV-3109 (#7742)

### 📣 Summary
Two-factor authentication is now enforced consistently, whichever screen
or API was used to turn it on or off.

### 📖 Description
KPI decided whether a user has 2FA from its own `MfaMethodsWrapper`
table, a leftover from the django-trench → allauth migration, instead of
allauth's `Authenticator` table. Only KPI's `/api/v2/auth/app/...`
endpoints updated both tables. The allauth headless endpoints (public
since 2.026.21, and used by the auth redesign) update only
`Authenticator`, so the two drift apart:

- 2FA turned on through allauth was **not asked for at login**, and
password-only (Basic) API access still worked
- 2FA turned off through allauth kept the user blocked, and
re-authentication crashed (500)
- superusers could turn 2FA off through allauth despite
`SUPERUSER_AUTH_ENFORCEMENT`

The wrapper only duplicates data allauth already has (same secret;
"active" = a TOTP row exists), so every check now reads `Authenticator`
and the wrapper is no longer read or written.

### 👷 Description for instance maintainers
- `user_reports` migration `0010` drops the user reports materialized
view, and LRM `0019` rebuilds it in the background (now reading
`mfa_authenticator`). `/api/v2/user-reports/` is unavailable until the
rebuild finishes.
- New LRM `0033` re-syncs `UserProfile.is_mfa_active` (used by KoboCAT)
from `Authenticator`, once.

### 💭 Notes
- `MfaMethodsWrapper` and its table are kept but unused, so rollback is
safe. A follow-up PR will drop them.
- `UserProfile.is_mfa_active` is now synced by `post_save`/`post_delete`
signals on `Authenticator`, so it follows every path (old endpoints,
headless, admin).
- The headless `DELETE .../authenticators/totp` is overridden (same
pattern as headless login) to enforce the superuser rule; allauth only
checks `can_delete_authenticator()` in its template form.
- Admin: "MFA Registrations" is replaced by an `Authe... (continued)

10750 of 14064 branches covered (76.44%)

74 of 161 new or added lines in 20 files covered. (45.96%)

5 existing lines in 5 files now uncovered.

34200 of 40889 relevant lines covered (83.64%)

5.51 hits per line

Uncovered Changes

Lines Coverage ∆ File
15
53.13
kobo/apps/accounts/mfa/utils.py
13
34.21
6.3% kobo/apps/accounts/mfa/flows.py
11
0.0
0.0% kobo/apps/accounts/mfa/adapter.py
9
35.09
3.17% kobo/apps/accounts/mfa/serializers.py
8
44.12
2.01% kobo/apps/accounts/mfa/admin.py
8
60.0
kobo/apps/accounts/mfa/signals.py
8
53.19
1.58% kobo/apps/accounts/mfa/views.py
6
0.0
kobo/apps/long_running_migrations/jobs/0033_sync_mfa_profiles_from_authenticators.py
5
62.07
-0.79% kobo/apps/accounts/views.py
2
31.67
0.52% kobo/apps/accounts/reauthentication.py
2
0.0
0.0% kobo/apps/long_running_migrations/jobs/0022_sync_mfa_profiles.py

Coverage Regressions

Lines Coverage ∆ File
1
0.0
0.0% kobo/apps/accounts/mfa/adapter.py
1
35.09
3.17% kobo/apps/accounts/mfa/serializers.py
1
53.19
1.58% kobo/apps/accounts/mfa/views.py
1
31.67
0.52% kobo/apps/accounts/reauthentication.py
1
0.0
0.0% kobo/apps/long_running_migrations/jobs/0022_sync_mfa_profiles.py
Jobs
ID Job ID Ran Files Coverage
1 40477312109.1 27 Oct 2026 09:02AM UTC 928
43.53
2 40477312109.2 27 Oct 2026 09:03AM UTC 928
49.3
3 40477312109.3 27 Oct 2026 09:04AM UTC 928
52.91
4 40477312109.4 27 Oct 2026 09:07AM UTC 928
58.35
5 40477312109.5 27 Oct 2026 09:07AM UTC 930
59.41
6 40477312109.6 27 Oct 2026 09:40AM UTC 933
71.17
7 40477312109.7 27 Oct 2026 09:44AM UTC 930
44.8
8 40477312109.8 27 Oct 2026 09:50AM UTC 931
68.76
9 40477312109.9 27 Oct 2026 09:51AM UTC 930
50.53
10 40477312109.10 27 Oct 2026 09:52AM UTC 930
54.13
Source Files on build 40477312109
  • Tree
  • List 933
  • Changed 15
  • Source Changed 0
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • a679733e on github
  • Prev Build on main (#40473186165)
  • Next Build on main (#40485431657)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc