sync: auto-sync from HOWARD-HOME at 2026-07-07 11:45:40
Author: Howard Enos Machine: HOWARD-HOME Timestamp: 2026-07-07 11:45:40
This commit is contained in:
@@ -267,7 +267,7 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
sp.add_argument("method", help="GET/POST/PUT/DELETE")
|
||||
sp.add_argument("path", help="e.g. Agents or Agents/scan")
|
||||
sp.add_argument("--filter", help="LoopBack filter JSON (GET)")
|
||||
sp.add_argument("--data", help="request body JSON")
|
||||
sp.add_argument("--data", help="request body JSON, or @path to read JSON from a file")
|
||||
sp.add_argument("--confirm", action="store_true",
|
||||
help="required for non-GET methods")
|
||||
return p
|
||||
@@ -408,7 +408,13 @@ def main(argv=None) -> int:
|
||||
print(f"[BLOCKED] {method} requires --confirm.", file=sys.stderr)
|
||||
return 2
|
||||
filt = json.loads(args.filter) if args.filter else None
|
||||
body = json.loads(args.data) if args.data else None
|
||||
if args.data and args.data.startswith("@"):
|
||||
with open(args.data[1:], "r", encoding="utf-8") as _f:
|
||||
body = json.load(_f)
|
||||
elif args.data:
|
||||
body = json.loads(args.data)
|
||||
else:
|
||||
body = None
|
||||
# Same tenant-wide footgun guard the scan command has: a POST to any
|
||||
# */scan endpoint with no non-empty `where` scans the ENTIRE tenant.
|
||||
if method == "POST" and args.path.rstrip("/").lower().endswith("scan"):
|
||||
|
||||
Reference in New Issue
Block a user