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

vocdoni / saas-backend / 30359653834
63%
main: 62%

Build:
Build:
LAST BUILD BRANCH: fix/trim-member-whitespace
DEFAULT BRANCH: main
Ran 28 Jul 2026 12:42PM UTC
Jobs 1
Files 117
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

28 Jul 2026 12:30PM UTC coverage: 62.931%. First build
30359653834

Pull #608

github

elboletaire
feat(members): make CSP login case-insensitive

Login matched a byte-exact hash of the census auth fields, so a member
stored as "John Doe" could not authenticate by typing "john doe". This was
recorded as a follow-up on the whitespace fix and is now folded into it.

Case folding is deliberately NOT the normalization pattern used for
whitespace, email and birthdate. Member documents keep the casing they were
imported with, because that is what gets displayed and exported. Only the
values that feed the hash are lowercased, on both sides of the comparison:
when a census participant's hash is computed and when the CSP recomputes it
from a login request. So OrgMember.Normalized() is untouched — it governs
what is stored — and the folding lives in HashAuthTwoFaFields, which governs
what is compared. The phone is the exception: it is already a hash, so it is
raw bytes rather than text and folding it would corrupt the value.

migrations.hashMemberFields is a byte-for-byte mirror of that function, kept
so the repair can work straight from bson documents. It gains the identical
folding. If the two ever disagree the repair writes hashes the login path can
never match, so TestRepairMatchesCanonicalHash drives a matrix of field
combinations through the real repair and asserts every hash it wrote equals
the canonical one.

The repair grows a second phase and is renamed accordingly, trimmembers ->
repairlogins: phase A trims member documents as before, phase B recomputes
every census participant's hashes and rewrites the ones that changed, so
censuses published before folding keep working. Phase B works one census at
a time, resolving members with batched $in lookups and grouping the
recomputed hashes in memory rather than issuing a collision query per row.

Any group of two or more rows sharing a recomputed hash is skipped whole,
because the unique index from migration 8 would reject the second write.
That grouping is also what makes rewriting in place safe withou... (continued)
Pull Request #608: fix(members): trim whitespace in CSP login fields

277 of 441 new or added lines in 7 files covered. (62.81%)

10619 of 16874 relevant lines covered (62.93%)

46.42 hits per line

Uncovered Changes

Lines Coverage ∆ File
122
0.0
scripts/repairlogins/main.go
40
85.02
migrations/repair_login_hashes.go
2
74.85
migrations/0015_normalize_member_emails.go
Jobs
ID Job ID Ran Files Coverage
1 30359653834.1 28 Jul 2026 12:42PM UTC 117
62.93
GitHub Action Run
Source Files on build 30359653834
  • Tree
  • List 117
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #608
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