@miller-tech/uap 1.148.0 → 1.148.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -41,8 +41,6 @@ PROTECTED_MARKERS = (
|
|
|
41
41
|
"uap-reactor-prompt.sh",
|
|
42
42
|
"pre-tool-use",
|
|
43
43
|
)
|
|
44
|
-
# Normalize leading-slash matching for repo-relative paths.
|
|
45
|
-
PROTECTED_REL = tuple(m.lstrip("/") for m in PROTECTED_MARKERS)
|
|
46
44
|
|
|
47
45
|
# Bash patterns that persist a bypass or relax enforcement.
|
|
48
46
|
BYPASS_PATTERNS = (
|
|
@@ -64,8 +62,11 @@ OVERRIDE = os.environ.get("UAP_SELF_PROTECT_OFF") == "1"
|
|
|
64
62
|
|
|
65
63
|
|
|
66
64
|
def _is_protected_path(rel_posix: str) -> bool:
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
# Ensure a leading separator so slash-anchored markers ("/policies/",
|
|
66
|
+
# "/src/policies/", …) match only a genuine path SEGMENT. Filename markers
|
|
67
|
+
# ("uap-policy-gate.sh", "anthropic-proxy.env") still match as substrings.
|
|
68
|
+
low = "/" + rel_posix.lower().lstrip("/")
|
|
69
|
+
return any(m in low for m in PROTECTED_MARKERS)
|
|
69
70
|
|
|
70
71
|
|
|
71
72
|
def main() -> None:
|