MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _is_path_allowed

Function _is_path_allowed

apps/connect/handlers/script.py:87–93  ·  view source on GitHub ↗
(real_path: str)

Source from the content-addressed store, hash-verified

85
86
87def _is_path_allowed(real_path: str) -> bool:
88 # Ensure path is within one of the allowed directories
89 for base in getattr(settings, "CONNECT_ALLOWED_SCRIPT_DIRS", []):
90 base_abs = os.path.abspath(base) + os.sep
91 if real_path.startswith(base_abs):
92 return True
93 return False
94
95
96class ScriptHandler(IntegrationHandler):

Callers 1

executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected