test(coverage): root-contents + email-verify + HMAC gap tests, no-tracking fix, ratchet 73->78 #46
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!46
Loading…
Reference in a new issue
No description provided.
Delete branch "test/coverage-gaps-27"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #44 (found by these tests). Advances #27: coverage floor ratcheted 73 -> 78; measured 78.7% Debug / 79.6% Release on 726 tests (was 74.7/75.7 on 700).
New coverage for three previously-zero surfaces:
GET /api/folders/root/contents(5 tests): auto personal-tenant provisioning, root reuse across calls, ownership filtering vs other tenants/users, share-based inclusion with revoked/expired exclusion, tenant isolation. Co-tenant membership is seeded manually — the fixture always mints a fresh tenant per user.POST /api/auth/email/register/verify(9 tests): field validation, wrong OTP, valid OTP + unknown/expired invitation, happy path (user + tenant membership + Email login + TOTP flag), existing-account auto-link (no duplicate user), single-use OTP./api/ext/*middleware (12 tests): missing headers, malformed service-id/timestamps, stale/future timestamps, unknown/disabled service, bad signature, wrong-path signature, acceptance (LastUsedAt stamped — no /api/ext endpoints exist yet, accepted requests 404 downstream), replay rejection.Real bug caught (#44): the tenant-less provisioning test went red — the endpoint mutated
accessor.User, whichSsdidAuthMiddlewareloadsAsNoTracking(), sousers.tenant_idnever persisted and every call minted a duplicate personal tenant. Fixed by resolving a tracked user in the handler.Remaining gap to the #27 80% exit: OIDC verify/callback (~280 lines, needs a fake-IdP harness).