GRI-2153: a signed-in user can change their own password #298

Merged
vivy merged 3 commits from fix/GRI-2153-self-service-password-change into dev 2026-11-17 03:52:13 +00:00
Member

Implements PATCH /api/v1/session/password against Astraea's fail-first tests from PR #290 (crates/server/tests/session_password_integration.rs, now merged in as part of this branch's history).

Confirms the contract those tests assumed, with no change: current_password, new_password, new_password_confirmation; 400 wrong_current_password / 400 password_mismatch / 400 weak_password; and the one deliberate departure from the admin reset (GRI-2105) — the session making the change survives it, only every other session on the account ends.

Part of #231 (server side only; the panel screen is still to do, so #231 stays open).

Testing

SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable \
  cargo test --package server --test session_password_integration -- --test-threads=1

-> 6 passed; 0 failed.

Also ran the full server test crate against the same database
(cargo test --package server --tests --no-fail-fast -- --include-ignored):
225/228 lib tests and every integration suite pass; the 3 failures
(pdf::tests::renders_a_real_two_page_pdf_with_default_options and two
pptx_video tests) are pre-existing, unrelated to this change — this host
has no pdftoppm binary installed.

cargo fmt --check and cargo clippy --package server --tests -- -D warnings both clean.
./scripts/local-gates.sh --rust-only passes (that script does not set
SIGNAGE_TEST_DATABASE_URL, so its own cargo test run does not exercise
the new route against a real database — the command above does).

Implements `PATCH /api/v1/session/password` against Astraea's fail-first tests from PR #290 (`crates/server/tests/session_password_integration.rs`, now merged in as part of this branch's history). Confirms the contract those tests assumed, with no change: `current_password`, `new_password`, `new_password_confirmation`; `400 wrong_current_password` / `400 password_mismatch` / `400 weak_password`; and the one deliberate departure from the admin reset (GRI-2105) — the session making the change survives it, only every other session on the account ends. Part of #231 (server side only; the panel screen is still to do, so #231 stays open). ## Testing ``` SIGNAGE_TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable \ cargo test --package server --test session_password_integration -- --test-threads=1 ``` -> 6 passed; 0 failed. Also ran the full `server` test crate against the same database (`cargo test --package server --tests --no-fail-fast -- --include-ignored`): 225/228 lib tests and every integration suite pass; the 3 failures (`pdf::tests::renders_a_real_two_page_pdf_with_default_options` and two `pptx_video` tests) are pre-existing, unrelated to this change — this host has no `pdftoppm` binary installed. `cargo fmt --check` and `cargo clippy --package server --tests -- -D warnings` both clean. `./scripts/local-gates.sh --rust-only` passes (that script does not set `SIGNAGE_TEST_DATABASE_URL`, so its own `cargo test` run does not exercise the new route against a real database — the command above does).
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
GRI-2153: a signed-in user can change their own password
All checks were successful
CI / the pre-push hook (pull_request) Successful in 3s
CI / cargo fmt (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 12s
CI / cargo deny (pull_request) Successful in 12s
CI / cargo deny advisories (pull_request) Successful in 21s
CI / repository boundary (pull_request) Successful in 3s
CI / cargo clippy (pull_request) Successful in 1m2s
CI / frontend-web (pull_request) Successful in 1m1s
CI / cargo test (pull_request) Successful in 3m19s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
63a8139ff7
PATCH /api/v1/session/password takes current_password, new_password
and new_password_confirmation, confirming Astraea's contract on PR
#290. Verifies the current password against a real Argon2id hash,
rejects a mismatched confirmation or a new password under 8
characters, and ends every other session on the account while
leaving the session that made the change signed in.
vivy approved these changes 2026-11-17 03:52:10 +00:00
vivy left a comment

Approved on 63a8139. Contract matches #290; checks run cheap-first; the acting session survives, other sessions end; CI runs the 6 integration tests (SIGNAGE_TEST_DATABASE_URL is set in ci.yml). Minor, not blocking: the password update and the session delete are two statements, not one transaction. I changed "Closes #231" to "Part of #231": there is no panel screen yet, so a user still cannot change their own password.

Approved on 63a8139. Contract matches #290; checks run cheap-first; the acting session survives, other sessions end; CI runs the 6 integration tests (SIGNAGE_TEST_DATABASE_URL is set in ci.yml). Minor, not blocking: the password update and the session delete are two statements, not one transaction. I changed "Closes #231" to "Part of #231": there is no panel screen yet, so a user still cannot change their own password.
vivy merged commit d3fb23d9e2 into dev 2026-11-17 03:52:13 +00:00
vivy deleted branch fix/GRI-2153-self-service-password-change 2026-11-17 03:52:14 +00:00
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!298
No description provided.