CluPilotCloud/tests/Feature/Admin
nexxo 54fb6deb03 Make the RBAC move retry-safe and order-safe, and round-trip permissions
Three faults in the same migration:

- up()'s removal loop was driven by operatorUserIds() (model_has_roles
  WHERE model_type=User) via the $carried array — but carryAcross()
  repoints model_has_roles to Operator for every operator before a
  single users row is deleted. A run that stops partway (the
  customer-conflict abort, or a dropped connection on real MariaDB,
  which this file deliberately runs without a transaction) leaves that
  worklist empty on the next attempt, so `migrate` records the
  migration as applied while every leftover users row still grants a
  live portal login on the operator's own password. Now driven by
  `operators` joined to `users` on email: that finds every
  carried-but-not-yet-deleted row regardless of which run carried it.

- operatorUserIds() had no ORDER BY. carryAcross() remaps four owned
  columns in place, keyed on the old users.id, while operators.id hands
  out new values in the same order the list is walked — unordered, a
  later operator's freshly assigned id can equal an earlier operator's
  still-unprocessed users.id, and the second remap catches a row the
  first one already rewrote. One operator ends up silently owning
  another operator's VPN peer. Added ->orderBy('model_id').

- down() restored model_has_roles but not model_has_permissions, so an
  operator holding a direct (not role-granted) permission lost it on
  rollback. Mirrored the same move carryAcross() does forward.

Also removes seed_roles_and_permissions' now-stale
User::OPERATOR_ROLES/hasAnyRole()/assignRole() bootstrap loop — all
three gone from User per this branch's own work — which only a deep
rollback (down() of the move migration recreates is_admin users) would
ever have reached, but would fatal when it did.
2026-07-28 13:31:34 +02:00
..
AdminConsoleTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
AdminHostRestrictionTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
AdminSettingsTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
ConsoleHostSeparationTest.php Stop the console serving the portal's sign-in page 2026-07-28 11:45:34 +02:00
ConsoleNetworkTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
ConsoleReportsRealDataTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
CustomerRevenueTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
DatacenterTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
HostManagementTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
InstanceAdminAccessTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
MaintenanceTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
OperatorModelTest.php Give the people who run CluPilot a table of their own 2026-07-28 09:20:54 +02:00
OperatorTwoFactorPolicyTest.php Let the owner make two-factor compulsory, without locking themselves out 2026-07-28 12:08:08 +02:00
PasswordConfirmationGuardTest.php Prove ConfirmsPassword resolves its guard, not the ambient default 2026-07-28 11:54:13 +02:00
PlanAdminTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
ProvisioningActionsTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
RbacMoveTest.php Make the RBAC move retry-safe and order-safe, and round-trip permissions 2026-07-28 13:31:34 +02:00
RbacTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
SecretCipherTest.php Make isUsable() apply the same 32-byte rule encrypter() does 2026-07-28 05:09:09 +02:00
SecretVaultTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
SecretsPageTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
UpdateButtonTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
VpnTest.php Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00