19 lines
2.7 KiB
PHP
19 lines
2.7 KiB
PHP
<?php
|
|
ini_set('zend.exception_ignore_args','1');putenv('STABILITY_QA_MODE=consumers');
|
|
$credentialRoot=dirname(__DIR__,2);$credentialQA=$credentialRoot.'/storage/app/private/investmoz-v2/portal-audit/portal-stability-source-20261011_083742';$app=require $credentialQA.'/tools/portal-stability-runtime.php';$db=Illuminate\Support\Facades\DB::connection();
|
|
$t=(array)$db->selectOne('SELECT current_database() AS database,inet_server_port() AS port');if($t!==['database'=>'stability_consumers_20261011_084534_test','port'=>55441])throw new RuntimeException('QA isolation required');
|
|
$db->beginTransaction();$db->statement('SET TRANSACTION READ ONLY');
|
|
try{
|
|
$private=$credentialRoot.'/storage/app/private/investmoz-v2/portal-audit';$a=json_decode(file_get_contents($private.'/profiles-v1-actors-private.json'),true,512,JSON_THROW_ON_ERROR)['promoter'];$u=App\Models\User::findOrFail(21);
|
|
if($a['id']!==21||strtolower($u->email)!==strtolower($a['email'])||!Illuminate\Support\Facades\Hash::check($a['password'],$u->password))throw new RuntimeException('Current QA21 password mismatch');
|
|
$web=json_decode(file_get_contents(__DIR__.'/qa21-password-login-diagnosis-20261013.json'),true,512,JSON_THROW_ON_ERROR);if(!$web['password_accepted_by_web']||!$web['MFA_challenge_reached'])throw new RuntimeException('Web password acceptance evidence required');
|
|
$file=$private.'/qa21-password-18445-local.txt';if(is_file($file)&&!hash_equals(file_get_contents($file),$a['password']))throw new RuntimeException('Preserve divergent private access file');
|
|
if(!is_file($file)){file_put_contents($file,$a['password'],LOCK_EX);chmod($file,0600);}
|
|
if(!hash_equals(file_get_contents($file),$a['password']))throw new RuntimeException('Private password readback mismatch');
|
|
$receipt=['at'=>gmdate('c'),'target'=>$t,'QA_user_id'=>21,'email'=>$u->email,'local_file'=>'storage/app/private/investmoz-v2/portal-audit/qa21-password-18445-local.txt',
|
|
'current_existing_password_displayed_locally_only'=>true,'password_database_changed'=>false,'MFA_changed'=>false,'active_changes'=>0,'QA_business_data_changes'=>0,'private_file_outside_web_root'=>true,
|
|
'password_not_in_receipt_or_conversation'=>true,'API_password_accepted_until_MFA'=>true,'visual_login_confirmation_pending'=>true,
|
|
'diagnostic_pending_session_authenticated'=>false,'logout_cleanup_status'=>401,'pending_session_invalidation_confirmed'=>false,'API_client_cookie_jar_discarded'=>true,'other_user_sessions_unchanged'=>true];
|
|
file_put_contents(__DIR__.'/qa21-current-password-local-prepared-20261013.json',json_encode($receipt,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_THROW_ON_ERROR));echo json_encode($receipt,JSON_UNESCAPED_UNICODE).PHP_EOL;
|
|
}finally{$db->rollBack();}
|