GRI-2153: fail-first tests for self-service password change #290

Closed
astraea wants to merge 0 commits from test/GRI-2153-self-service-password-change into dev
Member

Fail-first tests for the self-service password change in #231.

No specification exists past the issue's own text — "current password, new
password twice" — so the exact wire contract is a decision this PR makes
explicit rather than invents silently. It assumes:

  • PATCH /api/v1/session/password, body current_password, new_password,
    new_password_confirmation — the same self-service shape as
    PATCH /session/locale (GRI-2142).
  • 400 wrong_current_password for a wrong current password.
  • 400 password_mismatch for a mismatched confirmation.
  • 400 weak_password under 8 characters — the same policy POST /setup,
    POST /users and the admin's PATCH /users/{id} already enforce.
  • 401 with no session cookie.
  • Ends every other session of the account, but not the one that made
    the change — unlike the admin reset (GRI-2105/#226), which ends every
    session of the target, because here the actor and the target are the
    same account and ending its own current session would log the user out of
    the very request that just succeeded.

The session-survival behaviour is the one place this departs from the admin
reset's convention on purpose, and is the one point most worth a second look
before building against it.

Every test fails against dev right now (404, no such route) — see the
GRI-2153 board comment for the full output.

Test plan

  • cargo test --package server --test session_password_integration —
    all 6 fail against unimplemented dev
  • cargo fmt --check -p server
  • cargo clippy -p server --tests
Fail-first tests for the self-service password change in #231. No specification exists past the issue's own text — "current password, new password twice" — so the exact wire contract is a decision this PR makes explicit rather than invents silently. It assumes: - `PATCH /api/v1/session/password`, body `current_password`, `new_password`, `new_password_confirmation` — the same self-service shape as `PATCH /session/locale` (GRI-2142). - `400 wrong_current_password` for a wrong current password. - `400 password_mismatch` for a mismatched confirmation. - `400 weak_password` under 8 characters — the same policy `POST /setup`, `POST /users` and the admin's `PATCH /users/{id}` already enforce. - `401` with no session cookie. - Ends every *other* session of the account, but **not** the one that made the change — unlike the admin reset (GRI-2105/#226), which ends every session of the *target*, because here the actor and the target are the same account and ending its own current session would log the user out of the very request that just succeeded. The session-survival behaviour is the one place this departs from the admin reset's convention on purpose, and is the one point most worth a second look before building against it. Every test fails against `dev` right now (`404`, no such route) — see the GRI-2153 board comment for the full output. ## Test plan - [x] `cargo test --package server --test session_password_integration` — all 6 fail against unimplemented `dev` - [x] `cargo fmt --check -p server` - [x] `cargo clippy -p server --tests`
GRI-2153: add fail-first tests for self-service password change
Some checks failed
CI / cargo fmt (pull_request) Successful in 5s
CI / the pre-push hook (pull_request) Successful in 7s
CI / install.sh client upgrade (pull_request) Successful in 14s
CI / cargo deny (pull_request) Successful in 15s
CI / cargo deny advisories (pull_request) Successful in 21s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo clippy (pull_request) Successful in 1m10s
CI / frontend-web (pull_request) Successful in 1m3s
CI / cargo test (pull_request) Failing after 3m5s
CI / Notify gate failed (pull_request) Successful in 1s
CI / CI (pull_request) Failing after 1s
5e94a0a27c
Owner

Superseded: these tests landed in dev with #298, which carries this branch in its history. Closing.

Superseded: these tests landed in dev with #298, which carries this branch in its history. Closing.
vivy closed this pull request 2026-11-17 03:52:20 +00:00
Some checks failed
CI / cargo fmt (pull_request) Successful in 5s
Required
Details
CI / the pre-push hook (pull_request) Successful in 7s
CI / install.sh client upgrade (pull_request) Successful in 14s
CI / cargo deny (pull_request) Successful in 15s
Required
Details
CI / cargo deny advisories (pull_request) Successful in 21s
Required
Details
CI / repository boundary (pull_request) Successful in 5s
Required
Details
CI / cargo clippy (pull_request) Successful in 1m10s
Required
Details
CI / frontend-web (pull_request) Successful in 1m3s
Required
Details
CI / cargo test (pull_request) Failing after 3m5s
Required
Details
CI / Notify gate failed (pull_request) Successful in 1s
CI / CI (pull_request) Failing after 1s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!290
No description provided.