Hosting dev-access: resolve via central identity API (shadow mode)
Deploy Ladill Hosting / deploy (push) Successful in 23s

Consolidate the inline HostingAccountMember lookups (Overview/Search/Hosting
Product/Afia controllers) into HostingAccessResolver, which can source hosting
developer-access from the monolith's central /identity/hosting/developer-access
(correlating cPanel usernames to local account ids). Shadow mode by default
(HOSTING_CENTRAL_DEV_ACCESS=false): local hosting_account_members stays
authoritative and divergence from central is logged; flip the flag to cut over.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
isaacclad
2026-06-18 23:42:08 +00:00
co-authored by Claude Opus 4.8
parent 174ead7d3e
commit 107013bd04
7 changed files with 126 additions and 16 deletions
@@ -5,8 +5,8 @@ namespace App\Http\Controllers\Hosting;
use App\Http\Controllers\Controller;
use App\Models\CustomerHostingOrder;
use App\Models\HostingAccount;
use App\Models\HostingAccountMember;
use App\Models\HostingProduct;
use App\Services\Hosting\HostingAccessResolver;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
@@ -49,9 +49,7 @@ class SearchController extends Controller
HostingProduct::TYPE_WORDPRESS,
];
$sharedAccountIds = HostingAccountMember::query()
->where('user_id', $user->id)
->pluck('hosting_account_id');
$sharedAccountIds = app(HostingAccessResolver::class)->sharedAccountIds($user);
HostingAccount::query()
->where(function ($query) use ($user, $sharedAccountIds) {