INNER CODE UNIT · Python

_resolve_scope_inputs

0xSteph/pentest-ai · cli/main.py:341

def _resolve_scope_inputs(
    scope_allow: list[str] | None,
    scope_exclude: list[str] | None,
    scope_file: str | None,
) -> tuple[list[str], list[str], dict]:
    """Parse --scope-allow / --scope-exclude, an optional --scope-file, and
    config.scope into (extra_allow, extra_exclude, config_scope).

    These are the allow/exclude entries that are NOT a target seed, so they can be
    applied to any single target's enforcer without pulling in sibling hosts. The
    caller seeds the target(s) separately via build_enforcer."""
    from pathlib import Path as _Path

    _scope_allow = list(scope_allow or [])
    _scope_exclude = list(scope_exclude or [])
    if scope_file:
        try:
            for _ln in _Path(scope_file).read_text().splitlines():

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…