Build an Authorization header for HTTP Basic Auth.

def build_basic_auth(username: str, password: str) -> str:
    """
    Build an Authorization header for HTTP Basic Auth.

    """
    # https://tools.ietf.org/html/rfc7617#section-2
    assert ":" not in username
    user_pass = f"{username}:{password}"
    basic_credentials = base64.b64encode(user_pass.encode()).decode()
    return "Basic " + basic_credentials