INNER CODE UNIT · Python

_RingMembershipReader

Soju06/codex-lb · app/main.py:352

class _RingMembershipReader(Protocol):
    def list_active(
        self,
        stale_threshold_seconds: int = RING_STALE_THRESHOLD_SECONDS,
        *,
        require_endpoint: bool = False,
    ) -> Awaitable[list[str]]: ...


@lru_cache(maxsize=4)
def _static_files_for_root(static_root: Path) -> StaticFiles:
    return StaticFiles(directory=static_root, check_dir=False)


def _resolve_static_asset_path(static_root: Path, requested_path: str) -> Path | None:
    """Return a filesystem path for a SPA asset only when it stays under static_root."""
    normalized = PurePosixPath(requested_path)
    if normalized.is_absolute() or ".." in normalized.parts:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…