@@ -2,6 +2,11 @@
|
||||
|
||||
// Exclusive QA preparation; never prints credentials, MFA secrets, cookies or codes.
|
||||
use App\Models\User;
|
||||
use App\Services\OpportunityManagementInstallation;
|
||||
use App\Services\OpportunityResourceInstallation;
|
||||
use App\Services\PortalProfileAccess;
|
||||
use App\Services\TerritoryGeometryImport;
|
||||
use App\Services\VirtualDeskInstallation;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -34,6 +39,7 @@ function snapshot(array $tables, ?array $baseline = null): array
|
||||
$result[$table]['rows'][$row->id ?? $digest] = $digest;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -53,6 +59,7 @@ if ($mode === 'prepare') {
|
||||
if (isset($actors[$profile])) {
|
||||
$user = User::findOrFail($actors[$profile]['id']);
|
||||
throw_unless($user->email === $actors[$profile]['email'] && str_ends_with($user->email, '@example.invalid'), RuntimeException::class, 'Synthetic actor identity mismatch');
|
||||
|
||||
continue;
|
||||
}
|
||||
$email = 'profiles-v1-'.$profile.'@example.invalid';
|
||||
@@ -90,11 +97,11 @@ if ($mode === 'verify') {
|
||||
$proof = ['target' => $identity, 'previous_rows_preserved_by_id_and_original_columns' => $preserved,
|
||||
'captured_at' => gmdate('c'), 'schema_installed' => Schema::hasTable('portal_role_assignments'),
|
||||
'fingerprints' => [
|
||||
'profiles' => hash('sha256', json_encode(array_map(fn ($path) => hash_file('sha256', $path), \App\Services\PortalProfileAccess::fingerprintFiles()), JSON_THROW_ON_ERROR)),
|
||||
'management' => app(\App\Services\OpportunityManagementInstallation::class)->fingerprint(),
|
||||
'resources' => app(\App\Services\OpportunityResourceInstallation::class)->fingerprint(),
|
||||
'desk_path' => app(\App\Services\VirtualDeskInstallation::class)->fingerprint(),
|
||||
'geometry' => app(\App\Services\TerritoryGeometryImport::class)->fingerprint(),
|
||||
'profiles' => hash('sha256', json_encode(array_map(fn ($path) => hash_file('sha256', $path), PortalProfileAccess::fingerprintFiles()), JSON_THROW_ON_ERROR)),
|
||||
'management' => app(OpportunityManagementInstallation::class)->fingerprint(),
|
||||
'resources' => app(OpportunityResourceInstallation::class)->fingerprint(),
|
||||
'desk_path' => app(VirtualDeskInstallation::class)->fingerprint(),
|
||||
'geometry' => app(TerritoryGeometryImport::class)->fingerprint(),
|
||||
],
|
||||
'active_manifest_preserved' => hash_file('sha256', $root.'/public/build/manifest.json') === $baseline['active_manifest_sha256'],
|
||||
'mfa18_unchanged' => $preserved['users'], 'pair' => Schema::hasTable('portal_superuser_pair') ? DB::table('portal_superuser_pair')->first() : null,
|
||||
|
||||
Reference in New Issue
Block a user