Create an HTTP basic authentication callable

    Parameters
    ----------
    credentials: ~typing.Tuple[str, str]
        The (username, password)-tuple

    Returns
    -------
    ~typing.Callable[[Request], Request]
        A callable which adds basic authentication to a :class:`Request`.

def basic_auth(credentials):
    """Create an HTTP basic authentication callable

    Parameters
    ----------
    credentials: ~typing.Tuple[str, str]
        The (username, password)-tuple

    Returns
    -------
    ~typing.Callable[[Request], Request]
        A callable which adds basic authentication to a :class:`Request`.
    """
    encoded = b64encode(':'.join(credentials).encode('ascii')).decode()
    return header_adder({'Authorization': 'Basic ' + encoded})