Spaces:
Running
Running
audit view: hide the kernel record hashes (q, h, kprev) as well, so hidden arguments cannot be tested by guessing
Browse files
server.py
CHANGED
|
@@ -132,6 +132,8 @@ class H(SimpleHTTPRequestHandler):
|
|
| 132 |
o = json.loads(ln) if isinstance(ln, str) else dict(ln)
|
| 133 |
o["args"] = "[hidden during the hackathon]"; o["args_hidden"] = True
|
| 134 |
o["chain"] = o["prev"] = "[hidden]" # a hash over the record would let anyone test guesses of the hidden arguments
|
|
|
|
|
|
|
| 135 |
out.append(json.dumps(o, ensure_ascii=False) if isinstance(ln, str) else o)
|
| 136 |
except Exception: # noqa: BLE001
|
| 137 |
continue # a record that cannot be parsed is not passed on
|
|
|
|
| 132 |
o = json.loads(ln) if isinstance(ln, str) else dict(ln)
|
| 133 |
o["args"] = "[hidden during the hackathon]"; o["args_hidden"] = True
|
| 134 |
o["chain"] = o["prev"] = "[hidden]" # a hash over the record would let anyone test guesses of the hidden arguments
|
| 135 |
+
if isinstance(o.get("kernel"), dict): # 2026-11-20: the kernel's own record carries the same kind of hashes (q is fixed per argument)
|
| 136 |
+
o["kernel"] = {k: ("[hidden]" if k in ("q", "h", "kprev", "body") else v) for k, v in o["kernel"].items()}
|
| 137 |
out.append(json.dumps(o, ensure_ascii=False) if isinstance(ln, str) else o)
|
| 138 |
except Exception: # noqa: BLE001
|
| 139 |
continue # a record that cannot be parsed is not passed on
|