GRI-1856: fix setup/session tests to use the real email field #98
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!98
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-1856-setup-session-email-field"
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?
Summary
Fixes two bugs in
crates/server/tests/setup_session_integration.rs, merged in #96. Both are test bugs, not implementation bugs.SetupRequest/LoginRequest(crates/server/src/auth/handlers.rs) have nousernamefield — the real login identifier isemail, andvalidate_emailalready rejects empty and malformed values. The oldsetup_body()/login_body()helpers sent"username": ..., which serde silently drops as an unrecognized field (nodeny_unknown_fields), while always hard-coding a valid"email": "setup-test@example.test"underneath.Two consequences, both fixed here:
ac_1_02_setup_with_empty_username_is_rejected_and_creates_no_userwas asserting on a field that does nothing, so it exercised the already-correctemailvalidation path regardless — it was marked#[ignore]in #96 with a false "validation gap" finding. Un-ignored; it now asserts on the realemailfield and passes againstdevunmodified.ac_1_06_login_for_unknown_username_is_rejected_the_same_way_as_wrong_passwordused the identical hard-coded real email for both its "wrong password" and "unknown user" cases, so it could never have caught a real username-enumeration leak. Fixed to use a genuinely distinct, never-registered email for the "unknown user" case.Every other test in the file gets the same real-
emailtreatment for consistency, with no behavioral change to those (they always happened to use the one real hard-coded email already).Test plan
./scripts/local-gates.sh— every gate passed.