Add VedAstro secret and renderer audit tools

This commit is contained in:
732642856
2026-07-17 00:23:31 +08:00
parent 92e44737dd
commit 13db4aaf7c
4 changed files with 178 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from scripts.configure_vedastro_secret import update_env_text
def test_update_env_text_adds_and_replaces_vedastro_settings():
text = "VEDASTRO_API_ENDPOINT=https://old.example/api\nOTHER=value\n"
updated = update_env_text(
text,
{
"VEDASTRO_API_KEY": "sample-secret",
"VEDASTRO_API_ENDPOINT": "https://api.vedastro.org/api",
"VEDASTRO_ENABLE_NETWORK": "1",
},
)
assert "VEDASTRO_API_ENDPOINT=https://api.vedastro.org/api" in updated
assert "VEDASTRO_API_KEY=sample-secret" in updated
assert "VEDASTRO_ENABLE_NETWORK=1" in updated
assert "OTHER=value" in updated
assert "https://old.example/api" not in updated
@@ -0,0 +1,9 @@
from scripts.report_renderer_isolation_poc import run_poc
def test_report_renderer_isolation_poc_never_claims_pass_without_browser() -> None:
result = run_poc()
assert result["status"] in {"pass", "fail", "blocked"}
if result["status"] == "pass":
assert result["http_probe_requests"] == 0
assert result["blocked_resource_count"] >= 2