CluPilotCloud/app/Http/Middleware
nexxo 9ccd4f59d8
tests / pest (push) Successful in 6m53s Details
tests / assets (push) Successful in 18s Details
tests / release (push) Successful in 3s Details
feat(security): the console decides who may reach it, and the owner keeps the list
RestrictAdminHost answers under which NAME the console responds — and the
caller picks the Host header, so it can never answer who is asking. This does:
a network gate on the client address, which behind a trusted proxy is not
something the client chooses.

The management VPN is always in the list and cannot be removed — it is the one
way in that survives a bad entry. Beyond that the owner keeps their own
addresses in the console, because being away from the VPN should not mean being
locked out, and the person who needs to change that list is the person sitting
in front of it.

Two refusals rather than warnings, since by the time a warning renders the
request that would show it has already been rejected: switching the restriction
ON is refused unless the address doing the switching is already covered, and
removing the entry you are sitting behind is refused. Entries are validated as
an address or CIDR — a typo that matches nothing is how someone locks
themselves out while believing they have not.

404, never 403.

Registered as persistent Livewire middleware, and verified in a browser that it
holds there: with the settings page open, narrowing the list turned the next
action from 200 into 404. Codex read the path guard as skipping
/livewire/update; Livewire in fact replays middleware against a duplicate of
the request carrying the original component's path, so the guard matches and
the client address is preserved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 20:27:26 +02:00
..
EnsureAdmin.php fix(admin): remove is_admin self-heal — RBAC is the only console boundary (no revocation bypass) 2026-07-25 18:35:14 +02:00
EnsureCustomerActive.php feat(admin): staff RBAC (spatie) + admin settings page 2026-07-25 15:47:42 +02:00
PublicSiteGate.php docs: hiding the site also hides the login page, and that has a consequence 2026-07-26 19:27:51 +02:00
RestrictAdminHost.php fix(security): match ADMIN_HOSTS case-insensitively; share test helpers 2026-07-25 20:56:26 +02:00
RestrictConsoleNetwork.php feat(security): the console decides who may reach it, and the owner keeps the list 2026-07-26 20:27:26 +02:00