30 lines
1.7 KiB
Python
30 lines
1.7 KiB
Python
from pathlib import Path
|
|
from datetime import datetime, timezone
|
|
import subprocess, json
|
|
|
|
OUT = Path(__file__).resolve().parent
|
|
BASE = 'https://portal-investidor.test:18445'
|
|
probes = []
|
|
for path in ['/aceitacao-B-396c691930bc.html', '/_qa/runtime']:
|
|
runtime = path == '/_qa/runtime'
|
|
proc = subprocess.run(['C:/Windows/System32/curl.exe', '--silent', '--show-error', '--max-time', '10',
|
|
*( [] if runtime else ['--output', 'NUL', '--write-out', '%{http_code}']),
|
|
BASE + path], capture_output=True, timeout=15)
|
|
stdout = proc.stdout.decode('utf-8', errors='replace')
|
|
stderr = proc.stderr.decode('cp1252', errors='replace')
|
|
item = {'url':BASE+path,'curl_exit_code':proc.returncode,'certificate_validation_disabled':False,'authentication_used':False}
|
|
if proc.returncode:
|
|
item['error'] = stderr.splitlines()[0] if stderr else 'curl failed without text'
|
|
elif runtime:
|
|
data = json.loads(stdout)
|
|
item['target'] = {k:data.get('target',{}).get(k) for k in ['database','port']}
|
|
item['expected_isolated_QA'] = item['target']['database']=='stability_consumers_20261011_084534_test' and int(item['target']['port'])==55441
|
|
else:
|
|
item['http_status'] = stdout.strip()
|
|
probes.append(item)
|
|
if proc.returncode:break
|
|
report = {'at':datetime.now(timezone.utc).isoformat(),'operation':'GET read-only; OS TLS verification enabled; not a browser demonstration',
|
|
'tls':probes,'QA_data_writes':0,'active_requests':0,'cookies_or_auth_material_recorded':False}
|
|
(OUT/'grouped-passage-HTTPS-readonly-20261014.json').write_text(json.dumps(report,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
|
|
print(json.dumps(report,ensure_ascii=False))
|