feat(enclave): banned-list UI with per-user unban (LC-340) #356

Merged
nrupard merged 1 commit from feat/lc-340-enclave-banlist into main 2026-06-18 20:17:04 +02:00
Owner

What

Adds a manager-gated "Banned users" section to enclave settings so an enclave's bans (written by LC-339 Coyote Mode, and any future manual enclave ban) are visible and reversible. Before this, lifting a ban meant a hand DB edit, so a Coyote false positive was effectively permanent.

  • New section lists each banned user (resolved display label + reason + banned-at) with an Unban button; empty-state when none.
  • db::enclave::list_enclave_bans + unban_from_enclave; POST /enclave/{id}/bans/{user_id}/unban (require_manage, redirects to settings).
  • en/es i18n keys (enclave-settings-bans-*).

Unbanning removes the enclave_bans row. Because the ban had also removed membership, the user rejoins (invite code / discover) to regain access, then can post again.

Test

  • db_coyote_mode.rs: list_and_unban_round_trip (list newest-first with reason; unban removes one, leaves the other; no-op on a non-banned user).
  • routes_coyote_mode.rs: member_cannot_unban (non-manager 403, ban unchanged); manager_unban_then_member_can_rejoin_and_post (banned -> rejoin 403; manager unban -> SEE_OTHER + is_enclave_banned false; member rejoins then posts 204).
  • just check (clippy std+saas+desktop, fmt), just test, just test-saas all pass. en/es parity holds. No new migration (reuses LC-339's enclave_bans).

Closes LC-340.

## What Adds a manager-gated "Banned users" section to enclave settings so an enclave's bans (written by LC-339 Coyote Mode, and any future manual enclave ban) are visible and reversible. Before this, lifting a ban meant a hand DB edit, so a Coyote false positive was effectively permanent. - New section lists each banned user (resolved display label + reason + banned-at) with an **Unban** button; empty-state when none. - `db::enclave::list_enclave_bans` + `unban_from_enclave`; `POST /enclave/{id}/bans/{user_id}/unban` (`require_manage`, redirects to settings). - en/es i18n keys (`enclave-settings-bans-*`). Unbanning removes the `enclave_bans` row. Because the ban had also removed membership, the user rejoins (invite code / discover) to regain access, then can post again. ## Test - `db_coyote_mode.rs`: `list_and_unban_round_trip` (list newest-first with reason; unban removes one, leaves the other; no-op on a non-banned user). - `routes_coyote_mode.rs`: `member_cannot_unban` (non-manager 403, ban unchanged); `manager_unban_then_member_can_rejoin_and_post` (banned -> rejoin 403; manager unban -> SEE_OTHER + is_enclave_banned false; member rejoins then posts 204). - `just check` (clippy std+saas+desktop, fmt), `just test`, `just test-saas` all pass. en/es parity holds. No new migration (reuses LC-339's `enclave_bans`). Closes LC-340.
feat(enclave): banned-list UI with per-user unban
All checks were successful
check-secrets / Kingfisher (push) Successful in 5s
check-secrets / Nosey parker (push) Successful in 3s
check-secrets / TruffleHog (push) Successful in 3s
check-secrets / Nosey parker (pull_request) Successful in 4s
check-secrets / TruffleHog (pull_request) Successful in 5s
Check / clippy + fmt + tests (pull_request) Successful in 2m16s
Create release / Create release from merged PR (pull_request) Has been skipped
check-secrets / Kingfisher (pull_request) Successful in 6s
c2f510d6b1
LC-339 added the enclave_bans ban-list (written by Coyote Mode) and enforced it on join/post, but there was no UI to view or lift a ban - an operator had to edit the DB, so a Coyote false positive was effectively permanent.

Adds a manager-gated "Banned users" section to enclave settings listing each banned user (resolved label + reason + banned-at) with an Unban button, backed by db::enclave::list_enclave_bans + unban_from_enclave and POST /enclave/{id}/bans/{user_id}/unban. Unbanning removes the row; the user can then rejoin (invite code / discover) and post again (the ban had also removed membership, so a rejoin is required to regain access).

#LC-340

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/lc-340-enclave-banlist 2026-06-18 20:17:04 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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
psa-systems/lets-chat!356
No description provided.