{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "cd \/var\/www\/tools\/ki-protokoll\/claude-hook && python3 -c \"\nfrom quality import pre_rules_htmx\n\n# Test hx-put ohne CSRF\ntest_path = '\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/test\/index.php'\ntest_content = '''<form hx-put=\\\"\/api\/test\\\" hx-target=\\\"#x\\\">Test<\/form>'''\nresult = pre_rules_htmx.htmx_c5_csrf_on_put(test_path, test_content)\nprint(f'hx-put ohne CSRF: {\\\"BLOCK\\\" if result else \\\"PASS\\\"}')\nif result:\n print(f' {result.get(\\\"message\\\", \\\"\\\")}')\n\n# Test hx-put mit CSRF\ntest_content2 = '''<form hx-put=\\\"\/api\/test\\\" hx-headers='{\\\"X-CSRF-TOKEN\\\": \\\"x\\\"}'>Test<\/form>'''\nresult2 = pre_rules_htmx.htmx_c5_csrf_on_put(test_path, test_content2)\nprint(f'hx-put mit CSRF: {\\\"BLOCK\\\" if result2 else \\\"PASS\\\"}')\n\"",
"description": "Test hx-put CSRF rule"
}
}
{
"tool_response": {
"stdout": "hx-put ohne CSRF: BLOCK\n QUALITY VIOLATION [HTMX-C5]: hx-put at line 1 missing CSRF token. Add: hx-headers='{\"X-CSRF-TOKEN\": \"<?= $csrfToken ?>\"}'\nhx-put mit CSRF: PASS",
"stderr": "",
"interrupted": false,
"isImage": false
}
}