(real_path: str)
| 85 | |
| 86 | |
| 87 | def _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 | |
| 96 | class ScriptHandler(IntegrationHandler): |