def get_auth_factory(s: str) -> Callable[[str], tuple[str, str]]:
    """
    Parse a USER[:PASS] string and return a callable that takes the server URL
    and returns a (user, pass) tuple for that URL.
    The callable will prompt the user for the password if none was initially supplied.
    """
    user, _, password = s.partition(":")
    if not password:
        password = os.environ.get("PASS")

    if password:
        return lambda _: (user, password)
    else:
        return lambda url: (user, getpass.getpass(f"Password for {user} at {url}: "))

    Parse a USER[:PASS] string and return a callable that takes the server URL
    and returns a (user, pass) tuple for that URL.
    The callable will prompt the user for the password if none was initially supplied.
    
cvat-cli/src/cvat_cli/_internal/common.py