MCPcopy Index your code
hub / github.com/openai/plugins / require_scan_relative_file

Function require_scan_relative_file

plugins/codex-security/scripts/workbench_db.py:2777–2787  ·  view source on GitHub ↗
(scan: sqlite3.Row, value: str)

Source from the content-addressed store, hash-verified

2775
2776
2777def require_scan_relative_file(scan: sqlite3.Row, value: str) -> str:
2778 normalized = optional_text(value, maximum=4096)
2779 if normalized is None or "\\" in normalized:
2780 raise SystemExit("Patch path must identify a scan-local regular file.")
2781 parsed = PurePosixPath(normalized)
2782 if parsed.is_absolute() or ".." in parsed.parts:
2783 raise SystemExit("Patch path must identify a scan-local regular file.")
2784 path = artifact_path(Path(scan["scan_dir"]), parsed.as_posix(), required=True)
2785 if path is None:
2786 raise SystemExit("Patch path must identify a scan-local regular file.")
2787 return parsed.as_posix()
2788
2789
2790def require_matching_patch_digest(scan: sqlite3.Row, patch_path: str, patch_digest: str) -> None:

Callers 1

set_finding_remediationFunction · 0.85

Calls 2

optional_textFunction · 0.90
artifact_pathFunction · 0.85

Tested by

no test coverage detected